Twenty golfers wish to play in foursomes for 5 days. Is it possible for each golfer to play no more than once with any other golfer?

This is known in mathematics as the Social Golfer Problem. Over Thanksgiving 2017, my dad posed a very similar problem: 28 students in discussion groups of size 4, rotated five times so that no two students are grouped together twice – with additional constraints restricting certain students from ever being grouped together. Puzzling over the problem together led us into the world of combinatorics.

It turns out the Social Golfer Problem (and the closely related Kirkman’s Schoolgirl Problem) are solved, but full generalizations of them are *hard* – even for computers. I went looking for an existing solution and couldn’t find one I was happy with. Dad assured me that it didn’t need to be perfect, just good enough for a teacher trying to organize a group. So I built my own:

Good-Enough Golfers is a near-solver for this class of scheduling problems. It attempts to schedule `g x p` players into `g` groups of size `p` for `w` weeks such that players meet a minimum number of times. Real solutions to this problem can be extremely slow, but GEG’s approximations are fast and often good enough for real-world purposes.

It’s also free and open-source.

Fantastic help for training weeks! Thank you so much! But: In real life there is an additional constraint: A single handicapper does not want to play with a beginner. Question: Could you put up a further constraint relating to handicaps, e.g. forming three handicap categories and asking the programme, to combine only golfers in the same handicap category or one under or above. So the first category of golfers would not play with the golfers of the third category. Second constraint (on one day only): No mixed flights Third constraint (on one day only): Couples play together, where possible. Thank you for your ideas

To be honest, I know nothing about golf so I wasn’t considering constraints like this – I was just trying to solve a more general version of the problem.

The “couples play together” constraint is an interesting one. The other two could be created ad-hoc in the existing tool with pairwise blacklisting, but a feature to encourage players to be paired (or similarly, letting a “player” fill multiple seats) would be a new feature.