Search code examples
algorithmgraph-algorithmbipartite

How to choose a productive group of employees?


I have employees and matrix with ranks how are they working with each other with the results from 0 to 10. I have to select groups with two people and give them work. The problem is I don't know how should I choose groups that sum up group works will be the highest.

   A  B  C  D
A  -  3  10 3
B  3  -  0  3
C  10 0  -  3 
D  3  3  3  -

For the given example, it would be <A,C>,<B,D> _ 10 + 3 = 13


Solution

  • You are trying to solve the Maximum Weight Matching problem.

    Wikipedia links to a paper and a C++ implementation by Vladimir Kolmogorov: http://pub.ist.ac.at/~vnk/papers/BLOSSOM5.html