I have the following problem:
There are n entities (persons) having a common attribute (weight) and I need to build weight categories (this is for a sports event) grouping people based on their weight. The weight of the people in one group should be as equal as possible.
Problem/Opportunity is that the group size can vary. The groups should usually hold 4 persons, but can be 5 or 3 persons as well if that fits better. 2 or 1 only in exceptions, usually at the upper and lower end.
It sounds somehow like a clustering problem, but I could not find a variant matching this kind of problem.
- Person 1: 15kg
- Person 2: 20kg
- Person 3: 21kg
- Person 4: 27kg
- Person 5: 27.5kg
- Person 6: 27.7kg
- Person 7: 28kg
- Person 8: 28.1kg
- Person 9: 29kg
This should result in 4 groups:
1: 1 2: 2+3 3: 4-6 4: 7-9
Even though group 3 could also have 4 competitors, group 4 would then be left with two only.
I can probably come up with more rules, but my main question is if there is a algorithm/problem I can use as start point.