1

I am trying to implement an algorithm that fairly distributes people into groups, given their ranking of those groups, while also taking into account their preference for partners.

I have modeled this as a directed graph with upper and lower bounds and costs on edges representing their ratings. Finding a solution would simply mean maximizing the flow between a source and a drain.

However finding an algorithm that can actually solve this has proven difficult. The only one I came across that seems to match all my requirements is the Out-Of-Kilter algorithm.

Literature about this algorithm is very sparse and dense though. I could also not find a good implementation of it.

I found this one https://github.com/MichalNowicki/NumericalAlgebraCodes but it seems to have some errors, since it produces solutions that do not conserve flow.

What am I missing here? Is there an easier algorithm? Is there a good implementation somewhere out there?

Any help would be greatly appreciated.

D.W.
  • 167,959
  • 22
  • 232
  • 500
Lucy Kalwa
  • 11
  • 1

1 Answers1

2

If I understand correctly, your problem can be formulated as a minimum cost flow problem, but with lower bounds (demands) on the flow through each edge.

For details how to handle the lower bounds, see Determine whether a flow can satisfy node demands in a directed acyclic graph or the corresponding part of Jeff Erickson's Algorithms textbook; or see Network flow - minimum flow through edge.

D.W.
  • 167,959
  • 22
  • 232
  • 500