Lecture 20: Sports Scheduling © J. Christopher Beck 2005 1 Outline ACC Basketball Scheduling HAPs Algorithm Flow Chart Single Round Robin Scheduling HAPs again Alg 10.2.2 Example 10.2.3 © J. Christopher Beck 2005 2 ACC Scheduling Atlantic Coast Conference Basketball 9 teams: Clem, Duke, FSU, GT, UMD, NC, NCSt, UVA, Wake Double Round Robin 2 slots/week: weekday & weekend Home and Away Total # of games to be played? What is the maximum # of games per slot? Beck And, 3 © J. Christopher 2005 therefore the # of slots? Constraints & Preferences No team should play more than two Home or two Away games consecutively A Bye is considered an Away game No team should play more than two consecutive weekends Away or at Home Each team must have at least 2 Home or 1 Home, 1 Bye in the first 5 weeks © J. Christopher Beck 2005 4 More Constraints & Preferences No team can Away for both slots in the final week Final weekend is usually reserved for “rival” pairings Duke-UNC, Clem-GT, NCSt-Wake, UMDUVA Duke-UNC must appear in slots 9 and 18 Even with only 9 teams this is a hard problem. Try to decompose the solving into sub-problems. © J. Christopher Beck 2005 5 Mirroring Since it is a double RR, we can halve the problem size by finding a single RR and “mirroring” the second half Perfect mirroring not always possible Team 1 3 -4 2 -3 4 -2 Team 2 -4 3 -1 4 -3 1 Team 3 -1 -2 4 1 2 -4 Team 4 2 1 -3 -2 -1 3 © J. Christopher Beck 2005 6 Home Away Patterns (HAPs) Each team has a pattern of Home & Away games: First (Step 1) find of a set of HAPs HAHAAHHAAH …, AAHHAHHA …, etc. Independent of the teams – just find strings of Hs, As, (and maybe Bs) Then (Step 2) match patterns to games and finally (Step 3) assign the teams © J. Christopher Beck 2005 7 Of Course it is More Complicated in the Real World 38 patterns of length 18 Find feasible patterns 17 pattern sets Find pattern sets Step 1 826 timetables 17 schedules Assign games Assign teams to patterns Step 2 Step 3 Choose final schedule Figure 10.3 © J. Christopher Beck 2005 8 Something a Bit Easier Complete the single RR timetable Don’t worry about Home/Away games slot 1 2 Team a b f 3 5 c Team b a f Team c d e Team d c e Team e f d c Team f e a b © J. Christopher Beck 2005 4 a Does this remind you of anything? 9 Home & Away Now take the full time table and add Home/Away games Minimize breaks Break: two consecutive Home or two consecutive Away games © J. Christopher Beck 2005 slot 1 2 3 Team a b f Team b a f Team c d e Team d c e Team e f d c Team f e a b 4 5 c a 10 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 © J. Christopher Beck 2005 11 IP for Simple Single RR Pure IP model xijt = 1 iff team i plays at home against team j in slot t n 1 n (x t 1 i 1 ijt x jit ) 1 j 1,..., n Each team plays each other team exactly once n 1 (x t 1 ijt x jit ) 1 i j Each team plays exactly once in each slot © J. Christopher Beck 2005 12 CP for Simple Single RR xit = team that team i plays in slot t xit є {1,…,n} all-different xit ≠ i slot 1 2 3 4 xit = j xjt = i Team a e all-different(xi) Team b 5 Team c Team d Team e © J. Christopher Beck 2005 Team f b 13 Simple RR Model Is Too Simple No optimization function No balancing of Away/Home games This motivates the introduction of HAPs and the definition of breaks Recall: a break is two consecutive games that are both Home or both Away © J. Christopher Beck 2005 14 What if n is Odd? One team gets a Bye in every slot HAPs get more complex String of Hs, As, & Bs Breaks need to be redefined Can’t achieve an n-1 slot schedule What is the minimum length schedule? © J. Christopher Beck 2005 15 Alg 10.2.2 Step 1: Find a collection of n HAPs Step 2: Assign a game to each entry in the pattern set Step 3: Assign teams to patterns Why do we need (at least) n HAPs? © J. Christopher Beck 2005 16 Alg 10.2.2 Step 1: Find a collection of n HAPs Step 2: Assign a game to each entry in the pattern set Step 3: Assign teams to patterns Create a 5 team single round robin Minimize breaks (at which step?) Now create a double RR schedule © J. Christopher Beck 2005 17