« View all new features in Mathematica 9  previous  |  next 
New in Mathematica 9Enhanced Graphs and Networks

Maximum Flows and Minimum Cost Flows 

Based on a 1940 Soviet railway network, find the maximum amount of cargo that can be transported from sources in the Western Soviet Union to destinations in Eastern Europe countries.
In[4]:=
Click for copyable input
X
In[1]:=

The maximum flow value from indexed cities {1, 5, 6, 7, 9, 12, 13, 18} to {44, 40}.

In[2]:=
Click for copyable input
X
Out[2]=

Visualize the flow.

In[3]:=
Click for copyable input
X
In[5]:=
Click for copyable input
X
Out[5]=