round robin tournament home away distribution
I am writing a script that creates a tournament fixtures using round robin
algorithm with first team fixed. And it works well.
Problem is that when I create those fixtures I have to distribute home and
away as close as possible to HAHAHA... pattern where H - is home and A -
is away. Where limit is that team cannot play 3 home(or away) matches in a
row.
What I tried is preserving how many home and away matches each team played
and then team with lowest home or away number will play where it should.
For example
Team 1 (2 H and 1 A) VS Team 2 (with 2 H and 2 A)
Result would be :
Team 2(H) vs Team 1(A) // because Team 1 played least number away of games
Question: Is there other way to implement such home away distribution, and
if is what would be the idea behind it?
No comments:
Post a Comment