![]() ![]() Prefs=Ĭost=-100 # happy to assign first choicesĬost=-60 # slightly unhappy to assign second choicesĬost=-30 # very unhappy to assign third choices (As Networkx provides a min cost flow, but not max cost flow I have set the costs to beįor example, using Networkx and Python: import networkx as nx Set cost for a flow between a person and a project according to their preferences. You can solve this optimally by formulating it as a min cost network flow problem.Īdd a node for each person, and one for each project.
0 Comments
Leave a Reply. |