I'm trying to develop a grouping system that takes in a bunch of data for when particular students are available to meet and then spits out the "best" groups based on that data. Here I am defining best as the set of four-person groups which has the highest average number of matching hours per group.
The problem is, I don't know how to find every permutation of sets of four-person groups.
I started thinking: I could find every possible group of four... but a person can only be in one group. How about I find every possible group of four, and then I make a set of groups based on that starting group, where I only add groups who don't contain members already existing in the set.
I'm pretty confused. Any help getting me out of this hole would be greatly appreciated!