Case study 7: Langfords problem Model due to Barbara Smith.

Slides:



Advertisements
Similar presentations
Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
Advertisements

Case study 5: all interval series Results due to Simonis, Puget & Regin.
Case study 3: orthogonal Latin squares Modelled by Barbara Smith.
Non-Binary Constraint Satisfaction Toby Walsh Cork Constraint Computation Center.
Non-binary Constraints Toby Walsh
Lesson 1: Vector Components How to add Vectors In this lesson you will learn: 1. How to resolve (break down) vectors in x and y components. 2. How to Reconstruct.
Global Constraints Toby Walsh National ICT Australia and University of New South Wales
Global Constraints Toby Walsh National ICT Australia and University of New South Wales
Summary of complementary slackness: 1. If x i ≠ 0, i= 1, 2, …, n the ith dual equation is tight. 2. If equation i of the primal is not tight, y i =0. 1.
Solving Linear Programming Models. Topics Computer Solution Sensitivity Analysis.
Case study 5: balanced academic curriculum problem Joint work with Brahim Hnich and Zeynep Kiziltan (CPAIOR 2002)
Non-binary constraints: modelling Toby Walsh Cork Constraint Computation Center.
Transforming and Refining Abstract Constraint Specifications Alan Frisch, Brahim Hnich*, Ian Miguel, Barbara Smith, and Toby Walsh *Cork Constraint Computation.
Constraint Programming: modelling Toby Walsh NICTA and UNSW.
Maths of Constraint Satisfaction, Oxford, March 2006 Constraint Programming Models for Graceful Graphs Barbara Smith.
ISM 206 Lecture 4 Duality and Sensitivity Analysis.
Decision Making. Introduction n Basic concepts of Acts, Events and Outcomes and Payoffs n Criteria for Decision Making n Backward Induction n Value of.
CGRASS A System for Transforming Constraint Satisfaction Problems Alan Frisch, Ian Miguel AI Group University of York Toby Walsh 4C.
LINEAR PROGRAMMING. Introduction n Introduction: n objective n Constraints n Feasible Set n Solution.
1 Linear Programming With Sensitivity Analysis Here we look at some graphs to learn some ideas.
ISM 206 Lecture 4 Duality and Sensitivity Analysis.
Modeling the Covering Test Problem Brahim Hnich, Steven Prestwich, and Evgeny Selensky Cork Constraint Computation Center UCC Supported by SFI.
CGRASS A System for Transforming Constraint Satisfaction Problems Alan Frisch, Ian Miguel (York) Toby Walsh (Cork)
3.5 Solving systems of equations in 3 variables
Dual Evolution for Geometric Reconstruction Huaiping Yang (FSP Project S09202) Johannes Kepler University of Linz 1 st FSP-Meeting in Graz, Nov ,
Solving Systems of Equations
Decision Making via Linear Programming: A simple introduction Fred Phillips
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
“Time-reversal-odd” distribution functions in chiral models with vector mesons Alessandro Drago University of Ferrara.
A simple assessed exercise Ciaran McCreesh & Patrick Prosser + 21.
Modelling for Constraint Programming Barbara Smith CP 2010 Doctoral Programme.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Chapter 24 – Multicriteria Capital Budgeting and Linear Programming u Linear programming is a mathematical procedure, usually carried out by computer software,
CP Summer School Modelling for Constraint Programming Barbara Smith 4. Combining Viewpoints, Modelling Advice.
V. Cacchiani, ATMOS 2007, Seville1 Solving a Real-World Train Unit Assignment Problem V. Cacchiani, A. Caprara, P. Toth University of Bologna (Italy) European.
The Scientific Method. The Basic Steps l State the problem l Form a hypothesis l Test the hypothesis l Draw conclusions.
Introduction to Physical Science--Vocabulary. Experiment.
Multiplication Strategies Breaking large numbers into smaller numbers before multiplying.
Scientific Method Notes Science. Vocabulary Scientific method – A systematic approach to problem solving. Hypothesis – a proposed solution to a scientific.
CP Summer School Modelling for Constraint Programming Barbara Smith 3. Symmetry, Viewpoints.
Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey.
Systems of Equations: Substitution
Properties as Processes : FORTE slide Properties as Processes: their Specification and Verification Joel Kelso and George Milne School of Computer.
LINEAR AND INTEGER PROGRAMMING The Simplex Method: A tutorial in three acts.
Y=3x+1 y 5x + 2 =13 Solution: (, ) Solve: Do you have an equation already solved for y or x?
Warm-Up 1) Determine whether (-1,7) is a solution of the system. 4 minutes 3x – y = -10 2) Solve for x where 5x + 3(2x – 1) = 5. -x + y = 8.
Solve Equations With Variables on Both Sides. Steps to Solve Equations with Variables on Both Sides  1) Do distributive property  2) Combine like terms.
10.3 Reformulation The Lex-Leader Method Shant Karakashian 1.
Continue the sequence 1. ½, 1, 2, 4, 8, __, __, __ 2. __, 5, 9, 13, __, __, , 55, __, 15, __, __ 4. 8, 27, 103, __ 5 Minutes Remain.
Parametric Quadratic Optimization Oleksandr Romanko Joint work with Alireza Ghaffari Hadigheh and Tamás Terlaky McMaster University January 19, 2004.
Problem Solving.  Similar to Solving Math Word Problem  Read the Problem  Decide how to go about Solving the Problem  Solve the Problem  Test the.
6.5 Solving Exponential Equations SOLVE EXPONENTIAL EQUATIONS WITH THE SAME BASE. SOLVE EXPONENTIAL EQUATIONS WITH UNLIKE BASES.
Notes Over 1.6 Solving an Inequality with a Variable on One Side Solve the inequality. Then graph your solution. l l l
Solving Equations with Variables on Both Sides. Review O Suppose you want to solve -4m m = -3 What would you do as your first step? Explain.
Elimination Method - Systems. Elimination Method  With the elimination method, you create like terms that add to zero.
Steps to Solving Word Problems Step 1: Read the problem, and identify the information it gives. Step 2: Identify what the question is asking, then draw.
Intro: We already know the standard form of a quadratic equation is:
2 Understanding Variables and Solving Equations.
6-2 Solving Systems Using Substitution
Solving Linear Systems by Linear Combinations
6-3 Solving Systems Using Elimination
3.5 Solving systems of equations in 3 variables
Introduction to Algorithms
Do Now 1) t + 3 = – 2 2) 18 – 4v = 42.
Sensitivity.
Equations with Variables on Both Sides
INFM 718A / LBSC 705 Information For Decision Making
Warm Up Solve. 1. 2x + 9x – 3x + 8 = –4 = 6x + 22 – 4x 3. + = 5
Solving Linear Equations and Inequalities
4 minutes Warm-Up 1) Determine whether (-1,7) is a solution of the system. 3x – y = -10 -x + y = 8 2) Solve for x where 5x + 3(2x – 1) = 5.
Presentation transcript:

Case study 7: Langfords problem Model due to Barbara Smith

Outline Introduction Introduction Langfords problem Langfords problem Modelling it as a CSP Modelling it as a CSP Basic model Basic model Refined model Refined model Experimental Results Experimental Results Conclusions Conclusions

Recipe Create a basic model Create a basic model Decide on the variables Introduce auxiliary variables Introduce auxiliary variables For messy/loose constraints Consider dual, combined or 0/1 models Consider dual, combined or 0/1 models Break symmetry Break symmetry Add implied constraints Add implied constraints Customize solver Customize solver Variable, value ordering

Langfords problem Find a sequence of 8 numbers Find a sequence of 8 numbers Each number [1,4] occurs twice Each number [1,4] occurs twice Two occurrences of i are i numbers apart Two occurrences of i are i numbers apart Unique solution Unique solution

Langfords problem L(k,n) problem L(k,n) problem To find a sequence of k*n numbers [1,n] To find a sequence of k*n numbers [1,n] Each of the k successive occrrences of i are i apart Each of the k successive occrrences of i are i apart We just saw L(2,4) We just saw L(2,4) Due to the mathematician Dudley Langford Due to the mathematician Dudley Langford Watched his son build a tower which solved L(2,3) Watched his son build a tower which solved L(2,3)

Langfords problem L(2,3) and L(2,4) have unique solutions L(2,3) and L(2,4) have unique solutions L(2,4n) and L(2,4n-1) have solutions L(2,4n) and L(2,4n-1) have solutions L(2,4n-2) and L(2,4n-3) do not L(2,4n-2) and L(2,4n-3) do not Computing all solutions of L(2,19) took 2.5 years! Computing all solutions of L(2,19) took 2.5 years! L(3,n) L(3,n) No solutions: 0<n<8, 10<n<17, 20,.. No solutions: 0<n<8, 10<n<17, 20,.. Solutions: 9,10,17,18,19,.. Solutions: 9,10,17,18,19,.. A Sequence: 0,0,1,1,0,0,26,150,0,0,17792,108144,0,0, , , 0,0, ,

Basic model What are the variables? What are the variables?

Basic model What are the variables? What are the variables? Variable for each occurrence of a number X11 is 1st occurrence of 1 X21 is 1st occurrence of 2.. X12 is 2nd occurrence of 1 X22 is 2nd occurrence of 2.. Value is position in the sequence Value is position in the sequence

Basic model What are the constraints? What are the constraints? Xij in [1,n*k] Xij in [1,n*k] Xij+1 = i+Xij Xij+1 = i+Xij Alldifferent([X11,..Xn1,X12,..Xn2,..,X1k,..Xnk]) Alldifferent([X11,..Xn1,X12,..Xn2,..,X1k,..Xnk])

Recipe Create a basic model Create a basic model Decide on the variables Introduce auxiliary variables Introduce auxiliary variables For messy/loose constraints Consider dual, combined or 0/1 models Consider dual, combined or 0/1 models Break symmetry Break symmetry Add implied constraints Add implied constraints Customize solver Customize solver Variable, value ordering

Break symmetry Does the problem have any symmetry? Does the problem have any symmetry?

Break symmetry Does the problem have any symmetry? Does the problem have any symmetry? Of course, we can invert any sequence! Of course, we can invert any sequence!

Break symmetry How do we break this symmetry? How do we break this symmetry?

Break symmetry How do we break this symmetry? How do we break this symmetry? Many possible ways Many possible ways For example, for L(3,9) For example, for L(3,9) Either X92 < 14 (2nd occurrence of 9 is in 1st half)Either X92 < 14 (2nd occurrence of 9 is in 1st half) Or X92=14 and X82<14 (2nd occurrence of 8 is in 1st half)Or X92=14 and X82<14 (2nd occurrence of 8 is in 1st half)

Recipe Create a basic model Create a basic model Decide on the variables Introduce auxiliary variables Introduce auxiliary variables For messy/loose constraints Consider dual, combined or 0/1 models Consider dual, combined or 0/1 models Break symmetry Break symmetry Add implied constraints Add implied constraints Customize solver Customize solver Variable, value ordering

What about dual model? Can we take a dual view? Can we take a dual view?

What about dual model? Can we take a dual view? Can we take a dual view? Of course we can, its a permutation! Of course we can, its a permutation!

Dual model What are the variables? What are the variables? Variable for each position i Variable for each position i What are the values? What are the values?

Dual model What are the variables? What are the variables? Variable for each position i Variable for each position i What are the values? What are the values? If use the number at that position, we cannot use an all-different constraint If use the number at that position, we cannot use an all-different constraint Each number occurs not once but k times Each number occurs not once but k times

Dual model What are the variables? What are the variables? Variable for each position i Variable for each position i What are the values? What are the values? Solution 1: use values from [1,n*k] with the value i*n+j standing for the ith occurrence of j Solution 1: use values from [1,n*k] with the value i*n+j standing for the ith occurrence of j Now want to find a permutation of these numbers subject to the distance constraint Now want to find a permutation of these numbers subject to the distance constraint

Dual model What are the variables? What are the variables? Variable for each position i Variable for each position i What are the values? What are the values? Solution 2: use as values the numbers [1,n] Solution 2: use as values the numbers [1,n] Each number occurs exactly k times Each number occurs exactly k times Fortunately, there is a generalization of all-different called the global cardinality constraint (gcc) for this Fortunately, there is a generalization of all-different called the global cardinality constraint (gcc) for this

Global cardinality constraint Gcc([X1,..Xn],l,u) enforces values used by Xi to occur between l and u times Gcc([X1,..Xn],l,u) enforces values used by Xi to occur between l and u times All-different([X1,..Xn]) = Gcc([X1,..Xn],1,1) All-different([X1,..Xn]) = Gcc([X1,..Xn],1,1) Regins algorithm enforces GAC on Gcc in O(n^2.d) Regins algorithm enforces GAC on Gcc in O(n^2.d) Regins papers are tough to follow but this seems to beat his algorithm for all-different!? Regins papers are tough to follow but this seems to beat his algorithm for all-different!?

Dual model What are the constraints? What are the constraints? Gcc([D1,…Dk*n],k,k) Gcc([D1,…Dk*n],k,k) Distance constraints? Distance constraints?

Dual model What are the constraints? What are the constraints? Gcc([D1,…Dk*n],k,k) Gcc([D1,…Dk*n],k,k) Distance constraints: Distance constraints: Di=j then Di+j+1=jDi=j then Di+j+1=j

Combined model Primal and dual variables Primal and dual variables Channelling to link them Channelling to link them What do the channelling constraints look like? What do the channelling constraints look like?

Combined model Primal and dual variables Primal and dual variables Channelling to link them Channelling to link them Xij=k implies Dk=i Xij=k implies Dk=i

Solving choices? Which variables to assign? Which variables to assign? Xij or Di Xij or Di

Solving choices? Which variables to assign? Which variables to assign? Xij or Di, doesnt seem to matter Xij or Di, doesnt seem to matter Which variable ordering heuristic? Which variable ordering heuristic? Fail First or Lex? Fail First or Lex?

Solving choices? Which variables to assign? Which variables to assign? Xij or Di, doesnt seem to matter Xij or Di, doesnt seem to matter Which variable ordering heuristic? Which variable ordering heuristic? Fail First very marginally better than Lex Fail First very marginally better than Lex How to deal with the permutation constraint? How to deal with the permutation constraint? GAC on the all-different GAC on the all-different AC on the channelling AC on the channelling AC on the decomposition AC on the decomposition

Solving choices? Which variables to assign? Which variables to assign? Xij or Di, doesnt seem to matter Xij or Di, doesnt seem to matter Which variable ordering heuristic? Which variable ordering heuristic? Fail First very marginally better than Lex Fail First very marginally better than Lex How to deal with the permutation constraint? How to deal with the permutation constraint? AC on the channelling is often best for time AC on the channelling is often best for time

Conclusions Modelling is an art but there are patterns Modelling is an art but there are patterns Develop basic model Develop basic model Decide on the variables and their valuesDecide on the variables and their values Use auxiliary variables to represent constraints compactly/efficiently Use auxiliary variables to represent constraints compactly/efficiently Consider dual, combined and 0/1 models Consider dual, combined and 0/1 models Break symmetry Break symmetry Add implied constraints Add implied constraints Customize solver for your model Customize solver for your model

Case study 8: social golfers problem Model again due to Barbara Smith

Outline Introduction Introduction Social golfers problem Social golfers problem Modelling it as a CSP Modelling it as a CSP Basic model Basic model Refined model Refined model Experimental Results Experimental Results Conclusions Conclusions

Social golfers problem golfers wish to play in 8 groups of 4 each week 32 golfers wish to play in 8 groups of 4 each week No two play in the same group more than once No two play in the same group more than once How many weeks can they play? How many weeks can they play?

Social golfers problem golfers wish to play in 8 groups of 4 each week 32 golfers wish to play in 8 groups of 4 each week No two play in the same group more than once No two play in the same group more than once How many weeks can they play? How many weeks can they play? 9 weeks and this is optimal 9 weeks and this is optimal

Social golfers problem Of course, generalize problem to g groups of s players over w weeks Of course, generalize problem to g groups of s players over w weeks Kirkmans schoolgirls problem [Ladys & Gentlemans Diary 1850] Kirkmans schoolgirls problem [Ladys & Gentlemans Diary 1850] … a schoolmistress was in the habit of taking her girls for a daily walk. The girls were 15 in number, and were arranged in 5 rows of 3 each, so that each girl might have 2 companions. The problem is to so dispose them so that for 7 consecutive days no girl will walk with any of her school-fellows in a triplet twice … This is equivalent to social golfers problem of 5 groups of 3 players over 7 weeks

Recipe Create a basic model Create a basic model Decide on the variables Introduce auxiliary variables Introduce auxiliary variables For messy/loose constraints Consider dual, combined or 0/1 models Consider dual, combined or 0/1 models Break symmetry Break symmetry Add implied constraints Add implied constraints Customize solver Customize solver Variable, value ordering

Basic model What are the variables? What are the variables?

Basic model What are the variables? What are the variables? Group_ij is the set of s golfers assigned to group i in period j Group_ij is the set of s golfers assigned to group i in period j But I havent shown you set variables before! But I havent shown you set variables before!

Set variables CSP variables can range over (finite) domains like integers CSP variables can range over (finite) domains like integers X1 is 1, 2, 3 or 4 X1 is 1, 2, 3 or 4 Or over sets of (finite) domains Or over sets of (finite) domains Y1 is {}, {1}, {2}, or {1,2} Y1 is {}, {1}, {2}, or {1,2}

Set variables CSP variables can range over (finite) domains like integers CSP variables can range over (finite) domains like integers X1 is 1, 2, 3 or 4 X1 is 1, 2, 3 or 4 Or over sets of (finite) domains Or over sets of (finite) domains Y1 is {}, {1}, {2}, or {1,2} Y1 is {}, {1}, {2}, or {1,2} Usually set operations can be posted as constraints on these set variables Usually set operations can be posted as constraints on these set variables Y1 subset Z1, Y1 intersect Z1 = {}, 1 in Y1, … Y1 subset Z1, Y1 intersect Z1 = {}, 1 in Y1, …

Set variables Set variables are potentially expensive to reason about Set variables are potentially expensive to reason about If X1 is a subset of Y1, then X1 has exponentially many possible values If X1 is a subset of Y1, then X1 has exponentially many possible values Compromise Compromise CSP solvers just maintain upper and lower bounds on set variable CSP solvers just maintain upper and lower bounds on set variable {} subseteq X1 subseteq {1,2} {} subseteq X1 subseteq {1,2}

Set variables Set variables are potentially expensive to reason about Set variables are potentially expensive to reason about If X1 is a subset of Y1, then X1 has exponentially many possible values If X1 is a subset of Y1, then X1 has exponentially many possible values Compromise Compromise CSP solvers just maintain upper and lower bounds on set variable CSP solvers just maintain upper and lower bounds on set variable {} subseteq X1 subseteq {1,2} {} subseteq X1 subseteq {1,2} We loose the ability to represent disjunction We loose the ability to represent disjunction E.g. X1= {1} or X1={2} but X1=/ {1,2}

Basic model What are the variables? What are the variables? Group_ij is the set of s golfers assigned to group i in period j Group_ij is the set of s golfers assigned to group i in period j What are constraints? What are constraints?

Basic model What are the variables? What are the variables? Group_ij is the set of s golfers assigned to group i in period j Group_ij is the set of s golfers assigned to group i in period j What are constraints? What are constraints? Size of group, |Group_ij|=s Size of group, |Group_ij|=s Groups do not overlap, Group_ij intersect Group_ij={} Groups do not overlap, Group_ij intersect Group_ij={} Never meet twice, Never meet twice, for j<l. | Group_ij intersect Group_kl | <= 1

Break symmetry What symmetry does the problem have? What symmetry does the problem have?

Break symmetry What symmetry does the problem have? What symmetry does the problem have? Lots! Lots! Players are symmetrical Players are symmetrical Groups are symmetrical Groups are symmetrical Weeks are symmetrical Weeks are symmetrical

Break symmetry What symmetry does the problem have? What symmetry does the problem have? Lots! Lots! Players are symmetrical Players are symmetrical Groups are symmetrical Groups are symmetrical Weeks are symmetrical Weeks are symmetrical Set variables saved us worrying about order within group Set variables saved us worrying about order within group

Break symmetry We can assign some values and break some of this symmetry We can assign some values and break some of this symmetry

Break symmetry We can assign some values and break some of this symmetry We can assign some values and break some of this symmetry Make first week: {1,2,..s}, {s+1,s+2,..2s},… Make first week: {1,2,..s}, {s+1,s+2,..2s},…

Break symmetry We can assign some values and break some of this symmetry We can assign some values and break some of this symmetry Make first week: {1,2,..s}, {s+1,s+2,..2s},… Make first week: {1,2,..s}, {s+1,s+2,..2s},… In second week: player j is in jth group In second week: player j is in jth group

Break symmetry Symmetry is still left Symmetry is still left Weeks 2 and onwards remain symmetric Weeks 2 and onwards remain symmetric Hard to post constraints to break this Hard to post constraints to break this E.g. smallest player in week k who plays in the same group as player n is smaller than smallest player in week k+1 who plays in the same group as player nE.g. smallest player in week k who plays in the same group as player n is smaller than smallest player in week k+1 who plays in the same group as player n

Recipe Create a basic model Create a basic model Decide on the variables Introduce auxiliary variables Introduce auxiliary variables For messy/loose constraints Consider dual, combined or 0/1 models Consider dual, combined or 0/1 models Break symmetry Break symmetry Add implied constraints Add implied constraints Customize solver Customize solver Variable, value ordering

Alternative model Focus on pairs of players that play together Focus on pairs of players that play together Less intrinsic symmetry Less intrinsic symmetry

Alternative model What are the variables? What are the variables?

Alternative model What are the variables? What are the variables? Number the pairs Number the pairs is 0 is 0 is 1 is 1.. is n-2 is n-2 is n-1 is n-1..

Alternative model What are the variables? What are the variables? Number the pairs Number the pairs Variable Week_k is the week that pair number k meet Variable Week_k is the week that pair number k meet

Alternative model What are the variables? What are the variables? Number the pairs Number the pairs Variable Week_k is the week that pair number k meet Variable Week_k is the week that pair number k meet If they never meet, it is 0If they never meet, it is 0

Symmetry in alternative model Less symmetry Less symmetry Again, no symmetry in order of players within group Again, no symmetry in order of players within group Now, no symmetry between groups in week Now, no symmetry between groups in week Indeed, groups are not explicitly named! Indeed, groups are not explicitly named!

Constraints in alternative model No pair meets twice No pair meets twice Implicit in assigning single value to Week_k Implicit in assigning single value to Week_k Groups are closed Groups are closed If i and j play together in week t, and j and k play together in week t then i and k play together If i and j play together in week t, and j and k play together in week t then i and k play together Lots of messy constraints Lots of messy constraints

Recipe Create a basic model Create a basic model Decide on the variables Introduce auxiliary variables Introduce auxiliary variables For messy/loose constraints Consider dual, combined or 0/1 models Consider dual, combined or 0/1 models Break symmetry Break symmetry Add implied constraints Add implied constraints Customize solver Customize solver Variable, value ordering

Introduce auxiliary variables Players_ik = set of players playing with i in week k Players_ik = set of players playing with i in week k

Introduce auxiliary variables Players_ik = set of players playing with i in week k Players_ik = set of players playing with i in week k i belongs to Players_ik i belongs to Players_ik NB still havent named groups NB still havent named groups

Introduce auxiliary variables Players_ik = set of players playing with i in week k Players_ik = set of players playing with i in week k i belongs to Players_k i belongs to Players_k Combine with initial model Combine with initial model

Combined model Express constraints in model where they are easiest! Express constraints in model where they are easiest! Channelling constraints to link models Channelling constraints to link models Week_k=t with k= implies Players_it=Players_jt Week_k=t with k= implies Players_it=Players_jt Week_k/=t with k= implies Players_it intersect Players_jt = {} Week_k/=t with k= implies Players_it intersect Players_jt = {}

Combined model Express constraints in model where they are easiest! Express constraints in model where they are easiest! Channelling constraints to link models Channelling constraints to link models Week_k=t with k= implies Players_it=Players_jt Week_k=t with k= implies Players_it=Players_jt Week_k/=t with k= implies Players_it intersect Players_jt = {} Week_k/=t with k= implies Players_it intersect Players_jt = {} NB build in knowledge about transitivity NB build in knowledge about transitivity

Recipe Create a basic model Create a basic model Decide on the variables Introduce auxiliary variables Introduce auxiliary variables For messy/loose constraints Consider dual, combined or 0/1 models Consider dual, combined or 0/1 models Break symmetry Break symmetry Add implied constraints Add implied constraints Customize solver Customize solver Variable, value ordering

Implied constraints Take a group from any week, {g1,..gs} Take a group from any week, {g1,..gs} In any other week, these players must be spread over exactly s groups In any other week, these players must be spread over exactly s groups Adds significant overhead but can be useful on certain problems Adds significant overhead but can be useful on certain problems

Week symmetry Excuse the pun (week/weak) Excuse the pun (week/weak) We devised a model without groups We devised a model without groups Eliminating group symmetry Eliminating group symmetry We still have lots of week symmetry We still have lots of week symmetry Can we model without weeks? Can we model without weeks?

Week symmetry Excuse the pun (week/weak) Excuse the pun (week/weak) We devised a model without groups We devised a model without groups Eliminating group symmetry Eliminating group symmetry We still have lots of week symmetry We still have lots of week symmetry Can we model without weeks? Can we model without weeks? Surprisingly, yes Surprisingly, yes Model is convoluted but gives good results Model is convoluted but gives good results First model to solve Kirkmans schoolgirls problel First model to solve Kirkmans schoolgirls problel

3rd Model What are the variables? What are the variables? AllPairs_k is the set of all pairs playing with pair k (k= ) AllPairs_k is the set of all pairs playing with pair k (k= )

3rd Model What are the variables? What are the variables? AllPairs_k is the set of all pairs playing with pair k (k= ) AllPairs_k is the set of all pairs playing with pair k (k= ) k belongs to AllPairs_kk belongs to AllPairs_k

3rd Model What are the variables? What are the variables? AllPairs_k is the set of all pairs playing with pair k (k= ) AllPairs_k is the set of all pairs playing with pair k (k= ) SameWeek_k is the set of all pairs playing in the same week as k SameWeek_k is the set of all pairs playing in the same week as k

3rd Model What are the variables? What are the variables? AllPairs_k is the set of all pairs playing with pair k (k= ) AllPairs_k is the set of all pairs playing with pair k (k= ) SameWeek_k is the set of all pairs playing in the same week as k SameWeek_k is the set of all pairs playing in the same week as k PlayersWithPair_k is the set of individual players playing with k PlayersWithPair_k is the set of individual players playing with k

3rd Model What are the variables? What are the variables? AllPairs_k is the set of all pairs playing with pair k (k= ) AllPairs_k is the set of all pairs playing with pair k (k= ) SameWeek_k is the set of all pairs playing in the same week as k SameWeek_k is the set of all pairs playing in the same week as k PlayersWithPair_k is the set of individual players playing with k PlayersWithPair_k is the set of individual players playing with k If k= then i and j belong to PlayersWithPair_kIf k= then i and j belong to PlayersWithPair_k

3rd Model What are the variables? What are the variables? AllPairs_k is the set of all pairs playing with pair k (k= ) AllPairs_k is the set of all pairs playing with pair k (k= ) PairsSameWeek_k is the set of all pairs playing in the same week as k PairsSameWeek_k is the set of all pairs playing in the same week as k PlayersWithPair_k is the set of individual players playing with k PlayersWithPair_k is the set of individual players playing with k PlaySameWeek_kk is 1 iff k and k play in same week and 0 otherwise PlaySameWeek_kk is 1 iff k and k play in same week and 0 otherwise

Channelling We can channel back to the 2nd model We can channel back to the 2nd model if Week_k=Week_k then if Week_k=Week_k then PairsSameWeek_k = PairsSameWeek_kPairsSameWeek_k = PairsSameWeek_k If Week_k/=Week_k then If Week_k/=Week_k then PairsSameWeek_k intersect PairsSameWeek_k = {}PairsSameWeek_k intersect PairsSameWeek_k = {}…

Symmetry remaining Players are still symmetrical Players are still symmetrical Can assign first week Can assign first week {1,2,..s},{s+1,..,2s},… {1,2,..s},{s+1,..,2s},…

Conclusions Constraints can improve your golf! Constraints can improve your golf! Set variables are useful for modelling Set variables are useful for modelling Eliminate symmetry Eliminate symmetry Alternatively, we can channel into a model with less symmetry Alternatively, we can channel into a model with less symmetry Even if it is cumbersome, it can help Even if it is cumbersome, it can help More about set variables and global (non- binary) constraints on set variables next week More about set variables and global (non- binary) constraints on set variables next week