tutorial on scheduling sports tournaments

Post on 02-Jan-2016

38 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Tutorial on Scheduling Sports Tournaments. Michael Trick Tepper School of Business Carnegie Mellon University CORS/INFORMS Banff May, 2004. Goals. Outline main approaches to creating tournament schedules Combinatorial Design Integer Programming Constraint Programming - PowerPoint PPT Presentation

TRANSCRIPT

Tutorial on Scheduling Sports Tournaments

Michael TrickTepper School of BusinessCarnegie Mellon University

CORS/INFORMS Banff May, 2004

Goals

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.

Outline

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

Why 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

Sample Problem10 teams: 1..10, play each other once; 5 games per time slot (all teams play every slot), 9 slotsHow 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

Uh oh! Stuck with 4 slots to go!

Slot 6: 1 vs 3, 2 vs 4, 5 vs 7, 6 vs 8, …

Not convinced?

9

1

75

3

6

2

410

8

Graph of remaining games

Every slot is perfect matching(or 1-factor)

No perfect matching in graphof remaining games

Premature 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 2n>6)

Open Problem: What is size of minimum premature set?

Round 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

Existence

Is there a round-robin schedule for every 2n teams?

Yes [Kirkman 1847 or earlier] Two constructions

Circle methodGreedy algorithm

Circle Method

Number teams 1..2n In slot i have

i vs 2na vs b for a+b ≡ 2i (mod 2n-1)

Sample (2n=10)

Slot 1: 10 vs 1 2 vs 9 3 vs 8 4 vs 7 5 vs 6Slot 2: 10 vs 2 3 vs 1 4 vs 9 5 vs 8 6 vs 7Slot 3: 10 vs 3 4 vs 2 5 vs 1 6 vs 9 7 vs 8Slot 4: 10 vs 4 5 vs 3 6 vs 2 7 vs 1 8 vs 9Slot 5: 10 vs 5 6 vs 4 7 vs 3 8 vs 2 9 vs 1Slot 6: 10 vs 6 7 vs 5 8 vs 4 9 vs 3 1 vs 2Slot 7: 10 vs 7 8 vs 6 9 vs 5 1 vs 4 2 vs 3Slot 8: 10 vs 8 9 vs 7 1 vs 6 2 vs 5 3 vs 4Slot 9: 10 vs 9 1 vs 8 2 vs 7 3 vs 6 4 vs 5

Why Circle Method?

10

1

5

3

7

8

9

6

4

2

Slot 1Slot 2

Continue rotatingto get all theslots. Key isinitial set of gameshave all differences

Greedy Method

Order matches (i,j) in lexicographic order (i,j) before (i,k) if j<k (i,j before (k,l) if i<k

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

Example (n=10)

1 vs 2 3 vs 9 4 vs 81 vs 3 2 vs 10 4 vs 91 vs 4 2 vs 31 vs 5 2 vs 4 3 vs 101 vs 6 2 vs 5 3 vs 41 vs 7 2 vs 6 3 vs 5 4 vs

101 vs 8 2 vs 7 3 vs 6 4 vs 5 etc.1 vs 9 2 vs 8 3 vs 7 4 vs 61 vs 10 2 vs 9 3 vs 8 4 vs 7

Equivalence

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

Adding Requirements

Generally lots of other things you would like in a scheduleCarry-over effectsVenuesFixed/prohibited gamesObjective function

Some of this can still be done directly

Carry 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 playsagainst team who justplayed 2

Balancing 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)?

Solution

Yes, Russell (1980), if 2n = 2n

Slot 1: 1 vs 42 vs 5 3 vs 8 6 vs 7Slot 2: 1 vs 52 vs 4 3 vs 6 7 vs 8Slot 3: 1 vs 62 vs 8 3 vs 5 4 vs 7Slot 4: 1 vs 72 vs 3 4 vs 6 5 vs 8Slot 5: 1 vs 82 vs 6 3 vs 4 5 vs 7Slot 6: 1 vs 23 vs 7 4 vs 5 6 vs 8Slot 7: 1 vs 32 vs 7 4 vs 8 5 vs 6

What 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)

Current 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

Additional/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)

Basic 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

atl phi

nym mon

All-different

One Slide on Formulating in IP Variables can be either continuous or

integer valued (often 0-1 variables) Constraints are linear inequalities of these

variables3x1+2x2+12x3 ≤ 13

x2-x3 ≤ 0

etc. Objective is linear function of the variables

12x1+2x2-3x3…

Integer Program

Int n= …Range Teams [0..n-1];Range Slots [1..n-1];Range Binary 0..1;Var Binary plays[Teams, Teams, Slots]; // plays[i,j,t] is 1 if // i plays j in slot tSolve {

forall (i in Teams, t in Slots) plays[i,i,t] = 0;//one-factorforall (ordered i,j in Teams, t in Slots)

plays[i,j,t] = plays[j,i,t];forall (i in Teams, t in Slots)

sum (j in Teams) plays[i,j,t] = 1;// all-differentforall (i,j in Teams: i<>j) sum(t in Slots) plays[i,j,t] = 1;

Two 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

Two 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

Constraint Program

Int n = …;

Range Teams [0..n-1];

Range Slots [1..n-1];

Var Teams opponent[Teams,Slots];

Solve {

forall (i in Teams, t in Slots) opponent[i,t]<>i;

//one-factor

forall (t in Slots)

one-factor(all (i in Teams) opponent[i,t]);

//all-different

forall (i in Teams)

all-different(all (t in Slots) opponent[i,t]);

Constraint 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.

Three Models for 1-Factor

opponent[opponent[i,t],t] = i

Forall (t in Slots)

alldifferent(all i in Teams)

opponent[i,t]

Full propagation (uses nonbipartite matching theorems)

Illustration of Propagation

Given domainsD(1)={2,4} D(2)={1,3} D(3)={2} D(4)={1,3}

can represent as a graph

opponent[opponent[i,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

i j j is in i‘s domain1

4

2

3

Propagation

Original

One-factor

i j j is in i‘s domain

opponent[opponent[i,t],t] = i

All-different

Strength 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 inBipartite tournamentsIf home/away pattern is fixed.

Improving IP Formulation Possible to add “odd-cut” constraints.

forall (t in Slots, S Teams: |S| odd)sum (i in S, j notin S) plays[i,j,t] >= 1

Used to remove linear relaxations like:

Can be found by minimum cut calculation (Gomory-Hu)

Value .5 on every edgeSatisfies linear relax.

S

Interesting Parallels

Odd-cuts are useful exactly when the HMT method is useful: nonbipartite domains.

Use same underlying theory: nonbipartite matching theory of Edmonds, etc.

Comparing IP and CP

Decision on IP vs CP is primarily computational

What instances to solve? Just finding unconstrained Round Robin is not interesting

Possible changesFixed/Prohibited gamesObjective function

Test 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)

Test 1: Prohibited Games: Results

Problem Size All-different Basic-IP 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

Test 2: Recognizing Premature Sets

Take n=10, 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--- ------------------1 3 4 5 0 1 22 4 5 3 2 0 13 5 3 4 1 2 04 5 6

INFEASIBLE! Why?

Test 2: Premature Sets

Only fix 2 games in slot n/2: result still infeasible but hard to prove:

Size All_different

Basic-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

Test 2: Premature Sets

Not unfair test: realistic set of requirements on a schedule

Points to possibility of improved cuts/ constraints

Test 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

Test 3: Maximum Value Schedules: Results

Results are clear (despite efforts to find good search strategy for CP):

Size All_different 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

IP 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

Venues

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.)

Handling venues

Combinatorial Approaches Direct addition to integer program

and/or constraint program Multiple phase approaches

Home/away pattern generationSchedule then break approaches

Combinatorial Approaches

De Werra did much work on this in 1980s

Generally concerned with minimizing breaksIdeal home/away pattern in HAHAH..

(or reverse)HH or AA is called a break

Basic 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

Minimum Break Schedule

De Werra (1981) suggests following for canonical schedule:In slot i, i plays 2n, other games are of

form i+k vs i-k for all values of kLet i+k play at i-k if k is oddLet i-k play at i+k if k is evenLet i play at 2n if i is evenLet 2n play at i if i is odd

Sample

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

4 breaks: minimal

Facts 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

Other way

Given a round robin schedule, assign home/away so as to minimize breaks

1 2 3 4 5 61 6 5 4 3 2 12 3 6 1 5 4 23 5 4 6 2 1 34 1 2 5 6 3 45 4 3 2 1 6 5

1 2 3 4 5 61 6 5 4 @3 @2 @12 @3 6 1 5 @4 @23 @5 @4 @6 2 1 34 1 @2 5 6 @3 @45 4 3 @2 @1 @6 5

9 breaks (but there are better solutions!)

Schedule then break

Given a round-robin schedule, assign home/away so as to minimize breaksRé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?

More general venue constraints

Min-break is not always appropriateCollege 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.

Add to IP and CP

Can modify previous IP and CP formulations to include home/away aspects

Add variables to home[i,t] which equals 1 if i home in time t (and constraints of the form “if i plays j, exactly 1 is at home”).

Limits on Consecutive Home/Away

Constraint Program clear winner:N K Integer

ProgramConstraint 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

No Singletons

More interesting to prohibit singletons (Single home surrounded by Aways or vice-versa)

Easy to add such constraints:home[i,t]<=

home[i,t-1]+home[i,t+1];

Test 5: No Singletons: Results

IP is now much better:

N K Integer Program

Constraint Program

N T F T

8 3 1516 22.73 --- ---

8 4 77 0.92 --- ---

10 3 --- --- --- ---

10 4 15268 594.70 --- ---

Other approaches

Note problem size, however: even small problems are getting hard to solve

Alternative is to have multiple phase approach

Phase 1: Find HAPs

Find Home/Away pattern, one sequence per team

1: HAHAH2: AHAHA3: HHAAH4: HAHHA5: AAHHA6: AHAAH

 

Open Problem:Characterize feasible H/A patterns

Phase 2. Assign Games

Assign games consistent with HAP (+ denotes home; - is away)

1: +2 -3 +6 -4 +52: -1 +4 -5 +6 -33: +6 +1 -4 -5 +24: +5 -2 +3 +1 -65: -4 -6 +2 +3 -16: -3 +5 -1 -2 +4

 

Phase 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

 

Solving 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

Final Problem

Combine issues of venue with travel distance

Traveling Tournament Challenge Problem

Traveling 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 t+1.)

Sample 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

Sample Solution

Distance: 23916 (Easton May 7, 1999)

Slot ATL NYM PHI MON FLA PIT

0 FLA @PIT @MON PHI @ATL NYM 1 NYM @ATL FLA @PIT @PHI MON 2 PIT @FLA MON @PHI NYM @ATL 3 @PHI MON ATL @NYM PIT @FLA 4 @MON FLA @PIT ATL @NYM PHI 5 @PIT @PHI NYM FLA @MON ATL 6 PHI @MON @ATL NYM @PIT FLA 7 MON PIT @FLA @ATL PHI @NYM 8 @NYM ATL PIT @FLA MON @PHI 9 @FLA PHI @NYM PIT ATL @MON

Simple 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)

Successful Approaches: Feasible Solutions

Anagnostopolous, Michel, Van Hentenryck, and Vergados use simulated annealing

Hard part is determining neighborhood structure

Neighborhood

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)

Successful Approaches: Lower Bound

Not much better than sum of minimum travel for each team (solvable by series of small IPs or CPs)

Successful 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 2n=10

Practical 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!)

What is size of minimum premature set?

Improve on the carryover values

Fully test Strong IP formulation

Devise constraints/cuts that go beyond the one-factor and all-different individual constraints

Characterize feasible break patterns for min-break schedules

Open Problem: Is the Minimum Break problem NP-complete?

Open Problem:Characterize feasible H/A patterns

Open Problem: Find optimal solutions to the Traveling Tournament Problem for 2n=10

Solve Real Scheduling Problems!

Further 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

top related