Presentation is loading. Please wait.

Presentation is loading. Please wait.

© J. Christopher Beck 20051 Lecture 21: IP and CP Models for Sports Scheduling.

Similar presentations


Presentation on theme: "© J. Christopher Beck 20051 Lecture 21: IP and CP Models for Sports Scheduling."— Presentation transcript:

1 © J. Christopher Beck 20051 Lecture 21: IP and CP Models for Sports Scheduling

2 © J. Christopher Beck 2005 2 Outline Single Round Robin IP Model 3-Step Algorithm Again IP Models for the 3-Step Algorithm CP Models for the 3-Step Algorithm

3 © J. Christopher Beck 2005 3 Single Round Robin Tournament Assume n teams and that n is even Every team plays every other team It is possible to construct a schedule with n-1 slots each with n/2 games

4 © J. Christopher Beck 2005 4 IP for Simple Single RR Each team plays one game in each slot Each team plays each other team exactly once Pure IP model x ijt = 1 iff team i plays at home against team j in slot t

5 © J. Christopher Beck 2005 5 Recall the (More Complex) Problem Double RR tournament Minimize “breaks” Two consecutive Home or Away games A variety of other constraints and preferences “rival” pairings 2 Home or 1 Home, 1 Bye in first 5 weeks

6 © J. Christopher Beck 2005 6 3-Step Approach Step 1: HAPs Find at least n HAPs HAP – string of H, A, B Find a set of n consistent HAPs Step 2: Assign games to HAPs Step 3: Assign teams to HAPs

7 © J. Christopher Beck 2005 7 ACC Scheduling Solution Find feasible patterns Find pattern sets Assign games Assign teams to patterns Choose final schedule 38 patterns of length 18 17 pattern sets 826 timetables17 schedules Step 1 Step 2Step 3 Figure 10.3

8 © J. Christopher Beck 2005 8 Step 1: HAPs Create a consistent set of HAPs What’s wrong with these HAPs? slot12345 Team aHAHAA Team bHBAHA Team cAABHH Team dAAHAH Team eBHABA Teams: UofT, Western, Queens, McGill, Waterloo

9 © J. Christopher Beck 2005 9 Step 1: HAPs List preferred HAPs (and a few others) E.g., All HAPs with 1 or 0 breaks Can you pick a consistent set of 5 HAPs? HAHAB HAHBA HABAH HBHAH BAHAH AHAHB AHABH AHBHA ABAHA BHAHA

10 © J. Christopher Beck 2005 10 Step 2: Assign Games You’ve got a set of consistent HAPs Match the Hs with the As slot12345 Team aHAHAB Team bHBAHA Team cAABHH Team dBHHAA Team eAHABH Teams: UofT, Western, Queens, McGill, Waterloo

11 © J. Christopher Beck 2005 11 Step 2: Assign Games You’ve got a set of consistent HAPs Match the Hs with the As slot12345 Team aHAHAB Team bHBAHA Team cAABHH Team dBHHAA Team eAHABH Teams: UofT, Western, Queens, McGill, Waterloo

12 © J. Christopher Beck 2005 12 Step 2: IP Model S is a set of n consistent HAPs T is the set of slots/rounds x ijt = 1 iff the team with pattern i plays in round t at the site of the team associated with pattern j Only defined if the i th pattern has a A is slot t and the j th pattern has an H F is the set of such triples (i, j, t)

13 © J. Christopher Beck 2005 13 Step 2: IP Model One game between team with pattern i and team with pattern j Team with pattern i plays at most one game is slot t

14 © J. Christopher Beck 2005 14 Step 3: Assign Teams to HAPs Map teams to patterns to maximize preferences slot12345 Team aHAHAB Team bHBAHA Team cAABHH Team dBHHAA Team eAHABH UofT Western Queens McGill Waterloo

15 © J. Christopher Beck 2005 15 Step 3: IP Model y ik = 1 iff team i is assigned to HAP k c ik = cost of team assignment y ik minimize One team assigned to each pattern One pattern assigned to each team

16 © J. Christopher Beck 2005 16 Constraint Programming Models Double RR with odd n Break is now 3 consecutive Hs or As No breaks are allowed H or B in at least 2 of first 4 rounds No team can be away in both of the final 2 games

17 © J. Christopher Beck 2005 17 Step 1: CP Model 1 h t, a t, b t – 0,1 variables denoting home, away, bye for a given team in slot t No breaks No team away for both of final 2 games H or B in at least 2 of first 4 slots

18 © J. Christopher Beck 2005 18 A Different CP Model: The Distribute Constraint distribute(card, value, base) card – array of variables value – array of values base – array of variables value[i] is taken by card[i] elements of base distribute([{0,1}, {1,3}], [0, 1], [w 1, …, w n ]) cardvaluebase

19 © J. Christopher Beck 2005 19 Step 1: CP Model 2 g t є {H,A,B} – variable denoting home, away, bye for a given team in slot t No breaks No team away for both of final 2 games H or B in at least 2 of first 4 slots distribute([{0,1,2}, {0,1,2}], [H, A], [g t, g t+1, g t+2 ]) t = 1, …, 2n-2 (g 2n ≠ A) OR (g 2n-1 ≠ A) distribute([{0,1,2}], [A], [g 1, g 2, g 3, g 4 ])

20 © J. Christopher Beck 2005 20 Step 1: CP Model 2 Some additional constraints 2 Bs, Equal # As & Hs distribute([{n-1}, {n-1}, {2}], [H, A, B], [g 1, …, g 2n ]) 1 Bs, Equal # As & Hs distribute([{(n-1)/2}, {(n-1)/2}, {1}], [H, A, B], [t 1, …, t n ]) Let t 1, … t n, be the HAP for one slot (across all teams)

21 © J. Christopher Beck 2005 21 Step 1: CP Model With either of these models, you can then easily generate all possible HAPs You could also add a cost function to generate only “good” HAPs

22 © J. Christopher Beck 2005 22 Step 2: Assign Games Given a set of consistent HAPs Devise a CP model to assign games The one in the book is overly complicated! slot12345678910 Team aHAHABHAHAB Team bHBAHAHBAHA Team cAABHHAABHH Team dBHHAABHHAA Team eAHABHAHABH


Download ppt "© J. Christopher Beck 20051 Lecture 21: IP and CP Models for Sports Scheduling."

Similar presentations


Ads by Google