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

Assignment Problems 

A math department would like to offer seven courses. There are eight professors, each of whom is willing to teach certain courses. Find a maximal matching where professors only teach courses they are interested in teaching.

Build a bipartite graph between professors and courses they are interested in teaching.

In[1]:=
Click for copyable input
X

The maximum flow from all professors to all courses show the matching.

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