-1

I'm trying to find an algorithm to sort a group of students into small groups based on preferences. Each student selects three students they want to work with and three students they don't want to work with. The rest are assumed to be "could work with if necessary."

What's the best way to find the combination of students that best matches their preferences?

Mark
  • 195
  • 1
  • 18
  • I'm not sure, probably a [K-mean clustering](http://en.wikipedia.org/wiki/K-means_clustering)? With mean function being is chosen in a way that puts negative weight on dislike and postive weight on like. – Vikas Nov 12 '12 at 14:56
  • I'm actually a high-school teacher who is constantly trying to organize students into groups. I'm trying to automate this process so kids enter their preferences on an online survey and are assigned to groups once the whole class has completed the survey. – Mark Nov 12 '12 at 15:04
  • Branch & Bound would work, but that's probably not the best algorithm. – harold Nov 12 '12 at 15:38
  • k-mean as proposed by @Vikas seems like what you want. Though allow me to say that I deem it unwise letting children choose in such a manner. It'll result in the "cool" kids grouping up, and the "losers" being isolated. It also doesn't help them insofar as they don't learn coping/socializing with someone they don't like. Something like random assignment, maybe with a _little_ bias given by a "preference" sounds like a much better idea to me. (Also, being pedantic, choosing 3 others to work with results in groups of 4, not 3). – Damon Nov 12 '12 at 17:04
  • 1
    The generalized problem "generate `k` groups" and without restriction on the number of "dislikes" is NP-Hard and reduceable from the [graph-coloring problem](http://en.wikipedia.org/wiki/Graph_coloring), which is NP-Hard, by the simple reduction: Each edge is a "dislike" - find `k` groups, each generated group in the solution is a color in the graph coloring. – amit Nov 12 '12 at 20:14
  • I will attempt to implement what I can understand of a k-mean solution using python although it seems like a "very-hard" problem to me (not being maths or IT)... Thanks for the ideas. – Mark Nov 12 '12 at 23:00
  • The number of likes and dislikes does not have to be related to group size. As far as classroom strategies go - Damon is right in that it can allow or support friendship groups, but with the correct scaffolding it can also give students the opportunity take risks and responsibility for their own learning. – Mark Nov 12 '12 at 23:13

1 Answers1

1

I imagine simulated annealing would do the trick nicely, without being hard to implement.

Rafe
  • 5,237
  • 3
  • 23
  • 26
  • OK well thanks for the advice. I did have a go. If you wish to be amused, you may check out the result: [link](http://bit.ly/UmHMCt) .The numbers correspond to the elements in the names list. – Mark Nov 13 '12 at 18:29
  • @Mark - Happy to help -- did it generate good quality results? – Rafe Nov 15 '12 at 02:53