2

I am trying to automatically generate a schedule for a volleyball tournament I am organizing. It is mainly for fun. The rules are as follows:

  • Teams that sign up consist of 2 players
  • There are 36 such teams
  • For a match, 3 such teams get put together to a "game team", so a match consists of 3 teams vs. 3 teams
  • Every team plays 5 matches
  • There are 3 courts than can be played at the same time
  • Thus, a total of 10 rounds will be played (18 teams can play at the same time, so that is 36/2*5 rounds = 10 rounds)
  • Games are officialled by teams

Additional constraints are:

  • Every team officials at most once
  • If possible, a team should not play with another team that it already played with before (if it played against, it is fine)
  • There should not be more than 2 rounds break in between games for each team

Now I thought that this sounds like a problem that prolog is a good choice for. Unfortunately, I only have theoretical experience with it. It would be great if anybody could give me a good starting point with this, especially on how to fulfil constraints like "official at most once" and "every team plays 5 times". Also, a more compact representation of teams than

team(A).
team(B).
....

would be great. I already tried implementing this in Java,but came to the conclusion that it is not a well suited language. I'd like to do this in prolog now.

mat
  • 40,498
  • 3
  • 51
  • 78
RunOrVeith
  • 4,487
  • 4
  • 32
  • 50
  • 3
    Prolog is indeed a great choice for such tasks. For a start, check out the very similar previous question about [tennis match scheduling](http://stackoverflow.com/questions/4747498/tennis-match-scheduling) and your Prolog system's CLP(FD) documentation and sample programs. – mat Jan 08 '16 at 14:40

0 Answers0