outline
play

Outline 1. (Meta-) Heuristics for Local Search Local Search - PowerPoint PPT Presentation

Topic 17: Constraint-Based Local Search 1 (Version of 26th November 2020) Pierre Flener Optimisation Group Department of Information Technology Uppsala University Sweden Course 1DL441: Combinatorial Optimisation and Constraint Programming,


  1. Example (BIBD: AED assignment after i + 1 moves) plot1 plot2 plot3 plot4 plot5 plot6 plot7 barley – – – – ✓ ✓ ✓ corn – – – – ✓ ✓ ✓ (Meta-) millet – – – – ✓ ✓ ✓ Heuristics for Local Search oats – – – – ✓ ✓ ✓ Local Search rye – – – – Heuristics ✓ ✓ ✓ Example 1: Graph Partitioning spelt – – – – ✓ ✓ ✓ Example 2: Travelling wheat – – ✓ – ✓ ✓ – Salesperson Meta-Heuristics 1 Equal growth load: Every plot grows 3 grains. Constraint- Based Local But plot5 grows 2 � = 3 grains; plot6 grows 4 � = 3 grains. Search Modelling 2 Equal sample size: Every grain is grown in 3 plots. Violation Functions Probing Functions Satisfied by initial assignment and each move: implicit. Comparison with CP by Systematic Search 3 Balance: Every grain pair is grown in 1 common plot. Example: But, e.g., corn & oats are grown in 2 � = 1 common plots. The Comet Toolchain Selected move: let plot5 instead of plot6 grow corn. Hybrid Methods Bibliography COCP/M4CO 17 - 8 -

  2. Example (BIBD: AED assignment after i + 2 moves) plot1 plot2 plot3 plot4 plot5 plot6 plot7 barley – – – – ✓ ✓ ✓ corn – – – – ✓ ✓ ✓ (Meta-) millet – – – – ✓ ✓ ✓ Heuristics for Local Search oats – – – – ✓ ✓ ✓ Local Search rye – – – – Heuristics ✓ ✓ ✓ Example 1: Graph Partitioning spelt – – – – ✓ ✓ ✓ Example 2: Travelling wheat – – – – ✓ ✓ ✓ Salesperson Meta-Heuristics 1 Equal growth load: Every plot grows 3 grains. Constraint- Based Local Currently satisfied: zero violation. Search Modelling 2 Equal sample size: Every grain is grown in 3 plots. Violation Functions Probing Functions Satisfied by initial assignment and each move: implicit. Comparison with CP by Systematic Search 3 Balance: Every grain pair is grown in 1 common plot. Example: Currently satisfied: zero violation. The Comet Toolchain Stop search: All constraints are satisfied (no optimisation). Hybrid Methods Bibliography COCP/M4CO 17 - 9 -

  3. Terminology and Choices Definitions (Meta-) Consider a problem � V , U , C [ , f ] � where V = [ v 1 , . . . , v m ] Heuristics for and f is to be minimised, without loss of generality. Local Search Local Search An assignment s : V → U maps the variables to values, and Heuristics Example 1: Graph is satisfying (or: feasible) if they satisfy all constraints in C . Partitioning Example 2: Travelling Salesperson Note how a store s : V → 2 U in Topics 13 to 16 differs. Meta-Heuristics Constraint- Property: A satisfying assignment actually is a solution to a Based Local Search constraint satisfaction problem (CSP), but it might be Modelling Violation Functions sub-optimal for a constrained optimisation problem (COP). Probing Functions Comparison with CP by Systematic Assume function C OST gives the cost of an assignment s : Search Example: CSP: C OST ( s ) = � c ∈ C V IOLATION ( c , s ) The Comet Toolchain COP: C OST ( s ) = α · � c ∈ C V IOLATION ( c , s ) + β · f ( s ( v 1 ) , . . . , s ( v m )) Hybrid for problem-specific V IOLATION and parameters α and β . Methods Bibliography COCP/M4CO 17 - 10 -

  4. Definition A soft constraint c has a function V IOLATION ( c , s ) that returns zero if c is satisfied under the assignment s , else a positive value proportional to its dissatisfaction. (Meta-) Heuristics for Local Search Example: V IOLATION ( x ≤ y , s ) = if s ( x ) ≤ s ( y ) then 0 else s ( x ) − s ( y ) Local Search Heuristics Definition Example 1: Graph Partitioning Example 2: A one-way constraint is kept satisfied during search, as one Travelling Salesperson Meta-Heuristics of its variables is defined by a total function on the others. Constraint- Based Local Example: For p = x · y , if x or y or both are reassigned by Search Modelling a move to assignment s , then s ( p ) is to be set to s ( x ) · s ( y ) . Violation Functions Probing Functions Comparison with CP by Systematic Definition Search Example: A violating variable in a constraint c unsatisfied, or violated, The Comet Toolchain under assignment s can be reassigned, not necessarily Hybrid within its domain, so that V IOLATION ( c , s ) decreases. Methods Bibliography COCP/M4CO 17 - 11 -

  5. Example ( x , y , z ∈ { 1 , 2 , 3 } ∧ x ≤ y ∧ y < z ) Non-satisfying assignment (the constraint x ≤ y is violated; the decision variables x and y are violating w.r.t. x ≤ y ): (Meta-) Heuristics for Local Search Local Search x <= y Heuristics x=1 Example 1: Graph Partitioning x=2 Example 2: x=3 Travelling Salesperson y=1 Meta-Heuristics y=2 Constraint- y=3 Based Local Search Modelling Violation Functions Probing Functions Comparison with CP y < z by Systematic Search z=1 Example: z=2 The Comet z=3 Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 12 -

  6. Example ( x , y , z ∈ { 1 , 2 , 3 } ∧ x ≤ y ∧ y < z ) Probed move x := 3, reaching another non-satisfying assignment (the constraint x ≤ y is still violated; the (Meta-) decision variables x and y are still violating w.r.t. x ≤ y ): Heuristics for Local Search Local Search x <= y Heuristics x=1 Example 1: Graph Partitioning x=2 Example 2: x=3 Travelling Salesperson y=1 Meta-Heuristics y=2 Constraint- y=3 Based Local Search Modelling Violation Functions Probing Functions Comparison with CP y < z by Systematic Search z=1 Example: The Comet z=2 Toolchain z=3 Hybrid Methods Bibliography COCP/M4CO 17 - 12 -

  7. Example ( x , y , z ∈ { 1 , 2 , 3 } ∧ x ≤ y ∧ y < z ) Another probed move x := 1, reaching a satisfying assignment (there are no more violated constraints or (Meta-) violating variables): Heuristics for Local Search Local Search x <= y Heuristics x=1 Example 1: Graph Partitioning x=2 Example 2: x=3 Travelling Salesperson y=1 Meta-Heuristics y=2 Constraint- y=3 Based Local Search Modelling Violation Functions Probing Functions Comparison with CP y < z by Systematic Search z=1 Example: The Comet z=2 Toolchain z=3 Hybrid Methods Bibliography COCP/M4CO 17 - 12 -

  8. Example ( x , y , z ∈ { 1 , 2 , 3 } ∧ x ≤ y ∧ y < z ) Another probed move x := 1, reaching a satisfying assignment (there are no more violated constraints or (Meta-) violating variables): Heuristics for Local Search Local Search x <= y Heuristics x=1 Example 1: Graph Partitioning x=2 Example 2: x=3 Travelling Salesperson y=1 Meta-Heuristics y=2 Constraint- y=3 Based Local Search Modelling Violation Functions Probing Functions Comparison with CP y < z by Systematic Search z=1 Example: The Comet z=2 Toolchain z=3 Hybrid Methods Bibliography COCP/M4CO 17 - 12 -

  9. Systematic Search (as in SAT, SMT, MIP, CP): + Will find an (optimal) solution, if one exists. + Will give a proof of unsatisfiability, otherwise. − May take a long time to complete. (Meta-) Heuristics for Local Search − Sometimes does not scale well to large instances. Local Search Heuristics − May need a lot of tweaking: search strategies, . . . Example 1: Graph Partitioning Example 2: Travelling Local Search: (Hoos and St¨ utzle, 2004) Salesperson Meta-Heuristics + May find an (optimal) solution, if one exists. Constraint- Based Local − Can rarely give a proof of unsatisfiability, otherwise. Search Modelling Violation Functions − Can rarely guarantee that a found solution is optimal. Probing Functions Comparison with CP + Often scales much better to large instances. by Systematic Search − May need a lot of tweaking: heuristics, parameters, . . . Example: The Comet Toolchain Local search trades completeness and quality for speed! Hybrid Methods Bibliography COCP/M4CO 17 - 13 -

  10. Outline 1. (Meta-) Heuristics for Local Search Local Search (Meta-) Heuristics Heuristics for Local Search Example 1: Graph Partitioning Local Search Example 2: Travelling Salesperson Heuristics Example 1: Graph Meta-Heuristics Partitioning Example 2: Travelling 2. Constraint-Based Local Search Salesperson Meta-Heuristics Modelling Constraint- Based Local Violation Functions Search Modelling Probing Functions Violation Functions Probing Functions Comparison with CP by Systematic Search Comparison with CP by Systematic Search 3. Example: The Comet Toolchain Example: The Comet 4. Hybrid Methods Toolchain 5. Bibliography Hybrid Methods Bibliography COCP/M4CO 17 - 14 -

  11. Local-Search Heuristics: Outline Start from the result of I NITIAL A SSIGNMENT ( V , U ) . Iteratively move to a neighbour assignment. (Meta-) Heuristics for Local Search Aim for a satisfying assignment minimising C OST . Local Search Heuristics Main operation: Move from the current assignment to a Example 1: Graph Partitioning selected assignment among its legal neighbours: Example 2: Travelling Salesperson LEGAL(NEIGHBOURS(s),s) Meta-Heuristics Constraint- NEIGHBOURS(s) Based Local Search Modelling s Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid SELECT(LEGAL(NEIGHBOURS(s),s),s) Methods Bibliography COCP/M4CO 17 - 15 -

  12. Local-Search Heuristics: Generic Algorithm s := I NITIAL A SSIGNMENT ( V , U ) k := 0 ; s ∗ := s // s ∗ is the so far best assignment (Meta-) while � c ∈ C V IOLATION ( c , s ) > 0 and k < µ do Heuristics for Local Search k := k + 1 ; s := S ELECT ( L EGAL ( N EIGHBOURS ( s ) , s ) , s ) Local Search if C OST ( s ) < C OST ( s ∗ ) then s ∗ := s Heuristics Example 1: Graph Partitioning return s ∗ Example 2: Travelling Salesperson where (may need a meta-heuristic to escape local optima): Meta-Heuristics N EIGHBOURS ( s ) returns the neighbours of s . Constraint- Based Local L EGAL ( N , s ) returns the legal neighbours in N w.r.t. s . Search Modelling S ELECT ( M , s ) returns a selected element of M w.r.t. s . Violation Functions Probing Functions LEGAL(NEIGHBOURS(s),s) Comparison with CP by Systematic NEIGHBOURS(s) Search Example: s The Comet Toolchain Hybrid Methods SELECT(LEGAL(NEIGHBOURS(s),s),s) Bibliography COCP/M4CO 17 - 16 -

  13. Examples (L EGAL ) Improving ( N , s ) = { n ∈ N | C OST ( n ) < C OST ( s ) } NonWorsening ( N , s ) = { n ∈ N | C OST ( n ) ≤ C OST ( s ) } (Meta-) Heuristics for ViolatingVar ( N , s ) = Local Search Local Search { n ∈ N | n ( x ) � = s ( x ) for a violating variable x } Heuristics Example 1: Graph Partitioning All ( N , s ) = N Example 2: Travelling Salesperson Meta-Heuristics Examples (S ELECT ) Constraint- Based Local Search First ( M , s ) = the first element in M Modelling Violation Functions Probing Functions �� �� Comparison with CP Best ( M , s ) = random n ∈ M | C OST ( n ) = min t ∈ M C OST ( t ) by Systematic Search Example: The Comet RandomImproving ( M , s ) = Toolchain let n = random ( M ) in if C OST ( n ) < C OST ( s ) then n else s Hybrid Methods Bibliography COCP/M4CO 17 - 17 -

  14. Local Search: Sample Heuristics (Meta-) Examples (Heuristics for S ELECT ◦ L EGAL ) Heuristics for Local Search Systematic (partial) exploration of the neighbourhood: Local Search Heuristics Example 1: Graph First improving neighbour: First ( Improving ( N , s ) , s ) Partitioning Example 2: Travelling Steepest / Gradient descent: Best ( Improving ( N , s ) , s ) Salesperson Meta-Heuristics Min-conflict: Best ( ViolatingVar ( N , s ) , s ) Constraint- Based Local . . . Search Modelling Random walk (pick a neighbour and decide on selecting it): Violation Functions Probing Functions Comparison with CP Random improvement: RandomImproving ( All ( N , s ) , s ) by Systematic Search . . . Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 18 -

  15. Outline 1. (Meta-) Heuristics for Local Search Local Search (Meta-) Heuristics Heuristics for Local Search Example 1: Graph Partitioning Local Search Example 2: Travelling Salesperson Heuristics Example 1: Graph Meta-Heuristics Partitioning Example 2: Travelling 2. Constraint-Based Local Search Salesperson Meta-Heuristics Modelling Constraint- Based Local Violation Functions Search Modelling Probing Functions Violation Functions Probing Functions Comparison with CP by Systematic Search Comparison with CP by Systematic Search 3. Example: The Comet Toolchain Example: The Comet 4. Hybrid Methods Toolchain 5. Bibliography Hybrid Methods Bibliography COCP/M4CO 17 - 19 -

  16. Example (Graph Partitioning) Problem: Given a graph G = ( V , E ) , find a balanced (Meta-) partition � P 1 , P 2 � of V that minimises the number of Heuristics for Local Search edges with end-points in both P 1 and P 2 . Local Search Heuristics Definition: A balanced partition � P 1 , P 2 � of V satisfies Example 1: Graph Partitioning P 1 ∪ P 2 = V , P 1 ∩ P 2 = ∅ , and − 1 ≤ | P 1 | − | P 2 | ≤ 1. Example 2: Travelling Salesperson Meta-Heuristics P2 Constraint- Based Local Search P1 Modelling Violation Functions Probing Functions Example: Comparison with CP by Systematic Search We now design a greedy local-search heuristic. Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 20 -

  17. Example (Graph Partitioning: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). 2 The neighbourhood function (N EIGHBOURS ). (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph 3 The cost of an assignment (C OST ). Partitioning Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search 4 The legal-neighbour filtering function (L EGAL ). Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: 5 The neighbour selection function (S ELECT ). The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 21 -

  18. Example (Graph Partitioning: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random balanced partition � P 1 , P 2 � of G = ( V , E ) . 2 The neighbourhood function (N EIGHBOURS ). (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph 3 The cost of an assignment (C OST ). Partitioning Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search 4 The legal-neighbour filtering function (L EGAL ). Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: 5 The neighbour selection function (S ELECT ). The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 21 -

  19. Example (Graph Partitioning: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random balanced partition � P 1 , P 2 � of G = ( V , E ) . 2 The neighbourhood function (N EIGHBOURS ). (Meta-) Heuristics for Swapping two vertices: Local Search Local Search Heuristics Example 1: Graph 3 The cost of an assignment (C OST ). Partitioning Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search 4 The legal-neighbour filtering function (L EGAL ). Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: 5 The neighbour selection function (S ELECT ). The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 21 -

  20. Example (Graph Partitioning: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random balanced partition � P 1 , P 2 � of G = ( V , E ) . 2 The neighbourhood function (N EIGHBOURS ). (Meta-) Heuristics for Swapping two vertices: N EIGHBOURS ( � P 1 , P 2 � ) = Local Search {� P 1 \ { a } ∪ { b } , P 2 \ { b } ∪ { a }� | a ∈ P 1 ∧ b ∈ P 2 } Local Search Heuristics Example 1: Graph 3 The cost of an assignment (C OST ). Partitioning Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search 4 The legal-neighbour filtering function (L EGAL ). Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: 5 The neighbour selection function (S ELECT ). The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 21 -

  21. Example (Graph Partitioning: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random balanced partition � P 1 , P 2 � of G = ( V , E ) . 2 The neighbourhood function (N EIGHBOURS ). (Meta-) Heuristics for Swapping two vertices: N EIGHBOURS ( � P 1 , P 2 � ) = Local Search {� P 1 \ { a } ∪ { b } , P 2 \ { b } ∪ { a }� | a ∈ P 1 ∧ b ∈ P 2 } Local Search Heuristics Example 1: Graph 3 The cost of an assignment (C OST ). Partitioning Example 2: The number of edges with end-points in both P 1 Travelling Salesperson Meta-Heuristics and P 2 , as the balance constraints cannot be violated: Constraint- Based Local Search 4 The legal-neighbour filtering function (L EGAL ). Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: 5 The neighbour selection function (S ELECT ). The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 21 -

  22. Example (Graph Partitioning: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random balanced partition � P 1 , P 2 � of G = ( V , E ) . 2 The neighbourhood function (N EIGHBOURS ). (Meta-) Heuristics for Swapping two vertices: N EIGHBOURS ( � P 1 , P 2 � ) = Local Search {� P 1 \ { a } ∪ { b } , P 2 \ { b } ∪ { a }� | a ∈ P 1 ∧ b ∈ P 2 } Local Search Heuristics Example 1: Graph 3 The cost of an assignment (C OST ). Partitioning Example 2: The number of edges with end-points in both P 1 Travelling Salesperson Meta-Heuristics and P 2 , as the balance constraints cannot be violated: Constraint- C OST ( � P 1 , P 2 � ) = f ( � P 1 , P 2 � ) = |{ ( a , b ) ∈ E | a ∈ P 1 ∧ b ∈ P 2 }| Based Local Search 4 The legal-neighbour filtering function (L EGAL ). Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: 5 The neighbour selection function (S ELECT ). The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 21 -

  23. Example (Graph Partitioning: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random balanced partition � P 1 , P 2 � of G = ( V , E ) . 2 The neighbourhood function (N EIGHBOURS ). (Meta-) Heuristics for Swapping two vertices: N EIGHBOURS ( � P 1 , P 2 � ) = Local Search {� P 1 \ { a } ∪ { b } , P 2 \ { b } ∪ { a }� | a ∈ P 1 ∧ b ∈ P 2 } Local Search Heuristics Example 1: Graph 3 The cost of an assignment (C OST ). Partitioning Example 2: The number of edges with end-points in both P 1 Travelling Salesperson Meta-Heuristics and P 2 , as the balance constraints cannot be violated: Constraint- C OST ( � P 1 , P 2 � ) = f ( � P 1 , P 2 � ) = |{ ( a , b ) ∈ E | a ∈ P 1 ∧ b ∈ P 2 }| Based Local Search 4 The legal-neighbour filtering function (L EGAL ). Modelling Violation Functions The improving neighbours: Probing Functions Comparison with CP by Systematic Search Example: 5 The neighbour selection function (S ELECT ). The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 21 -

  24. Example (Graph Partitioning: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random balanced partition � P 1 , P 2 � of G = ( V , E ) . 2 The neighbourhood function (N EIGHBOURS ). (Meta-) Heuristics for Swapping two vertices: N EIGHBOURS ( � P 1 , P 2 � ) = Local Search {� P 1 \ { a } ∪ { b } , P 2 \ { b } ∪ { a }� | a ∈ P 1 ∧ b ∈ P 2 } Local Search Heuristics Example 1: Graph 3 The cost of an assignment (C OST ). Partitioning Example 2: The number of edges with end-points in both P 1 Travelling Salesperson Meta-Heuristics and P 2 , as the balance constraints cannot be violated: Constraint- C OST ( � P 1 , P 2 � ) = f ( � P 1 , P 2 � ) = |{ ( a , b ) ∈ E | a ∈ P 1 ∧ b ∈ P 2 }| Based Local Search 4 The legal-neighbour filtering function (L EGAL ). Modelling Violation Functions The improving neighbours: Probing Functions Comparison with CP L EGAL ( N , � P 1 , P 2 � ) = Improving ( N , � P 1 , P 2 � ) by Systematic Search Example: 5 The neighbour selection function (S ELECT ). The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 21 -

  25. Example (Graph Partitioning: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random balanced partition � P 1 , P 2 � of G = ( V , E ) . 2 The neighbourhood function (N EIGHBOURS ). (Meta-) Heuristics for Swapping two vertices: N EIGHBOURS ( � P 1 , P 2 � ) = Local Search {� P 1 \ { a } ∪ { b } , P 2 \ { b } ∪ { a }� | a ∈ P 1 ∧ b ∈ P 2 } Local Search Heuristics Example 1: Graph 3 The cost of an assignment (C OST ). Partitioning Example 2: The number of edges with end-points in both P 1 Travelling Salesperson Meta-Heuristics and P 2 , as the balance constraints cannot be violated: Constraint- C OST ( � P 1 , P 2 � ) = f ( � P 1 , P 2 � ) = |{ ( a , b ) ∈ E | a ∈ P 1 ∧ b ∈ P 2 }| Based Local Search 4 The legal-neighbour filtering function (L EGAL ). Modelling Violation Functions The improving neighbours: Probing Functions Comparison with CP L EGAL ( N , � P 1 , P 2 � ) = Improving ( N , � P 1 , P 2 � ) by Systematic Search Example: 5 The neighbour selection function (S ELECT ). The Comet Toolchain A random best legal neighbour: Hybrid Methods Bibliography COCP/M4CO 17 - 21 -

  26. Example (Graph Partitioning: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random balanced partition � P 1 , P 2 � of G = ( V , E ) . 2 The neighbourhood function (N EIGHBOURS ). (Meta-) Heuristics for Swapping two vertices: N EIGHBOURS ( � P 1 , P 2 � ) = Local Search {� P 1 \ { a } ∪ { b } , P 2 \ { b } ∪ { a }� | a ∈ P 1 ∧ b ∈ P 2 } Local Search Heuristics Example 1: Graph 3 The cost of an assignment (C OST ). Partitioning Example 2: The number of edges with end-points in both P 1 Travelling Salesperson Meta-Heuristics and P 2 , as the balance constraints cannot be violated: Constraint- C OST ( � P 1 , P 2 � ) = f ( � P 1 , P 2 � ) = |{ ( a , b ) ∈ E | a ∈ P 1 ∧ b ∈ P 2 }| Based Local Search 4 The legal-neighbour filtering function (L EGAL ). Modelling Violation Functions The improving neighbours: Probing Functions Comparison with CP L EGAL ( N , � P 1 , P 2 � ) = Improving ( N , � P 1 , P 2 � ) by Systematic Search Example: 5 The neighbour selection function (S ELECT ). The Comet Toolchain A random best legal neighbour: Hybrid S ELECT ( M , � P 1 , P 2 � ) = Best ( M , � P 1 , P 2 � ) Methods Bibliography COCP/M4CO 17 - 21 -

  27. Example (Graph Partitioning: Sample Run) (Meta-) Heuristics for Local Search Local Search Heuristics P2 Example 1: Graph Partitioning Example 2: P1 Travelling Salesperson Meta-Heuristics f(<P1,P2>) = 5 Constraint- Based Local Search Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 22 -

  28. Example (Graph Partitioning: Sample Run) P2 P1 (Meta-) Heuristics for f(<P1,P2>) = 5 Local Search Local Search Heuristics P2 Example 1: Graph Partitioning Example 2: P1 Travelling Salesperson Meta-Heuristics f(<P1,P2>) = 5 Constraint- Based Local Search Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 22 -

  29. Example (Graph Partitioning: Sample Run) P2 P1 (Meta-) Heuristics for f(<P1,P2>) = 5 Local Search Local Search Heuristics P2 P2 Example 1: Graph Partitioning P1 Example 2: P1 Travelling Salesperson f(<P1,P2>) = 2 Meta-Heuristics f(<P1,P2>) = 5 Constraint- Based Local Search Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 22 -

  30. Example (Graph Partitioning: Sample Run) P2 P1 (Meta-) Heuristics for f(<P1,P2>) = 5 Local Search Local Search P2 Heuristics P2 Example 1: Graph Partitioning P1 Example 2: P1 Travelling Salesperson f(<P1,P2>) = 2 Meta-Heuristics f(<P1,P2>) = 5 P2 Constraint- Based Local P1 Search Modelling Violation Functions f(<P1,P2>) = 3 Probing Functions Comparison with CP by Systematic and 22 other probed neighbours � P 1 , P 2 � , Search but none of which with f ( � P 1 , P 2 � ) < 2 Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 22 -

  31. Example (Graph Partitioning: Sample Run) (Meta-) Heuristics for Local Search Local Search Heuristics P2 P2 Example 1: Graph Partitioning P1 Example 2: P1 Travelling Salesperson f(<P1,P2>) = 2 Meta-Heuristics f(<P1,P2>) = 5 Constraint- Based Local Search Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 22 -

  32. Example (Graph Partitioning: Sample Run) (Meta-) Heuristics for Local Search Local Search P2 P2 Heuristics P2 Example 1: Graph Partitioning P1 P1 P1 Example 2: Travelling Salesperson f(<P1,P2>) = 0 f(<P1,P2>) = 2 Meta-Heuristics f(<P1,P2>) = 5 Constraint- Based Local Search Modelling Violation Functions Probing Functions Comparison with CP and 24 other probed neighbours � P 1 , P 2 � , by Systematic Search obviously none of which with f ( � P 1 , P 2 � ) < 0: Example: The Comet the trivial lower bound was reached, so search can stop, Toolchain with proven optimality (this is rare, in general)! Hybrid Methods Bibliography COCP/M4CO 17 - 22 -

  33. Example (Graph Partitioning) Fundamental property of the chosen neighbourhood: If a partition � P 1 , P 2 � is balanced, then each partition in N EIGHBOURS ( � P 1 , P 2 � ) is also balanced. (Meta-) Only satisfying assignments are considered, Heuristics for Local Search including the randomly generated initial assignment. Local Search Heuristics The balance constraints are not checked explicitly. Example 1: Graph Partitioning Example 2: This is a common and often crucial technique: Travelling Salesperson Meta-Heuristics some constraints are explicit (either soft or one-way), Constraint- while other constraints are implicit, in the sense that Based Local Search they are satisfied by the generated initial assignment Modelling Violation Functions and kept satisfied during search by the neighbourhood. Probing Functions Comparison with CP Constraints are hard (either implicit or one-way) or soft. by Systematic Search � � � � | V | | V | The size of the neighbourhood is · . Example: 2 2 The Comet Toolchain The search space is connected: any optimal solution Hybrid can be reached from any assignment. Methods Bibliography COCP/M4CO 17 - 23 -

  34. Outline 1. (Meta-) Heuristics for Local Search Local Search (Meta-) Heuristics Heuristics for Local Search Example 1: Graph Partitioning Local Search Example 2: Travelling Salesperson Heuristics Example 1: Graph Meta-Heuristics Partitioning Example 2: Travelling 2. Constraint-Based Local Search Salesperson Meta-Heuristics Modelling Constraint- Based Local Violation Functions Search Modelling Probing Functions Violation Functions Probing Functions Comparison with CP by Systematic Search Comparison with CP by Systematic Search 3. Example: The Comet Toolchain Example: The Comet 4. Hybrid Methods Toolchain 5. Bibliography Hybrid Methods Bibliography COCP/M4CO 17 - 24 -

  35. Example (Travelling Salesperson) Problem: Given a set of cities with connecting roads, find a tour (a Hamiltonian circuit) that visits each city exactly once, with the minimum travel distance. (Meta-) Heuristics for Representation: We see the set of cities as vertices V Local Search Local Search and the set of roads as edges E in a (not necessarily Heuristics Example 1: Graph complete) undirected graph G = ( V , E ) . Partitioning Example 2: Travelling 231 108 Salesperson Gävle Meta-Heuristics Borlänge Constraint- 146 102 Based Local 12 Search 161 Modelling 135 Uppsala 166 Violation Functions 77 Västerås Probing Functions Örebro 72 Comparison with CP 95 Stockholm by Systematic 113 Search Example: 197 Example: The Comet s: Toolchain We now design a greedy local-search heuristic. Hybrid Methods Bibliography COCP/M4CO 17 - 25 -

  36. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). (Meta-) Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling Salesperson Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local Search Modelling Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 26 -

  37. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random edge set T ⊆ E that forms a tour: NP-hard! (Meta-) Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling Salesperson Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local Search Modelling Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 26 -

  38. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random edge set T ⊆ E that forms a tour: NP-hard! Complete E by adding infinite-distance edges: (Meta-) now any random permutation of V yields a tour. Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling Salesperson Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local Search Modelling Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 26 -

  39. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random edge set T ⊆ E that forms a tour: NP-hard! Complete E by adding infinite-distance edges: (Meta-) now any random permutation of V yields a tour. Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Replace two edges by two other edges so that the Example 1: Graph Partitioning edge set remains a tour: Example 2: Travelling Salesperson Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local Search Modelling Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 26 -

  40. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random edge set T ⊆ E that forms a tour: NP-hard! Complete E by adding infinite-distance edges: (Meta-) now any random permutation of V yields a tour. Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Replace two edges by two other edges so that the Example 1: Graph Partitioning edge set remains a tour: N EIGHBOURS ( T ) = Example 2: Travelling Salesperson { T \ { ( i , i ′ ) , ( j , j ′ ) } ∪ { ( i , j ) , ( i ′ , j ′ ) } | i , j ∈ V where ( i , j ) �∈ T } Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local Search Modelling Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 26 -

  41. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random edge set T ⊆ E that forms a tour: NP-hard! Complete E by adding infinite-distance edges: (Meta-) now any random permutation of V yields a tour. Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Replace two edges by two other edges so that the Example 1: Graph Partitioning edge set remains a tour: N EIGHBOURS ( T ) = Example 2: Travelling Salesperson { T \ { ( i , i ′ ) , ( j , j ′ ) } ∪ { ( i , j ) , ( i ′ , j ′ ) } | i , j ∈ V where ( i , j ) �∈ T } Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local The sum of all distances, as the tour constraint cannot Search Modelling be violated: Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 26 -

  42. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random edge set T ⊆ E that forms a tour: NP-hard! Complete E by adding infinite-distance edges: (Meta-) now any random permutation of V yields a tour. Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Replace two edges by two other edges so that the Example 1: Graph Partitioning edge set remains a tour: N EIGHBOURS ( T ) = Example 2: Travelling Salesperson { T \ { ( i , i ′ ) , ( j , j ′ ) } ∪ { ( i , j ) , ( i ′ , j ′ ) } | i , j ∈ V where ( i , j ) �∈ T } Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local The sum of all distances, as the tour constraint cannot Search Modelling be violated: C OST ( T ) = f ( T ) = � ( a , b ) ∈ T Distance ( a , b ) Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 26 -

  43. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random edge set T ⊆ E that forms a tour: NP-hard! Complete E by adding infinite-distance edges: (Meta-) now any random permutation of V yields a tour. Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Replace two edges by two other edges so that the Example 1: Graph Partitioning edge set remains a tour: N EIGHBOURS ( T ) = Example 2: Travelling Salesperson { T \ { ( i , i ′ ) , ( j , j ′ ) } ∪ { ( i , j ) , ( i ′ , j ′ ) } | i , j ∈ V where ( i , j ) �∈ T } Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local The sum of all distances, as the tour constraint cannot Search Modelling be violated: C OST ( T ) = f ( T ) = � ( a , b ) ∈ T Distance ( a , b ) Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search The improving neighbours: Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 26 -

  44. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random edge set T ⊆ E that forms a tour: NP-hard! Complete E by adding infinite-distance edges: (Meta-) now any random permutation of V yields a tour. Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Replace two edges by two other edges so that the Example 1: Graph Partitioning edge set remains a tour: N EIGHBOURS ( T ) = Example 2: Travelling Salesperson { T \ { ( i , i ′ ) , ( j , j ′ ) } ∪ { ( i , j ) , ( i ′ , j ′ ) } | i , j ∈ V where ( i , j ) �∈ T } Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local The sum of all distances, as the tour constraint cannot Search Modelling be violated: C OST ( T ) = f ( T ) = � ( a , b ) ∈ T Distance ( a , b ) Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search The improving neighbours: L EGAL ( N , T ) = Improving ( N , T ) Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 26 -

  45. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random edge set T ⊆ E that forms a tour: NP-hard! Complete E by adding infinite-distance edges: (Meta-) now any random permutation of V yields a tour. Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Replace two edges by two other edges so that the Example 1: Graph Partitioning edge set remains a tour: N EIGHBOURS ( T ) = Example 2: Travelling Salesperson { T \ { ( i , i ′ ) , ( j , j ′ ) } ∪ { ( i , j ) , ( i ′ , j ′ ) } | i , j ∈ V where ( i , j ) �∈ T } Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local The sum of all distances, as the tour constraint cannot Search Modelling be violated: C OST ( T ) = f ( T ) = � ( a , b ) ∈ T Distance ( a , b ) Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search The improving neighbours: L EGAL ( N , T ) = Improving ( N , T ) Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain A random best legal neighbour: Hybrid Methods Bibliography COCP/M4CO 17 - 26 -

  46. Example (Travelling Salesperson: Choices) 1 The initial assignment (I NITIAL A SSIGNMENT ). A random edge set T ⊆ E that forms a tour: NP-hard! Complete E by adding infinite-distance edges: (Meta-) now any random permutation of V yields a tour. Heuristics for Local Search 2 The neighbourhood function (N EIGHBOURS ). Local Search Heuristics Replace two edges by two other edges so that the Example 1: Graph Partitioning edge set remains a tour: N EIGHBOURS ( T ) = Example 2: Travelling Salesperson { T \ { ( i , i ′ ) , ( j , j ′ ) } ∪ { ( i , j ) , ( i ′ , j ′ ) } | i , j ∈ V where ( i , j ) �∈ T } Meta-Heuristics 3 The cost of an assignment (C OST ). Constraint- Based Local The sum of all distances, as the tour constraint cannot Search Modelling be violated: C OST ( T ) = f ( T ) = � ( a , b ) ∈ T Distance ( a , b ) Violation Functions Probing Functions 4 The legal-neighbour filtering function (L EGAL ). Comparison with CP by Systematic Search The improving neighbours: L EGAL ( N , T ) = Improving ( N , T ) Example: The Comet 5 The neighbour selection function (S ELECT ). Toolchain A random best legal neighbour: Hybrid Methods S ELECT ( M , T ) = Best ( M , T ) Bibliography COCP/M4CO 17 - 26 -

  47. Example (Travelling Salesperson: Sample Run) (Meta-) Heuristics for Three consecutive improving satisfying assignments: Local Search Local Search Heuristics 231 108 231 108 231 108 Example 1: Graph Gävle Gävle Gävle Partitioning Borlänge Borlänge Borlänge Example 2: 146 146 146 102 102 102 Travelling 12 12 12 Salesperson 161 161 161 Meta-Heuristics 135 Uppsala 135 Uppsala 135 Uppsala 166 166 166 77 77 77 Västerås Västerås Västerås Örebro Örebro Örebro Constraint- 72 72 72 95 95 95 Stockholm Stockholm Stockholm Based Local 113 113 113 Search 197 197 197 Modelling s: s: s: Violation Functions f(s) = 709 f(s) = 656 f(s) = 530 Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 27 -

  48. Example (Travelling Salesperson) Fundamental property of the chosen neighbourhood: If an edge set T is a tour, then each edge set in N EIGHBOURS ( T ) is also a tour. (Meta-) Heuristics for Only satisfying assignments are considered, Local Search including the randomly generated initial assignment, Local Search Heuristics but sub-optimality surely occurs if some of the added Example 1: Graph Partitioning Example 2: infinite-distance edges are used. Travelling Salesperson The tour constraint is not checked explicitly. Meta-Heuristics Constraint- Making all constraints implicit (by the search) is not Based Local Search always possible: moves to non-satisfying assignments Modelling Violation Functions must also be considered (as seen in the next section). Probing Functions Comparison with CP by Systematic This neighbourhood is called 2-opt: Search two edges on the current tour are replaced. Example: The Comet Toolchain The size of the neighbourhood is | V | · ( | V | − 2 ) , Hybrid that is 6 · 4 = 24 neighbours for our instance. Methods Bibliography COCP/M4CO 17 - 28 -

  49. Outline 1. (Meta-) Heuristics for Local Search Local Search (Meta-) Heuristics Heuristics for Local Search Example 1: Graph Partitioning Local Search Example 2: Travelling Salesperson Heuristics Example 1: Graph Meta-Heuristics Partitioning Example 2: Travelling 2. Constraint-Based Local Search Salesperson Meta-Heuristics Modelling Constraint- Based Local Violation Functions Search Modelling Probing Functions Violation Functions Probing Functions Comparison with CP by Systematic Search Comparison with CP by Systematic Search 3. Example: The Comet Toolchain Example: The Comet 4. Hybrid Methods Toolchain 5. Bibliography Hybrid Methods Bibliography COCP/M4CO 17 - 29 -

  50. Heuristics drive the search to (good enough) solutions: Which decision variables are modified in a move? Which new values do they get in the move? Meta-heuristics drive the search to global optima of C OST : (Meta-) Heuristics for Avoid cycles of moves & escape local optima of C OST . Local Search Local Search Explore many parts of the search space. Heuristics Example 1: Graph Partitioning Focus on promising parts of the search space. Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: local minimum The Comet Toolchain Hybrid global minimum Methods Bibliography COCP/M4CO 17 - 30 -

  51. Examples (Meta-heuristics) (Meta-) Heuristics for Tabu search (1986): Local Search Local Search forbid recent moves from being done again. Heuristics Example 1: Graph Partitioning Simulated annealing (1983): Example 2: Travelling consider random moves and make worsening ones Salesperson Meta-Heuristics with a probability that decreases over time. Constraint- Based Local Genetic algorithms (1975): Search Modelling use a pool of current assignments and cross them. Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 31 -

  52. Tabu Search (Glover and Laguna, 1997) (Meta-) Heuristics for Local Search In order to escape local optima, we must be able to Local Search Heuristics accept worse assignments, that is assignments that Example 1: Graph Partitioning Example 2: increase the value of C OST . Travelling Salesperson Meta-Heuristics To avoid ending up in cycles, tabu search remembers Constraint- the last λ assignments in a tabu list and makes them Based Local Search tabu (or taboo): moves in this list cannot be chosen, Modelling Violation Functions even if this implies increasing the value of C OST . Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 32 -

  53. Tabu Search Compare with the generic algorithm of slide 16: (Meta-) Heuristics for s := I NITIAL A SSIGNMENT ( V , U ) Local Search k := 0 ; s ∗ := s // s ∗ is the so far best assignment Local Search Heuristics Example 1: Graph τ := [ s ] // initialise the tabu list Partitioning Example 2: while � c ∈ C V IOLATION ( c , s ) > 0 ∧ k < µ do Travelling Salesperson Meta-Heuristics k := k + 1 ; s := Best ( NonTabu ( N EIGHBOURS ( s ) , τ ) , τ ) Constraint- τ := τ :: s // but keep only the last λ assignments Based Local Search if C OST ( s ) < C OST ( s ∗ ) then Modelling s ∗ := s Violation Functions Probing Functions return s ∗ Comparison with CP by Systematic Search Example: The Comet function NonTabu ( N , τ ) Toolchain return { n ∈ N | n / ∈ τ } Hybrid Methods Bibliography COCP/M4CO 17 - 33 -

  54. Outline 1. (Meta-) Heuristics for Local Search Local Search (Meta-) Heuristics Heuristics for Local Search Example 1: Graph Partitioning Local Search Example 2: Travelling Salesperson Heuristics Example 1: Graph Meta-Heuristics Partitioning Example 2: Travelling 2. Constraint-Based Local Search Salesperson Meta-Heuristics Modelling Constraint- Based Local Violation Functions Search Modelling Probing Functions Violation Functions Probing Functions Comparison with CP by Systematic Search Comparison with CP by Systematic Search 3. Example: The Comet Toolchain Example: The Comet 4. Hybrid Methods Toolchain 5. Bibliography Hybrid Methods Bibliography COCP/M4CO 17 - 34 -

  55. Evaluation of Local Search We have seen local-search algorithms for two problems: It is hard to reuse (parts of) a local-search algorithm (Meta-) of one problem for other problems. Heuristics for Local Search We want reusable software components! Local Search Heuristics In constraint-based local search (CBLS) (Van Hentenryck Example 1: Graph Partitioning Example 2: and Michel, 2005): Travelling Salesperson A problem is modelled as a conjunction of constraints, Meta-Heuristics Constraint- whose predicates declaratively encapsulate inference Based Local Search algorithms that are specific to frequent combinatorial Modelling substructures and are thus reusable. Violation Functions Probing Functions Comparison with CP A master search algorithm operates on the model, by Systematic Search guided by user-indicated or designed (meta-)heuristics. Example: The Comet CBLS by itself makes no contributions to the state of the art Toolchain of neighbourhoods, heuristics, and meta-heuristics, but it Hybrid Methods simplifies their formulation and improves their reusability. Bibliography COCP/M4CO 17 - 35 -

  56. CP Solving = Inference + Search A CP solver conducts search interleaved with inference: (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Each constraint has an inference algorithm. Methods Bibliography COCP/M4CO 17 - 36 -

  57. Outline 1. (Meta-) Heuristics for Local Search Local Search (Meta-) Heuristics Heuristics for Local Search Example 1: Graph Partitioning Local Search Example 2: Travelling Salesperson Heuristics Example 1: Graph Meta-Heuristics Partitioning Example 2: Travelling 2. Constraint-Based Local Search Salesperson Meta-Heuristics Modelling Constraint- Based Local Violation Functions Search Modelling Probing Functions Violation Functions Probing Functions Comparison with CP by Systematic Search Comparison with CP by Systematic Search 3. Example: The Comet Toolchain Example: The Comet 4. Hybrid Methods Toolchain 5. Bibliography Hybrid Methods Bibliography COCP/M4CO 17 - 37 -

  58. Definition Each constraint predicate has a violation function: the violation of a constraint is zero if it is currently satisfied, else a positive value proportional to its dissatisfaction. (Meta-) Heuristics for Local Search Local Search Example Heuristics Example 1: Graph Partitioning For x <= y and current assignment s , define the violation Example 2: Travelling Salesperson to be s ( x ) − s ( y ) if s ( x ) �≤ s ( y ) , and 0 otherwise. Meta-Heuristics Constraint- Based Local Search Definitions Modelling Violation Functions A constraint with violation is explicit in a CBLS model Probing Functions Comparison with CP by Systematic and soft: it can be violated during search but ought to be Search Example: satisfied in a solution. The Comet Toolchain The constraint violations are queried during search. Hybrid Methods Bibliography COCP/M4CO 17 - 38 -

  59. Definitions A one-way constraint is explicit in a CBLS model and hard: it is kept satisfied during search by the solver. (Meta-) Heuristics for Local Search Local Search Heuristics Example Example 1: Graph Partitioning Example 2: For p = x * y , if x or y or both are reassigned by a move Travelling Salesperson to assignment s , then s ( p ) is to be automatically set by the Meta-Heuristics Constraint- solver to s ( x ) · s ( y ) . Based Local Search Modelling Violation Functions Probing Functions CBLS solvers offer a syntax for one-way constraints, such Comparison with CP by Systematic as p <== x * y in OscaR.cbls, but CP solvers (such as Search Example: Gecode) and technology-independent modelling languages The Comet Toolchain (such as MiniZinc) do not make such a distinction. Hybrid Methods Bibliography COCP/M4CO 17 - 39 -

  60. Definitions An implicit constraint is not in a CBLS model but hard: it is kept satisfied during search by choosing a satisfying initial assignment and only making satisfaction-preserving moves, (Meta-) by the use of a constraint-specific neighbourhood. Heuristics for Local Search Local Search A constraint is implicit by search, or implied within a model. Heuristics Example 1: Graph Partitioning Example Example 2: Travelling Salesperson For distinct , when there are as many variables as Meta-Heuristics Constraint- values: the initial assignment gives distinct values to all the Based Local Search variables (by random permutation), and the neighbourhood Modelling only has moves that swap the values of two variables. Violation Functions Probing Functions Comparison with CP by Systematic When building a CBLS model, a MiniZinc backend must: Search Example: Aptly assort the otherwise all explicit & soft constraints. The Comet Toolchain Add suitable neighbourhood, heuristic, meta-heuristic. Hybrid Methods This is much more involved than just flattening and solving. Bibliography COCP/M4CO 17 - 40 -

  61. Example (8 Queens) (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search Place 8 queens on a chess board such that no two queens Modelling attack each other: Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 41 -

  62. Example (8 Queens) (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search Place 8 queens on a chess board such that no two queens Modelling attack each other: Violation Functions Probing Functions Comparison with CP 1 No two queens are on the same row. by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 41 -

  63. Example (8 Queens) (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search Place 8 queens on a chess board such that no two queens Modelling attack each other: Violation Functions Probing Functions Comparison with CP 1 No two queens are on the same row. by Systematic Search 2 No two queens are on the same column. Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 41 -

  64. Example (8 Queens) (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search Place 8 queens on a chess board such that no two queens Modelling attack each other: Violation Functions Probing Functions Comparison with CP 1 No two queens are on the same row. by Systematic Search 2 No two queens are on the same column. Example: The Comet Toolchain 3 No two queens are on the same down-diagonal. Hybrid Methods Bibliography COCP/M4CO 17 - 41 -

  65. Example (8 Queens) (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling Salesperson Meta-Heuristics Constraint- Based Local Search Place 8 queens on a chess board such that no two queens Modelling attack each other: Violation Functions Probing Functions Comparison with CP 1 No two queens are on the same row. by Systematic Search 2 No two queens are on the same column. Example: The Comet Toolchain 3 No two queens are on the same down-diagonal. Hybrid 4 No two queens are on the same up-diagonal. Methods Bibliography COCP/M4CO 17 - 41 -

  66. Example (8 Queens: CBLS Models) Let variable R [ c ] represent the row of the queen in col. c : 1 No two queens are on the same row: (Meta-) Heuristics for Local Search Local Search 2 No two queens are on the same column: Heuristics Example 1: Graph Partitioning Example 2: Travelling 3 No two queens are on the same down-diagonal: Salesperson Meta-Heuristics Constraint- Based Local Search Modelling 4 No two queens are on the same up-diagonal: Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 42 -

  67. Example (8 Queens: CBLS Models) Let variable R [ c ] represent the row of the queen in col. c : 1 No two queens are on the same row: ∀ c , c ′ ∈ 1 .. 8 where c < c ′ : R [ c ] � = R [ c ′ ] , (Meta-) Heuristics for that is distinct ([ R [ 1 ] , . . . , R [ 8 ]]) Local Search Local Search 2 No two queens are on the same column: Heuristics Example 1: Graph Partitioning Example 2: Travelling 3 No two queens are on the same down-diagonal: Salesperson Meta-Heuristics Constraint- Based Local Search Modelling 4 No two queens are on the same up-diagonal: Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 42 -

  68. Example (8 Queens: CBLS Models) Let variable R [ c ] represent the row of the queen in col. c : 1 No two queens are on the same row: ∀ c , c ′ ∈ 1 .. 8 where c < c ′ : R [ c ] � = R [ c ′ ] , (Meta-) Heuristics for that is distinct ([ R [ 1 ] , . . . , R [ 8 ]]) Local Search Local Search 2 No two queens are on the same column: Heuristics Example 1: Graph Guaranteed by the choice of the decision variables. Partitioning Example 2: Travelling 3 No two queens are on the same down-diagonal: Salesperson Meta-Heuristics Constraint- Based Local Search Modelling 4 No two queens are on the same up-diagonal: Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 42 -

  69. Example (8 Queens: CBLS Models) Let variable R [ c ] represent the row of the queen in col. c : 1 No two queens are on the same row: ∀ c , c ′ ∈ 1 .. 8 where c < c ′ : R [ c ] � = R [ c ′ ] , (Meta-) Heuristics for that is distinct ([ R [ 1 ] , . . . , R [ 8 ]]) Local Search Local Search 2 No two queens are on the same column: Heuristics Example 1: Graph Guaranteed by the choice of the decision variables. Partitioning Example 2: Travelling 3 No two queens are on the same down-diagonal: Salesperson ∀ c , c ′ ∈ 1 .. 8 where c < c ′ : R [ c ] − c � = R [ c ′ ] − c ′ , Meta-Heuristics Constraint- that is distinct ([ R [ 1 ] − 1 , . . . , R [ 8 ] − 8 ]) Based Local Search Modelling 4 No two queens are on the same up-diagonal: Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 42 -

  70. Example (8 Queens: CBLS Models) Let variable R [ c ] represent the row of the queen in col. c : 1 No two queens are on the same row: ∀ c , c ′ ∈ 1 .. 8 where c < c ′ : R [ c ] � = R [ c ′ ] , (Meta-) Heuristics for that is distinct ([ R [ 1 ] , . . . , R [ 8 ]]) Local Search Local Search 2 No two queens are on the same column: Heuristics Example 1: Graph Guaranteed by the choice of the decision variables. Partitioning Example 2: Travelling 3 No two queens are on the same down-diagonal: Salesperson ∀ c , c ′ ∈ 1 .. 8 where c < c ′ : R [ c ] − c � = R [ c ′ ] − c ′ , Meta-Heuristics Constraint- that is distinct ([ R [ 1 ] − 1 , . . . , R [ 8 ] − 8 ]) Based Local Search Modelling 4 No two queens are on the same up-diagonal: Violation Functions ∀ c , c ′ ∈ 1 .. 8 where c < c ′ : R [ c ] + c � = R [ c ′ ] + c ′ , Probing Functions Comparison with CP by Systematic that is distinct ([ R [ 1 ] + 1 , . . . , R [ 8 ] + 8 ]) Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 42 -

  71. Example (8 Queens: CBLS Models) Let variable R [ c ] represent the row of the queen in col. c : 1 No two queens are on the same row: ∀ c , c ′ ∈ 1 .. 8 where c < c ′ : R [ c ] � = R [ c ′ ] , (Meta-) Heuristics for that is distinct ([ R [ 1 ] , . . . , R [ 8 ]]) Local Search Local Search 2 No two queens are on the same column: Heuristics Example 1: Graph Guaranteed by the choice of the decision variables. Partitioning Example 2: Travelling 3 No two queens are on the same down-diagonal: Salesperson ∀ c , c ′ ∈ 1 .. 8 where c < c ′ : R [ c ] − c � = R [ c ′ ] − c ′ , Meta-Heuristics Constraint- that is distinct ([ R [ 1 ] − 1 , . . . , R [ 8 ] − 8 ]) Based Local Search Modelling 4 No two queens are on the same up-diagonal: Violation Functions ∀ c , c ′ ∈ 1 .. 8 where c < c ′ : R [ c ] + c � = R [ c ′ ] + c ′ , Probing Functions Comparison with CP by Systematic that is distinct ([ R [ 1 ] + 1 , . . . , R [ 8 ] + 8 ]) Search Example: Better model: Make the row constraint implicit, by using a The Comet Toolchain random permutation of 1 .. 8 as initial assignment and using Hybrid a neighbourhood that keeps the row constraint satisfied. Methods Bibliography COCP/M4CO 17 - 42 -

  72. Outline 1. (Meta-) Heuristics for Local Search Local Search (Meta-) Heuristics Heuristics for Local Search Example 1: Graph Partitioning Local Search Example 2: Travelling Salesperson Heuristics Example 1: Graph Meta-Heuristics Partitioning Example 2: Travelling 2. Constraint-Based Local Search Salesperson Meta-Heuristics Modelling Constraint- Based Local Violation Functions Search Modelling Probing Functions Violation Functions Probing Functions Comparison with CP by Systematic Search Comparison with CP by Systematic Search 3. Example: The Comet Toolchain Example: The Comet 4. Hybrid Methods Toolchain 5. Bibliography Hybrid Methods Bibliography COCP/M4CO 17 - 43 -

  73. Constraint Predicates in Local Search The predicate of a soft constraint c is equipped with: A constraint violation function V IOLATION ( c , s ) , which (Meta-) estimates how much c is violated under the current Heuristics for Local Search assignment s : V IOLATION ( c , s ) = 0 if and only if c is Local Search Heuristics satisfied, and V IOLATION ( c , s ) > 0 otherwise. Example 1: Graph Partitioning Example 2: A variable violation function V IOLATION ( c , s , x ) , which Travelling Salesperson estimates how much a suitable change of the value of Meta-Heuristics Constraint- the decision variable x can decrease V IOLATION ( c , s ) . Based Local Search . . . (to be continued) Modelling Violation Functions At the constraint-system level, one can query: Probing Functions Comparison with CP by Systematic The system constraint violation under s of a constraint Search system C ′ ⊆ C is � Example: c ∈ C ′ V IOLATION ( c , s ) . The Comet Toolchain The system variable violation under s of a variable x in Hybrid a system C ′ ⊆ C is � c ∈ C ′ V IOLATION ( c , s , x ) . Methods Bibliography COCP/M4CO 17 - 44 -

  74. Example ( x � = y ) When x = 4 and y = 5: The constraint violation is 0: the constraint is satisfied. The variable violations of x and y are both 0. (Meta-) Heuristics for Local Search When x = 4 and y = 4: Local Search Heuristics The constraint violation is 1: the constraint is violated. Example 1: Graph Partitioning Example 2: The variable violations of x and y are both 1. Travelling Salesperson Meta-Heuristics Example ( distinct ([ a , b , c , d ]) ) Constraint- Based Local Search When a = 5, b = 5, c = 5, d = 6, all with domain D : Modelling Violation Functions The constraint violation is 2, since at least two variables Probing Functions Comparison with CP must be changed to reach a satisfying assignment: by Systematic Search � v ∈ D max( occ [ v ] − 1 , 0 ) , where occ [ v ] stores the Example: The Comet current number of occurrences of value v . Toolchain Hybrid The variable violations of a , b , c are 1, and 0 for d . Methods Bibliography COCP/M4CO 17 - 45 -

  75. Example (8 Queens: Violations) (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling 0 1 1 2 1 1 1 1 system variable violations Salesperson Meta-Heuristics Let the upper-left corner have the coordinates ( 1 , 1 ) : Constraint- Based Local distinct ([ R [ 1 ] , . . . , R [ 8 ]]) Search Modelling Violation Functions Probing Functions distinct ([ R [ 1 ] − 1 , . . . , R [ 8 ] − 8 ]) Comparison with CP by Systematic Search Example: distinct ([ R [ 1 ] + 1 , . . . , R [ 8 ] + 8 ]) The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 46 -

  76. Example (8 Queens: Violations) (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling 0 1 1 2 1 1 1 1 system variable violations Salesperson Meta-Heuristics Let the upper-left corner have the coordinates ( 1 , 1 ) : Constraint- Based Local distinct ([ R [ 1 ] , . . . , R [ 8 ]]) Search Modelling The violation of distinct ([ 8 , 5 , 4 , 6 , 7 , 2 , 1 , 6 ]) is 1. Violation Functions Probing Functions distinct ([ R [ 1 ] − 1 , . . . , R [ 8 ] − 8 ]) Comparison with CP by Systematic Search Example: distinct ([ R [ 1 ] + 1 , . . . , R [ 8 ] + 8 ]) The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 46 -

  77. Example (8 Queens: Violations) (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling 0 1 1 2 1 1 1 1 system variable violations Salesperson Meta-Heuristics Let the upper-left corner have the coordinates ( 1 , 1 ) : Constraint- Based Local distinct ([ R [ 1 ] , . . . , R [ 8 ]]) Search Modelling The violation of distinct ([ 8 , 5 , 4 , 6 , 7 , 2 , 1 , 6 ]) is 1. Violation Functions Probing Functions distinct ([ R [ 1 ] − 1 , . . . , R [ 8 ] − 8 ]) Comparison with CP by Systematic The violation of distinct ([ 7 , 3 , 1 , 2 , 2 , − 4 , − 6 , − 2 ]) is 1. Search Example: distinct ([ R [ 1 ] + 1 , . . . , R [ 8 ] + 8 ]) The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 46 -

  78. Example (8 Queens: Violations) (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling 0 1 1 2 1 1 1 1 system variable violations Salesperson Meta-Heuristics Let the upper-left corner have the coordinates ( 1 , 1 ) : Constraint- Based Local distinct ([ R [ 1 ] , . . . , R [ 8 ]]) Search Modelling The violation of distinct ([ 8 , 5 , 4 , 6 , 7 , 2 , 1 , 6 ]) is 1. Violation Functions Probing Functions distinct ([ R [ 1 ] − 1 , . . . , R [ 8 ] − 8 ]) Comparison with CP by Systematic The violation of distinct ([ 7 , 3 , 1 , 2 , 2 , − 4 , − 6 , − 2 ]) is 1. Search Example: distinct ([ R [ 1 ] + 1 , . . . , R [ 8 ] + 8 ]) The Comet Toolchain The violation of distinct ([ 9 , 7 , 7 , 10 , 12 , 8 , 8 , 14 ]) is 2. Hybrid Methods Bibliography COCP/M4CO 17 - 46 -

  79. Example (8 Queens: Violations) (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph Partitioning Example 2: Travelling 0 1 1 2 1 1 1 1 system variable violations Salesperson Meta-Heuristics Let the upper-left corner have the coordinates ( 1 , 1 ) : Constraint- Based Local distinct ([ R [ 1 ] , . . . , R [ 8 ]]) Search Modelling The violation of distinct ([ 8 , 5 , 4 , 6 , 7 , 2 , 1 , 6 ]) is 1. Violation Functions Probing Functions distinct ([ R [ 1 ] − 1 , . . . , R [ 8 ] − 8 ]) Comparison with CP by Systematic The violation of distinct ([ 7 , 3 , 1 , 2 , 2 , − 4 , − 6 , − 2 ]) is 1. Search Example: distinct ([ R [ 1 ] + 1 , . . . , R [ 8 ] + 8 ]) The Comet Toolchain The violation of distinct ([ 9 , 7 , 7 , 10 , 12 , 8 , 8 , 14 ]) is 2. Hybrid Methods The system constraint violation is 1 + 1 + 2 = 4. Bibliography COCP/M4CO 17 - 46 -

  80. Outline 1. (Meta-) Heuristics for Local Search Local Search (Meta-) Heuristics Heuristics for Local Search Example 1: Graph Partitioning Local Search Example 2: Travelling Salesperson Heuristics Example 1: Graph Meta-Heuristics Partitioning Example 2: Travelling 2. Constraint-Based Local Search Salesperson Meta-Heuristics Modelling Constraint- Based Local Violation Functions Search Modelling Probing Functions Violation Functions Probing Functions Comparison with CP by Systematic Search Comparison with CP by Systematic Search 3. Example: The Comet Toolchain Example: The Comet 4. Hybrid Methods Toolchain 5. Bibliography Hybrid Methods Bibliography COCP/M4CO 17 - 47 -

  81. Constr. Predicates in Local Search (cont’d) The predicate of a soft constraint c is also equipped with: An assignment delta function D ELTA ( c , s , x := v ) , (Meta-) which estimates the increase of V IOLATION ( c , s ) upon Heuristics for Local Search a probed x := v assignment move for variable x and its Local Search Heuristics domain value v . Example 1: Graph Partitioning A swap delta function D ELTA ( c , s , x :=: y ) , Example 2: Travelling Salesperson which estimates the increase of V IOLATION ( c , s ) upon Meta-Heuristics a probed x :=: y swap move for two variables x and y . Constraint- Based Local The more negative a delta the better the probed move! Search Modelling At the constraint-system level, one can query: Violation Functions Probing Functions Comparison with CP The system assignment delta under s of x := v in a by Systematic Search system C ′ ⊆ C is � c ∈ C ′ D ELTA ( c , s , x := v ) . Example: The Comet The system swap delta under s of x :=: y in a Toolchain system C ′ ⊆ C is � c ∈ C ′ D ELTA ( c , s , x :=: y ) . Hybrid Methods Other kinds of moves can be added. Bibliography COCP/M4CO 17 - 48 -

  82. Example (8 Queens: Computing Deltas in O ( 1 ) Time) −1 0 −1 (Meta-) 0 Heuristics for system assignment deltas for queen 4 Local Search 0 Local Search −2 Heuristics Example 1: Graph −2 Partitioning Example 2: −2 Travelling system variable violations 1 2 2 3 2 2 2 0 7 system constraint violation = 2 + 2 + 3 Salesperson Meta-Heuristics Constraint- distinct ([ R [ 1 ] , . . . , R [ 4 ] , . . . , R [ 8 ]]) Based Local Search Modelling Violation Functions distinct ([ R [ 1 ] − 1 , . . . , R [ 4 ] − 4 , . . . , R [ 8 ] − 8 ]) Probing Functions Comparison with CP by Systematic Search Example: distinct ([ R [ 1 ] + 1 , . . . , R [ 4 ] + 4 , . . . , R [ 8 ] + 8 ]) The Comet Toolchain Hybrid The violation increases by [ occ [ v ] ≥ 1 ] − [ occ [ s ( x )] ≥ 2 ] upon x := v . Methods Bibliography COCP/M4CO 17 - 49 -

  83. Example (8 Queens: Computing Deltas in O ( 1 ) Time) −1 0 −1 (Meta-) 0 Heuristics for system assignment deltas for queen 4 Local Search 0 Local Search −2 Heuristics Example 1: Graph −2 Partitioning Example 2: −2 Travelling system variable violations 1 2 2 3 2 2 2 0 7 system constraint violation = 2 + 2 + 3 Salesperson Meta-Heuristics Constraint- distinct ([ R [ 1 ] , . . . , R [ 4 ] , . . . , R [ 8 ]]) Based Local Search Delta of R [ 4 ] := 6 in distinct ([ 8 , 5 , 4 , 5 , 1 , 2 , 1 , 6 ]) is ± 0. Modelling Violation Functions distinct ([ R [ 1 ] − 1 , . . . , R [ 4 ] − 4 , . . . , R [ 8 ] − 8 ]) Probing Functions Comparison with CP by Systematic Search Example: distinct ([ R [ 1 ] + 1 , . . . , R [ 4 ] + 4 , . . . , R [ 8 ] + 8 ]) The Comet Toolchain Hybrid The violation increases by [ occ [ v ] ≥ 1 ] − [ occ [ s ( x )] ≥ 2 ] upon x := v . Methods Bibliography COCP/M4CO 17 - 49 -

  84. Example (8 Queens: Computing Deltas in O ( 1 ) Time) −1 0 −1 (Meta-) 0 Heuristics for system assignment deltas for queen 4 Local Search 0 Local Search −2 Heuristics Example 1: Graph −2 Partitioning Example 2: −2 Travelling system variable violations 1 2 2 3 2 2 2 0 7 system constraint violation = 2 + 2 + 3 Salesperson Meta-Heuristics Constraint- distinct ([ R [ 1 ] , . . . , R [ 4 ] , . . . , R [ 8 ]]) Based Local Search Delta of R [ 4 ] := 6 in distinct ([ 8 , 5 , 4 , 5 , 1 , 2 , 1 , 6 ]) is ± 0. Modelling Violation Functions distinct ([ R [ 1 ] − 1 , . . . , R [ 4 ] − 4 , . . . , R [ 8 ] − 8 ]) Probing Functions Comparison with CP by Systematic Delta of R [ 4 ] := 6 in distinct ([ 7 , 3 , 1 , 1 , − 4 , − 4 , − 6 , − 2 ]) is − 1. Search Example: distinct ([ R [ 1 ] + 1 , . . . , R [ 4 ] + 4 , . . . , R [ 8 ] + 8 ]) The Comet Toolchain Hybrid The violation increases by [ occ [ v ] ≥ 1 ] − [ occ [ s ( x )] ≥ 2 ] upon x := v . Methods Bibliography COCP/M4CO 17 - 49 -

  85. Example (8 Queens: Computing Deltas in O ( 1 ) Time) −1 0 −1 (Meta-) 0 Heuristics for system assignment deltas for queen 4 Local Search 0 Local Search −2 Heuristics Example 1: Graph −2 Partitioning Example 2: −2 Travelling system variable violations 1 2 2 3 2 2 2 0 7 system constraint violation = 2 + 2 + 3 Salesperson Meta-Heuristics Constraint- distinct ([ R [ 1 ] , . . . , R [ 4 ] , . . . , R [ 8 ]]) Based Local Search Delta of R [ 4 ] := 6 in distinct ([ 8 , 5 , 4 , 5 , 1 , 2 , 1 , 6 ]) is ± 0. Modelling Violation Functions distinct ([ R [ 1 ] − 1 , . . . , R [ 4 ] − 4 , . . . , R [ 8 ] − 8 ]) Probing Functions Comparison with CP by Systematic Delta of R [ 4 ] := 6 in distinct ([ 7 , 3 , 1 , 1 , − 4 , − 4 , − 6 , − 2 ]) is − 1. Search Example: distinct ([ R [ 1 ] + 1 , . . . , R [ 4 ] + 4 , . . . , R [ 8 ] + 8 ]) The Comet Toolchain Delta of R [ 4 ] := 6 in distinct ([ 9 , 7 , 7 , 9 , 6 , 8 , 8 , 14 ]) is − 1. Hybrid The violation increases by [ occ [ v ] ≥ 1 ] − [ occ [ s ( x )] ≥ 2 ] upon x := v . Methods Bibliography COCP/M4CO 17 - 49 -

  86. Example (8 Queens: Computing Deltas in O ( 1 ) Time) −1 0 −1 (Meta-) 0 Heuristics for system assignment deltas for queen 4 Local Search 0 Local Search −2 Heuristics Example 1: Graph −2 Partitioning Example 2: −2 Travelling system variable violations 1 2 2 3 2 2 2 0 7 system constraint violation = 2 + 2 + 3 Salesperson Meta-Heuristics Constraint- distinct ([ R [ 1 ] , . . . , R [ 4 ] , . . . , R [ 8 ]]) Based Local Search Delta of R [ 4 ] := 6 in distinct ([ 8 , 5 , 4 , 5 , 1 , 2 , 1 , 6 ]) is ± 0. Modelling Violation Functions distinct ([ R [ 1 ] − 1 , . . . , R [ 4 ] − 4 , . . . , R [ 8 ] − 8 ]) Probing Functions Comparison with CP by Systematic Delta of R [ 4 ] := 6 in distinct ([ 7 , 3 , 1 , 1 , − 4 , − 4 , − 6 , − 2 ]) is − 1. Search Example: distinct ([ R [ 1 ] + 1 , . . . , R [ 4 ] + 4 , . . . , R [ 8 ] + 8 ]) The Comet Toolchain Delta of R [ 4 ] := 6 in distinct ([ 9 , 7 , 7 , 9 , 6 , 8 , 8 , 14 ]) is − 1. Hybrid The system assignment delta of R [ 4 ] := 6 is 0 + ( − 1 ) + ( − 1 ) = − 2. Methods Bibliography COCP/M4CO 17 - 49 -

  87. Outline 1. (Meta-) Heuristics for Local Search Local Search (Meta-) Heuristics Heuristics for Local Search Example 1: Graph Partitioning Local Search Example 2: Travelling Salesperson Heuristics Example 1: Graph Meta-Heuristics Partitioning Example 2: Travelling 2. Constraint-Based Local Search Salesperson Meta-Heuristics Modelling Constraint- Based Local Violation Functions Search Modelling Probing Functions Violation Functions Probing Functions Comparison with CP by Systematic Search Comparison with CP by Systematic Search 3. Example: The Comet Toolchain Example: The Comet 4. Hybrid Methods Toolchain 5. Bibliography Hybrid Methods Bibliography COCP/M4CO 17 - 50 -

  88. Constraint Predicates in Local Search (end) The functions equipping a constraint predicate can be queried in order to guide the local search: • The constraint violation functions can be queried (Meta-) Heuristics for to find promising constraint(s) in order to select Local Search Local Search promising decision variable(s) to reassign in a move. Heuristics • The variable violation functions can be queried to select Example 1: Graph Partitioning Example 2: promising decision variable(s) to reassign in a move. Travelling Salesperson • The probing functions can be queried to select a move Meta-Heuristics in a good direction for a variable or constraint (system). Constraint- Based Local The violation functions are the counterpart of the Search Modelling subsumption checking of systematic CP-style solving. Violation Functions Probing Functions The probing functions are the counterpart of the Comparison with CP by Systematic Search propagators of systematic CP-style solving. Example: The Comet These functions must be implemented for highest time Toolchain and space efficiency, as they may be queried in the Hybrid Methods probing of the neighbourhood at each search iteration. Bibliography COCP/M4CO 17 - 51 -

  89. Symmetry Handling in Local Search (Meta-) Heuristics for Local Search Local Search Heuristics Example 1: Graph When solving combinatorial problems by local search, the Partitioning Example 2: idea is often to exploit the presence of symmetries by doing Travelling Salesperson Meta-Heuristics nothing, rather than by making the search space smaller, as Constraint- with CP / MIP / SAT / SMT-style systematic search. Based Local Search Modelling Violation Functions Probing Functions Comparison with CP by Systematic Search Example: The Comet Toolchain Hybrid Methods Bibliography COCP/M4CO 17 - 52 -

Recommend


More recommend