Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating home/away produce schedule where one team has much more matches on first half #4

Open
sandrozdravkovic opened this issue Feb 14, 2020 · 2 comments

Comments

@sandrozdravkovic
Copy link

I'm using
Generate a random home-away schedule where each player meets every other player twice, once at home and once away, using the $rounds integer parameter:

$teams = ['The 1st', '2 Good', 'We 3', '4ward'];
$rounds = (($count = count($teams)) % 2 === 0 ? $count - 1 : $count) * 2;
$schedule = schedule($teams, $rounds);

Lets create schedule for 12 teams and if we have season split up on 2 half's ( 11 rounds on first half, and 11 rounds on second half). One team on first half should have 5 or 6 matches where it plays at home, but it happens that one team has 7 matches on first half and 4 matches on second half.
Could you please take a look and possibly try to fix this

@mnito
Copy link
Owner

mnito commented Feb 18, 2020

The home-away algorithm used in this library is a simple heuristic algorithm that can produce unbalanced home-away schedules. While I personally do not plan on expanding upon the current algorithm or replacing it with a new algorithm, I am open to discussion of potential alternate solutions or to contributions that create more balanced home-away schedules.

@robsontenorio
Copy link

@mnito are you accepting a PR for generate full home-away ballanced schedule?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants