Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Divide people into teams for most satisfaction

Just a curiosity question. Remember when in class groupwork the professor would divide people up into groups of a certain number (n)?

Some of my professors would take a list of n people one wants to work with and n people one doesn't want to work with from each student, and then magically turn out groups of n where students would be matched up with people they prefer and avoid working with people they don't prefer.

To me this algorithm sounds a lot like a Knapsack problem, but I thought I would ask around about what your approach to this sort of problem would be.

EDIT: Found an ACM article describing something exactly like my question. Read the second paragraph for deja vu.

like image 384
Jon W Avatar asked May 16 '10 20:05

Jon W


3 Answers

To me it sounds more like some sort of clique problem.

The way I see the problem, I'd set up the following graph:

  • Vertices would be the students
  • Two students would be connected by an edge if both of these following things hold:
    1. At least one of the two students wants to work with the other one.
    2. None of the two students doesn't want to work with the other one.

It is then a matter of partitioning the graph into cliques of size n. (Assuming the number of students is divisible by n)

If this was not possible, I'd probably let the first constraint on the edges slip, and have edges between two people as long as neither of them explicitly says that they don't want to work with the other one.

As for an approach to solving this efficiently, I have no idea, but this should hopefully get you closer to some insight into the problem.

like image 110
Sebastian Paaske Tørholm Avatar answered Nov 05 '22 06:11

Sebastian Paaske Tørholm


You could model this pretty easily as a clustering problem and you wouldn't even really need to define a space, you could actually just define the distances:

Make two people very close if they both want to work together. Close if one of them wants to work with the other. Medium distance if there's just apathy. Far away if either one doesn't want to work with the other.

Then you could just find clusters, yay. Then split up any clusters of overly large size, with confidence that the people in the clusters would all be fine working together.

like image 28
JSchlather Avatar answered Nov 05 '22 08:11

JSchlather


This problem can be brute-forced, hence my approach would be first to brute force it, then fix it when I get a better idea.

like image 1
o0'. Avatar answered Nov 05 '22 06:11

o0'.