My tournament has two stages, groups + single elimination. When the groups stage ends, the x top of each group go to single elimination stage (brackets format). In the brackets stage there are two basics rules:
- a winner of a group should not be matched against a winner of another group (only against 2nd or 3rd place)
- no two teams that played in the same group should be matched against each other.
For example, if we have two groups like these:
Group A -> 1ºA, 2ºA, 3ºA, 4ºA
Group B -> 1ºB, 2ºB, 3ºB, 4ºB
And all teams of each group proceed, knockouts should be exactly:
1ºA vs 4ºB
2ºB vs 3ºA
1ºB vs 4ºA
2ºA vs 3ºB
I'm looking for an algorithm to help me create the knockouts in that order.
For clarify, another example:
if we have four groups like these:
Group A -> 1ºA, 2ºA, 3ºA, 4ºA
Group B -> 1ºB, 2ºB, 3ºB, 4ºB
Group C -> 1ºC, 2ºC, 3ºC, 4ºC
Group D -> 1ºD, 2ºD, 3ºD, 4ºD
The knockouts should be:
1ºA vs 4ºD
2ºB vs 3ºC
1ºC vs 4ºB
2ºD vs 3ºA
1ºB vs 4ºC
2ºA vs 3ºD
1ºD vs 4ºA
2ºC vs 3ºB
Thanks.