A lot of times, I’ve needed to split a given set of people into a given number of teams but with some complications, like:
- Alice and Bob CANNOT be on the same team.
- Carol and David just HAVE TO BE on the same team.
I feel like this is already a thing. There's gotta already be work in this problem. Where would I even start, in terms of an algorithm? It definitely can't be brute-forced.