This is a source code for a lacross scheduling tool I wrote for my son's sixth grade lacrosse team that I was coaching at the time.
bundle exec rake roster:generate2
bundle exec rake roster:generate
And it reads a local list of players and positions and then generates a schedule that attempts to balance everything
Dedicated with all my love to my eldest, Alex -- Dad