I am working on a schedule for a volleyball league that is a double round robin with 9 teams. We have 31 potential dates to schedule the games. I have been using using paper and pencil to try and evenly distribute the teams. It has been a challenge as we have run into two issues: many split games (home/away) or when you solve for split games you end up with runs (6 of 7, 7 of 9) etc at home or on the road.
I would like to try and learn how to use an algorithm and computer software to do this. I have read a few articles and published papers. Any guidance or suggestions would be greatly helpful.
I have found a few codes that use PHP I believe, but I do not know how to utilize them:
<?php
$n = 4; // number of players in tournament
$functions = 2; // total number of versions of this function
if (isset($_GET['n']) && !empty($_GET['n']) && ctype_digit($_GET['n'])) {
$n = $_GET['n'];
}
if ( $n > 40 )
$n = 40;
$f = $functions;
if (isset($_GET['f']) && !empty($_GET['f']) && ctype_digit($_GET['f'])) {
$f = $_GET['f'];
}
if ( $f > $functions || $f < 1 )
$f = $functions;
// include and run function, using values of $f and $n
include "func.generate-rr$f.php";
echo "generateRoundRobinPairings($n);<br>\\n";
echo "Version: $f<br>\\n";
echo '<pre>' . generateRoundRobinPairings($n) . '</pre>';
?>