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?