I would like to create/implement a tournament scheduling algorithm which is able to deal with more than 2 participants per game.
The problem seems to be well known for 2 participants. See here for example: Round Robin Algorithm Implementation Java
Example of matchups with 6 teams (A, B, C, D, E, F):
In case of an odd number of teams (i.e. A, B, C, D, E), I would like to have a 3-way and a 2-way game per round: (ABC)(DE)
Once the 3-way problem is solved, I would like to do the same with 4-way games.
I am unable to create such an algorithm and unable to find a similar solution on the internet.
Could somebody point me in the right direction?
To choose K items from N, you need combinations.
Note that C(6,3)=20
but you do fixing one item (A) and have really C(5,2)=10
variants
There is a lot of implementations of combinations generation - the simplest is recursive, more effective is lexicographic ordered generation -simple C code