Title: Tutorial on Scheduling Sports Tournaments
1Tutorial on Scheduling Sports Tournaments
- Michael Trick
- Tepper School of Business
- Carnegie Mellon University
- CORS/INFORMS Banff
- May, 2004
2Goals
- Outline main approaches to creating tournament
schedules - Combinatorial Design
- Integer Programming
- Constraint Programming
- Give a selection of open problems
- Identify promising new research directions
- Primarily based on survey paper by Kelly Easton,
George Nemhauser and me.
3Outline
- Round robin scheduling
- Combinatorial Design
- Integer and Constraint Programming
- Round robin schedule with venues (home/away)
- Multiphase Approach
- Schedule then Break
- Traveling Tournament Problem
- Sample Leagues
4Why Sports Scheduling???
- Big Business!
- US National TV pays 500 million / year for
baseball - College basketball conferences get up to 30
million - Manchester United has (had) a market cap of 400
million - No rights holder wants to pay those sums and then
get a bad schedule. - Huge variety of problem types
- Small instances are difficult
- Strong break between easy/hard (for all
algorithms) - Significant theoretical background
- CP and IP differ in modeling
- CP has clean models with 1..n variables
- IP uses 0-1 variables reasonably naturally
- Practical interest in instances at the easy/hard
interface
5Sample Problem
10 teams 1..10, play each other once
5 games per time slot (all teams
play every slot), 9
slots How hard can this be?
Slot 1 1 vs 2, 3 vs 4, 5 vs 6, 7 vs 8, 9 vs 10
Slot 2 1 vs 4, 2 vs 3, 5 vs 8, 6 vs 9, 7 vs 10
Slot 3 1 vs 6, 2 vs 5, 3 vs 10, 4 vs 7, 9 vs 8
Slot 4 1 vs 8, 2 vs 7, 3 vs 6, 4 vs 9, 5 vs 10
Slot 5 1 vs 10, 2 vs 9, 3 vs 8, 4 vs 5, 6 vs 7
Slot 6 1 vs 3, 2 vs 4, 5 vs 7, 6 vs 8,
Uh oh! Stuck with 4 slots to go!
6Not convinced?
1
Graph of remaining games Every slot is perfect
matching (or 1-factor) No perfect matching in
graph of remaining games
9
3
7
5
2
4
10
6
8
7Premature Sets
- Example of premature set (Rosa and Wallis) set
of scheduled slots that cannot be completed to
round robin schedule - Exist for n (or more) slots do not exist for
3 slots (for 2ngt6)
Open Problem What is size of minimum
premature set?
8Round Robin Tournaments
- 2n teams
- 2n-1 time slots
- Every team plays one other team in every time
slot - Every team plays every other team exactly once
during tournament
9Existence
- Is there a round-robin schedule for every 2n
teams? - Yes Kirkman 1847 or earlier
- Two constructions
- Circle method
- Greedy algorithm
10Circle Method
- Number teams 1..2n
- In slot i have
- i vs 2n
- a vs b for ab 2i (mod 2n-1)
11Sample (2n10)
- Slot 1 10 vs 1 2 vs 9 3 vs 8 4 vs 7 5 vs 6
- Slot 2 10 vs 2 3 vs 1 4 vs 9 5 vs 8 6 vs 7
- Slot 3 10 vs 3 4 vs 2 5 vs 1 6 vs 9 7 vs 8
- Slot 4 10 vs 4 5 vs 3 6 vs 2 7 vs 1 8 vs 9
- Slot 5 10 vs 5 6 vs 4 7 vs 3 8 vs 2 9 vs 1
- Slot 6 10 vs 6 7 vs 5 8 vs 4 9 vs 3 1 vs 2
- Slot 7 10 vs 7 8 vs 6 9 vs 5 1 vs 4 2 vs 3
- Slot 8 10 vs 8 9 vs 7 1 vs 6 2 vs 5 3 vs 4
- Slot 9 10 vs 9 1 vs 8 2 vs 7 3 vs 6 4 vs 5
12Why Circle Method?
1
9
2
Continue rotating to get all the slots. Key
is initial set of games have all differences
8
3
10
7
4
6
5
Slot 2
Slot 1
13Greedy Method
- Order matches (i,j) in lexicographic order
- (i,j) before (i,k) if jltk
- (i,j before (k,l) if iltk
- Order slots in cyclic order
- Assign (1,2) to slot 1
- Repeatedly assign each game to either current
slot or next slot it can feasibly go into
14Example (n10)
- 1 vs 2 3 vs 9 4 vs 8
- 1 vs 3 2 vs 10 4 vs 9
- 1 vs 4 2 vs 3
- 1 vs 5 2 vs 4 3 vs 10
- 1 vs 6 2 vs 5 3 vs 4
- 1 vs 7 2 vs 6 3 vs 5 4 vs 10
- 1 vs 8 2 vs 7 3 vs 6 4 vs 5 etc.
- 1 vs 9 2 vs 8 3 vs 7 4 vs 6
- 1 vs 10 2 vs 9 3 vs 8 4 vs 7
15Equivalence
- Anderson (1991) showed equivalence (rounds in
different order) - Other non-equivalent schedules possible
- Lots of choices even among one of these permute
slots, team numbers
16Adding Requirements
- Generally lots of other things you would like in
a schedule - Carry-over effects
- Venues
- Fixed/prohibited games
- Objective function
- Some of this can still be done directly
17Carry Over Effects
- Slot 1 10 vs 1 2 vs 9 3 vs 8 4 vs 7 5 vs 6
- Slot 2 10 vs 2 3 vs 1 4 vs 9 5 vs 8 6 vs 7
- Slot 3 10 vs 3 4 vs 2 5 vs 1 6 vs 9 7 vs 8
- Slot 4 10 vs 4 5 vs 3 6 vs 2 7 vs 1 8 vs 9
- Slot 5 10 vs 5 6 vs 4 7 vs 3 8 vs 2 9 vs 1
- Slot 6 10 vs 6 7 vs 5 8 vs 4 9 vs 3 1 vs 2
- Slot 7 10 vs 7 8 vs 6 9 vs 5 1 vs 4 2 vs 3
- Slot 8 10 vs 8 9 vs 7 1 vs 6 2 vs 5 3 vs 4
- Slot 9 10 vs 9 1 vs 8 2 vs 7 3 vs 6 4 vs 5
4 almost always plays against team who
just played 2
18Balancing Carryover
- In example 4 has carry over effect from 2 almost
exclusively - Possible to spread carryover effect out (no
more than 1 time from any other team)?
19Solution
- Yes, Russell (1980), if 2n 2n
- Slot 1 1 vs 4 2 vs 5 3 vs 8 6 vs 7
- Slot 2 1 vs 5 2 vs 4 3 vs 6 7 vs 8
- Slot 3 1 vs 6 2 vs 8 3 vs 5 4 vs 7
- Slot 4 1 vs 7 2 vs 3 4 vs 6 5 vs 8
- Slot 5 1 vs 8 2 vs 6 3 vs 4 5 vs 7
- Slot 6 1 vs 2 3 vs 7 4 vs 5 6 vs 8
- Slot 7 1 vs 3 2 vs 7 4 vs 8 5 vs 6
20What about for other 2n?
- Combinatorial design does not (seem to) help
- Construction of Russell involves Galois Fields
(finite fields) might be generalized (though
GF(n) does not exist for all n) - Seems unlikely that balanced schedule exists, but
best balance is unknown (measured by sum of
squared carryover values)
21Current State
- 2n Value
- 6 60 (optimal Henz, Mueller, Thiel)
- 8 56 (optimal Russell)
- 10 122 (Trick)
- 12 188 (HMT and van Brandenburg)
- 14 260 (Russell)
- 16 240 (optimal, Russell)
- 18 428 (Russell)
- 20 520 (Russell)
Open Problem Improve on the carryover values
22Additional/Alternative Requirements
- Gets messier and messier as more requirements get
added. - Quickly get into NP-hard problems
- Example Fix all but 3 slots. Completion problem
is NP-complete (Easton, 2003) - Need to use algorithms like integer
programming/constraint programming - Studied in HMT (2004) and Trick (2003)
23Basic Formulation
- Two fundamental constraints
- In every time slot, the games correspond to a
one-factor (or matching) - For every team, its opponents over all slots are
all-different - ATL NYM PHI MON
- --- --- --- ---
- PHI MON ATL NYM
- NYM ATL MON PHI
- MON PHI NYM ATL
-
All-different
24One Slide on Formulating in IP
- Variables can be either continuous or integer
valued (often 0-1 variables) - Constraints are linear inequalities of these
variables - 3x12x212x3 13
- x2-x3 0
- etc.
- Objective is linear function of the variables
- 12x12x2-3x3
25Integer Program
- Int n
- Range Teams 0..n-1
- Range Slots 1..n-1
- Range Binary 0..1
- Var Binary playsTeams, Teams, Slots //
playsi,j,t is 1 if - // i plays
j in slot t - Solve
- forall (i in Teams, t in Slots) playsi,i,t
0 - //one-factor
- forall (ordered i,j in Teams, t in Slots)
- playsi,j,t playsj,i,t
- forall (i in Teams, t in Slots)
- sum (j in Teams) playsi,j,t 1
- // all-different
- forall (i,j in Teams iltgtj) sum(t in Slots)
playsi,j,t 1
26Two Slide Introduction to Constraint Programming
- Variables begin with a feasible domain (generally
not 0,1) - Constraints reduce the feasible domains through
domain reduction - Much cleverness in defining interesting
constraints and doing domain reduction - After domain reduction
- If domain becomes empty infeasible
- If domains are singletons solution
- Otherwise, branch
27Two Slide Example of Constraint Programming
- Variables x,y,z. D(x) 1,2, D(y)2,3, D(z)
3. - Constraint all-different(x,y,z)
- Effects D(y) becomes 2 which forces D(x)1
- This domain reduction gives unique values to all
variables
28Constraint Program
- Int n
- Range Teams 0..n-1
- Range Slots 1..n-1
- Var Teams opponentTeams,Slots
- Solve
- forall (i in Teams, t in Slots)
opponenti,tltgti - //one-factor
- forall (t in Slots)
- one-factor(all (i in Teams) opponenti,t)
- //all-different
- forall (i in Teams)
- all-different(all (t in Slots) opponenti,t)
29Constraint Program (cont)
- But how to implement one-factor and
all-different? - all-different is a well studied constraint with
multiple propagation algorithms - HMT show that all-different propagation should be
as strong as possible (expending extra work to
reduce domains is worth it) - Work done by Régin on how to do propagation for
this.
30Three Models for 1-Factor
- opponentopponenti,t,t i
- Forall (t in Slots)
- alldifferent(all i in Teams)
- opponenti,t
- Full propagation (uses nonbipartite matching
theorems)
31Illustration of Propagation
- Given domains
- D(1)2,4 D(2)1,3 D(3)2 D(4)1,3
- can represent as a graph
- opponentopponenti,t,t i removes any arc
without corresponding reverse arc - All-different removes any arc not part of any
union of node-disjoint cycles that covers all
nodes - One-factor removes any arc not part of any union
of node-disjoint even cycles that covers all nodes
1
2
3
4
32Propagation
Original
33Strength of Propagations
- HMT showed increasing strength and proposed
algorithm for one-factor - Not stronger, though, if domains are bipartite
partition nodes into X and Y such that domain of
anything in X is in Y and anyting in Y is in X. - Bipartite domains occur in
- Bipartite tournaments
- If home/away pattern is fixed.
34Improving IP Formulation
- Possible to add odd-cut constraints.
- forall (t in Slots, S ? Teams S odd)
- sum (i in S, j notin S) playsi,j,t gt 1
- Used to remove linear relaxations like
- Can be found by minimum cut calculation
(Gomory-Hu)
Value .5 on every edge Satisfies linear relax.
35Interesting Parallels
- Odd-cuts are useful exactly when the HMT method
is useful nonbipartite domains. - Use same underlying theory nonbipartite matching
theory of Edmonds, etc.
36Comparing IP and CP
- Decision on IP vs CP is primarily computational
- What instances to solve? Just finding
unconstrained Round Robin is not interesting - Possible changes
- Fixed/Prohibited games
- Objective function
37Test 1 Prohibited games
- Series of prohibitions of the form (k,i,j) in
slot k, i cannot be at j - Now problem is NP-complete (Schaerf)
- Easy to add to both CP and IP
- HMT give test instances (divide their time by
4.5 to normalize machine speeds)
38Test 1 Prohibited Games Results
Problem Size All-different All-different Basic-IP Basic-IP HMT HMT
F T N T F T
S_10_no 10 23 0.02 4 0.10 6 0.01
S_12_no 12 24 0.07 0 0.14 25 0.17
S_14_no 14 135 0.23 50 1.02 69 0.56
S_16_no 16 79 0.30 0 0.39 86 1.19
S_18_no 18 43 0.32 0 0.42 30 0.50
S_20_no 20 696 5.47 0 0.78 254 5.11
39Test 2 Recognizing Premature Sets
- Take n10, 14, 18 etc. Divide into 2 divisions
(0..4 and 5..9). Play between divisions for
n/2-1 slots. - Note since odd number of teams in division,
divisions cannot play solely within themselves
- Slot 0 1 2 3 4 5
- --- ------------------
- 3 4 5 0 1 2
- 4 5 3 2 0 1
- 5 3 4 1 2 0
-
-
-
INFEASIBLE! Why?
40Test 2 Premature Sets
- Only fix 2 games in slot n/2 result still
infeasible but hard to prove
Size All_different All_different Basic-IP Basic-IP Strong-IP Strong-IP
F T N T N T
10 116 0.20 393 0.19 0 0.20
14 --- --- --- --- 0 0.34
18 --- --- --- --- 0 0.32
22 --- --- --- --- 0 0.38
41Test 2 Premature Sets
- Not unfair test realistic set of requirements
on a schedule - Points to possibility of improved cuts/
constraints
42Test 3 Maximum Value Schedules
- There may be a value for having i play at j in
slot k predicted ratings, attendance, team
preferences, etc. - Objective could be to maximize total value (other
possibilities maximize minimum value, etc.) - Easy to modify CP and IP
43Test 3 Maximum Value Schedules Results
- Results are clear (despite efforts to find good
search strategy for CP)
Size All_different All_different Basic_IP Basic_IP
F T N T
8 84962 5.33 0 0.03
10 --- --- 66 0.29
12 --- --- 402 3.59
14 --- --- 7263 133.03
44IP vs CP
- IP and CP are competitive
- Neither are truly satisfying at this stage
Open Problem Fully test Strong IP formulation
Open Problem Devise constraints/cuts that go
beyond the one-factor and all-different
individual constraints
45Venues
- Key issue in many leagues
- Every team has a home stadium (court, arena,
etc.). - Each game is either a home game or an away
game for a team - Issues with
- Consecutive home/away
- Subgroup counts (so many home in first half, so
many home on weekends, etc.)
46Handling venues
- Combinatorial Approaches
- Direct addition to integer program and/or
constraint program - Multiple phase approaches
- Home/away pattern generation
- Schedule then break approaches
47Combinatorial Approaches
- De Werra did much work on this in 1980s
- Generally concerned with minimizing breaks
- Ideal home/away pattern in HAHAH.. (or reverse)
- HH or AA is called a break
48Basic insights
- Teams need breaks! No more than 1 each of
- HAHAHAH
- AHAHAHA
- So, for round robin of 2n teams, there are at
least 2n-2 breaks
49Minimum Break Schedule
- De Werra (1981) suggests following for canonical
schedule - In slot i, i plays 2n, other games are of form
ik vs i-k for all values of k - Let ik play at i-k if k is odd
- Let i-k play at ik if k is even
- Let i play at 2n if i is even
- Let 2n play at i if i is odd
50Sample
- 1 2 3 4 5 6
- 1 6 5 _at_4 3 _at_2 _at_1
- 2 _at_3 _at_6 1 _at_5 4 2
- 3 5 _at_4 6 2 _at_1 _at_3
- 4 _at_1 2 _at_5 _at_6 3 4
- 5 4 _at_3 2 _at_1 6 _at_5
4 breaks minimal
51Facts about breaks
- Occur in pairs
- Each team has at most one
- 2 teams with 0
- Pattern (0,2,0,2) (di breaks after slot i)
- In general, (2,2,2) not possible
- (2,2,0,2,2,)
- Miyashiro, Iwasaki, and Matsui have necessary
condition
Open Problem Characterize feasible break
patterns for min-break schedules
52Other way
- Given a round robin schedule, assign home/away so
as to minimize breaks
1 2 3 4 5 6 1 6 5 4 3 2 1 2 3 6
1 5 4 2 3 5 4 6 2 1 3 4 1 2 5 6 3
4 5 4 3 2 1 6 5
1 2 3 4 5 6 1 6 5 4 _at_3 _at_2 _at_1 2 _at_3 6
1 5 _at_4 _at_2 3 _at_5 _at_4 _at_6 2 1 3 4 1 _at_2 5
6 _at_3 _at_4 5 4 3 _at_2 _at_1 _at_6 5
9 breaks (but there are better solutions!)
53Schedule then break
- Given a round-robin schedule, assign home/away so
as to minimize breaks - Régin Constraint Program (up to 20)
- Trick Integer Program (up to 22)
- Elf, Juenger, Rinaldi Maximum Cut (up to 26)
- Miyashiro and Matsui polynomial if 2n-2 breaks
suffice
Open Problem Is the Minimum Break problem
NP-complete?
54More general venue constraints
- Min-break is not always appropriate
- College basketball plays twice per week, so
something like HHAAHH is best - Major League Baseball likes things like
HHHAAAHHH - Additional restrictions like weekend counts,
alternations, etc.
55Add to IP and CP
- Can modify previous IP and CP formulations to
include home/away aspects - Add variables to homei,t which equals 1 if i
home in time t (and constraints of the form if i
plays j, exactly 1 is at home).
56Limits on Consecutive Home/Away
- Constraint Program clear winner
N K Integer Program Integer Program Constraint Program Constraint Program
N T F T
14 1 2 59.71 312 1.21
14 2 9 70.10 11 0.20
14 3 11 82.34 3 0.18
14 4 20 169.42 2 0.19
57No Singletons
- More interesting to prohibit singletons (Single
home surrounded by Aways or vice-versa) - Easy to add such constraints
- homei,tlt
- homei,t-1homei,t1
58Test 5 No Singletons Results
N K Integer Program Integer Program Constraint Program Constraint Program
N T F T
8 3 1516 22.73 --- ---
8 4 77 0.92 --- ---
10 3 --- --- --- ---
10 4 15268 594.70 --- ---
59Other approaches
- Note problem size, however even small problems
are getting hard to solve - Alternative is to have multiple phase approach
60Phase 1 Find HAPs
- Find Home/Away pattern, one sequence per team
- 1 HAHAH
- 2 AHAHA
- 3 HHAAH
- 4 HAHHA
- 5 AAHHA
- 6 AHAAH
- Â
Open Problem Characterize feasible H/A
patterns
61Phase 2. Assign Games
- Assign games consistent with HAP
- ( denotes home - is away)
- 1 2 -3 6 -4 5
- 2 -1 4 -5 6 -3
- 3 6 1 -4 -5 2
- 4 5 -2 3 1 -6
- 5 -4 -6 2 3 -1
- 6 -3 5 -1 -2 4
- Â
62Phase 3. Assign Teams
- Assign teams to entries
- F E -A B -D C
- E -F D -C B -A
- A B F -D -C E
- D C -E A F -B
- C -D -B E A -F
- B -A C -F -E D
- Â
63Solving Subproblems
- Nemhauser and Trick (1998, Scheduling ACC) IP
for phase 1 and 2, complete enumeration for 3 - Henz (2001) CP for all phases much faster,
particularly relative to complete enumeration - Lots of other papers in same vein (often in
different orders Cain, Schreuder, Russell and
Leung, etc.) - Very robust and flexible approach
64Final Problem
- Combine issues of venue with travel distance
- Traveling Tournament Challenge Problem
65Traveling Tournament Problem
- Given an n by n distance matrix D d(i,j) and
an integer k find a double round robin (every
team plays at every other team) schedule such
that - The total distance traveled by the teams is
minimized (teams are assumed to start at home and
must return home at the end of the tournament),
and - No team is away more than k consecutive games, or
home more than k consecutive games. - (For the instances that follow, an additional
constraint that if i is at j in slot t, then j is
not at i in t1.)
66Sample Instance
- NL6 Six teams from the National League of
(American) Major League Baseball. Distances - 0 745 665 929 605 521
- 745 0 80 337 1090 315
- 665 80 0 380 1020 257
- 929 337 380 0 1380 408
- 605 1090 1020 1380 0 1010
- 521 315 257 408 1010 0
- k is 3
67Sample Solution
- Distance 23916 (Easton May 7, 1999)
- Slot ATL NYM PHI MON FLA
PIT - 0 FLA _at_PIT _at_MON PHI _at_ATL
NYM - 1 NYM _at_ATL FLA _at_PIT _at_PHI
MON - 2 PIT _at_FLA MON _at_PHI NYM
_at_ATL - 3 _at_PHI MON ATL _at_NYM PIT
_at_FLA - 4 _at_MON FLA _at_PIT ATL _at_NYM
PHI - 5 _at_PIT _at_PHI NYM FLA _at_MON
ATL - 6 PHI _at_MON _at_ATL NYM _at_PIT
FLA - 7 MON PIT _at_FLA _at_ATL PHI
_at_NYM - 8 _at_NYM ATL PIT _at_FLA MON
_at_PHI - 9 _at_FLA PHI _at_NYM PIT ATL
_at_MON
68Simple Problem, yes?
NL12. 12 teams Feasible Solution 143655
(Rottembourg and Laburthe May 2001), 138850
(Larichi, Lapierre, and Laporte July 8 2002),
125803 (Cardemil, July 2 2002), 119990 (Dorrepaal
July 16, 2002), 119012 (Zhang, August 19 2002),
118955 (Cardemil, November 1 2002), 114153 (Van
Hentenryck January 14, 2003), 113090 (Van
Hentenryck February 26, 2003), 112800 (Van
Hentenryck June 26, 2003), 112684 (Langford
February 16, 2004), 112549 (Langford February 27,
2004), 112298 (Langford March 12, 2004), 111248
(Van Hentenryck May 13, 2004). Lower Bound
107483 (Waalewign August 2001)
69Successful Approaches Feasible Solutions
- Anagnostopolous, Michel, Van Hentenryck, and
Vergados use simulated annealing - Hard part is determining neighborhood structure
70Neighborhood
- No completely natural neighborhood most
swapping does not lead to feasible double round
robin schedule - Swap venues for a pair of games
- Swap 2 slots of games
- Swap schedule of 2 teams
- Partially swap 2 slots (swap 1 game then minimum
number to keep feasible) - Partially swap 2 teams (swap games in single slot
then minimum number to keep feasible)
71Successful Approaches Lower Bound
- Not much better than sum of minimum travel for
each team (solvable by series of small IPs or
CPs)
72Successful Approaches Optimality
- Easton uses parallel implementations with CP
generating good schedules for teams and IPs
putting schedules together (parallel branch and
price) - Able to prove optimality of 8 teams
Open Problem Find optimal solutions to the
Traveling Tournament Problem for 2n10
73Practical Implementations
- Trick and Nemhauser, then Easton, Nemhauser and
Trick on scheduling ACC Basketball - Scheuder and Dutch Football
- Trick then Easton, Nemhauser, and Trick on MLB
Baseball - Lustig and the NFL
- Lots of others (and would be even more if people
would listen more to us!)
74What is size of minimum premature set?
Fully test Strong IP formulation
Improve on the carryover values
Solve Real Scheduling Problems!
Devise constraints/cuts that go beyond the
one-factor and all-different individual
constraints
Characterize feasible break patterns for
min-break schedules
Open Problem Characterize feasible H/A
patterns
Open Problem Is the Minimum Break problem
NP-complete?
Open Problem Find optimal solutions to the
Traveling Tournament Problem for 2n10
75Further Information
- Easton, Nemhauser and Trick survey in Handbook of
Scheduling - http//mat.gsia.cmu.edu/TOURN
- This talk (or corrected version!) at
http//mat.gsia.cmu.edu/sports after conference