Constraint Programming




ACCB Solution



This problems seems to be easy enough to implement in a CSP system as the constraints can be easily put into a rigurous form.  However, just listing the constraints and expecting the CSP solver to find the solution will not lead to an efficient program.  Instead we are breaking the problem into 3 subproblems.

1.  Patterns
Find all (Home/Away/Bye) patterns that a team may follow. There are many constraints on these patterns and it turns out that there are only 38 patterns that a team may follow.

2. Pattern Sets
Knowing that each team may follow one of the 38 patterns, we are next trying to find all sets of 9 patterns that the teams could follow.  The constraints on these sets impose that in each week there are 4 teams playing at home and 4 away and one team has a bye.  Moreover, for each two teams there must be at least one week when they can meet (one plays away and the other at home).  There are only 17 such sets.

3. Timetables
The last step is assigning a pattern in the pattern set for each team, and stating the team specific constraints.  Because all the prunning that has been done in steps one and two, it is now feasible to find a solution.


The complete solution for this problem has been divided into a few files
(compile and run accb.pl after you download all files):

accb.pl  (text) -  just loading the other files and calling the main predicates.
patterns.pl  (text) -  step 1. above
pattern_sets.pl (text) -  step 2. above
timetable.pl - (text) - step 3. above
utils.pl  - (text) - some useful predicates not specific to this problem.

Hosted by www.Geocities.ws

1