Say I have four teams, ABCD, I want to create matches so that the teams evenly have to do them:
not desired
- A vs B
- A vs C
- A vs D
- B vs C
- B vs D
- C vs D
desired
- A vs B
- C vs D
- B vs C
- A vs D
- A vs C
- B vs D
Another way of putting it: I want the teams to have a match as few in a row as possible.
Target language is C#, but I can translate easily.
Edit: Quick sidenote, it can be more than 4 teams!
One way to solve this is by the following steps:
Some sample code: