Scheduling and SAT Emmanuel Hebrard Toulouse Outline Introduction - - PowerPoint PPT Presentation
Scheduling and SAT Emmanuel Hebrard Toulouse Outline Introduction - - PowerPoint PPT Presentation
Scheduling and SAT Emmanuel Hebrard Toulouse Outline Introduction 1 Scheduling and SAT Encoding 2 Scheduling and SAT Heuristics 3 Scheduling and SAT Hybrids 4 Conclusion 5 2 / 53 Outline Introduction 1 Preamble Scheduling
Outline
1
Introduction
2
Scheduling and SAT Encoding
3
Scheduling and SAT Heuristics
4
Scheduling and SAT Hybrids
5
Conclusion
2 / 53
Outline
1
Introduction Preamble Scheduling Background SAT Background
2
Scheduling and SAT Encoding
3
Scheduling and SAT Heuristics
4
Scheduling and SAT Hybrids
5
Conclusion
3 / 53
Scheduling with Boolean Satisfiability
4 / 53
Scheduling with Boolean Satisfiability Number of hits for the Google query ”Scheduling problem” with ...
4 / 53
Scheduling with Boolean Satisfiability Number of hits for the Google query ”Scheduling problem” with ... 130,000
”Mixed Integer Programming” ”Constraint Programming” ”Boolean Satisfiability” OR ”Integer Linear Programming”
4 / 53
Scheduling with Boolean Satisfiability Number of hits for the Google query ”Scheduling problem” with ... 130,000 60,000
”Mixed Integer Programming” ”Constraint Programming” ”Boolean Satisfiability” OR ”Integer Linear Programming”
4 / 53
Scheduling with Boolean Satisfiability Number of hits for the Google query ”Scheduling problem” with ... 130,000 60,000 21,000
”Mixed Integer Programming” ”Constraint Programming” ”Boolean Satisfiability” OR ”Integer Linear Programming”
4 / 53
Scheduling with Boolean Satisfiability Important theoretical results
◮ [Cook-Levin] theorem: “First” NP-complete problem ◮ [Schaefer]’s dichotomy theorem
Efficient algorithms (CDCL) Successful in Circuit design, Model checking, Planning, ...
5 / 53
Scheduling with Boolean Satisfiability Important theoretical results
◮ [Cook-Levin] theorem: “First” NP-complete problem ◮ [Schaefer]’s dichotomy theorem
Efficient algorithms (CDCL) Successful in Circuit design, Model checking, Planning, ... Association of scheduling and SAT not as natural as MIP or CP
5 / 53
Scheduling with Boolean Satisfiability Important theoretical results
◮ [Cook-Levin] theorem: “First” NP-complete problem ◮ [Schaefer]’s dichotomy theorem
Efficient algorithms (CDCL) Successful in Circuit design, Model checking, Planning, ... Association of scheduling and SAT not as natural as MIP or CP Somewhat counter-intuitive (Boolean vs. Range, logical operator)
5 / 53
Scheduling with Boolean Satisfiability Important theoretical results
◮ [Cook-Levin] theorem: “First” NP-complete problem ◮ [Schaefer]’s dichotomy theorem
Efficient algorithms (CDCL) Successful in Circuit design, Model checking, Planning, ... Association of scheduling and SAT not as natural as MIP or CP Somewhat counter-intuitive (Boolean vs. Range, logical operator)
◮ Apparent issue, the numerical aspect can often be avoided 5 / 53
Scheduling with Boolean Satisfiability Important theoretical results
◮ [Cook-Levin] theorem: “First” NP-complete problem ◮ [Schaefer]’s dichotomy theorem
Efficient algorithms (CDCL) Successful in Circuit design, Model checking, Planning, ... Association of scheduling and SAT not as natural as MIP or CP Somewhat counter-intuitive (Boolean vs. Range, logical operator)
◮ Apparent issue, the numerical aspect can often be avoided
Efficiency? SAT Solvers have not always been good
5 / 53
Scheduling with Boolean Satisfiability Important theoretical results
◮ [Cook-Levin] theorem: “First” NP-complete problem ◮ [Schaefer]’s dichotomy theorem
Efficient algorithms (CDCL) Successful in Circuit design, Model checking, Planning, ... Association of scheduling and SAT not as natural as MIP or CP Somewhat counter-intuitive (Boolean vs. Range, logical operator)
◮ Apparent issue, the numerical aspect can often be avoided
Efficiency? SAT Solvers have not always been good
◮ They have made huge progress in the past 10 years 5 / 53
Scheduling with Boolean Satisfiability Important theoretical results
◮ [Cook-Levin] theorem: “First” NP-complete problem ◮ [Schaefer]’s dichotomy theorem
Efficient algorithms (CDCL) Successful in Circuit design, Model checking, Planning, ... Association of scheduling and SAT not as natural as MIP or CP Somewhat counter-intuitive (Boolean vs. Range, logical operator)
◮ Apparent issue, the numerical aspect can often be avoided
Efficiency? SAT Solvers have not always been good
◮ They have made huge progress in the past 10 years
All the approaches discussed here were developed in the last 5 years
5 / 53
Scheduling with Boolean Satisfiability Important theoretical results
◮ [Cook-Levin] theorem: “First” NP-complete problem ◮ [Schaefer]’s dichotomy theorem
Efficient algorithms (CDCL) Successful in Circuit design, Model checking, Planning, ... Association of scheduling and SAT not as natural as MIP or CP Somewhat counter-intuitive (Boolean vs. Range, logical operator)
◮ Apparent issue, the numerical aspect can often be avoided
Efficiency? SAT Solvers have not always been good
◮ They have made huge progress in the past 10 years
All the approaches discussed here were developed in the last 5 years Recent progress in SAT algorithms opens new research opportunities
5 / 53
Scheduling Problems Terminology Tasks (preemptive, non-preemptive) Resources (disjunctive, cumulative, reservoir,...) Objectives (makespan, tardiness, flow time,...) Side constraints (precedence, time windows, time lags,...)
6 / 53
Scheduling Problems Terminology Tasks (preemptive, non-preemptive) Resources (disjunctive, cumulative, reservoir,...) Objectives (makespan, tardiness, flow time,...) Side constraints (precedence, time windows, time lags,...) Tip of the iceberg SAT-based methods have been applied to a very small subset scheduling problems.
◮ Minimization of makespan for non-preemptive tasks and disjunctive
resources
6 / 53
Jobshop Scheduling Problem t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 Problem description A set of non-preemptive tasks
Jobshop Scheduling Problem t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
20 50 80 60 45 20 50 30 40
Problem description A set of non-preemptive tasks Organized in jobs (sequences)
Jobshop Scheduling Problem t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
20 50 80 60 45 20 50 30 40
Problem description A set of non-preemptive tasks Organized in jobs (sequences) Requiring one of m disjunctive resources
Jobshop Scheduling Problem t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
20 50 80 60 45 20 50 30 40
Problem description A set of non-preemptive tasks Organized in jobs (sequences) Requiring one of m disjunctive resources
Jobshop Scheduling Problem t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
20 50 80 60 45 20 50 30 40
Problem description A set of non-preemptive tasks Organized in jobs (sequences) Requiring one of m disjunctive resources
Jobshop Scheduling Problem t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
20 50 80 60 45 20 50 30 40
Problem description A set of non-preemptive tasks Organized in jobs (sequences) Requiring one of m disjunctive resources
Jobshop Scheduling Problem t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
20 50 80 60 45 20 50 30 40
Cmax
20 50 25 50
Problem description A set of non-preemptive tasks Organized in jobs (sequences) Requiring one of m disjunctive resources Objective: minimize the total duration (Cmax)
7 / 53
Boolean Satisfiability (SAT) Problem Boolean variables (atoms) Propositional logic formula (often CNF)
8 / 53
Boolean Satisfiability (SAT) Problem Boolean variables (atoms) Propositional logic formula (often CNF) Literals: a, a
8 / 53
Boolean Satisfiability (SAT) Problem Boolean variables (atoms) Propositional logic formula (often CNF) Literals: a, a Clauses: (a ∨ f ∨ g), (a ∨ f ∨ g), (a ∨ b), (b ∨ c ∨ g)
8 / 53
Boolean Satisfiability (SAT) Problem Boolean variables (atoms) Propositional logic formula (often CNF) Literals: a, a Clauses: (a ∨ f ∨ g), (a ∨ f ∨ g), (a ∨ b), (b ∨ c ∨ g) Algorithms
8 / 53
Boolean Satisfiability (SAT) Problem Boolean variables (atoms) Propositional logic formula (often CNF) Literals: a, a Clauses: (a ∨ f ∨ g), (a ∨ f ∨ g), (a ∨ b), (b ∨ c ∨ g) Algorithms Stochastic local search (GSAT, WalkSat,...)
8 / 53
Boolean Satisfiability (SAT) Problem Boolean variables (atoms) Propositional logic formula (often CNF) Literals: a, a Clauses: (a ∨ f ∨ g), (a ∨ f ∨ g), (a ∨ b), (b ∨ c ∨ g) Algorithms Stochastic local search (GSAT, WalkSat,...) Survey propagation
8 / 53
Boolean Satisfiability (SAT) Problem Boolean variables (atoms) Propositional logic formula (often CNF) Literals: a, a Clauses: (a ∨ f ∨ g), (a ∨ f ∨ g), (a ∨ b), (b ∨ c ∨ g) Algorithms Stochastic local search (GSAT, WalkSat,...) Survey propagation DPLL: Tree search + Unit propagation
8 / 53
Boolean Satisfiability (SAT) Problem Boolean variables (atoms) Propositional logic formula (often CNF) Literals: a, a Clauses: (a ∨ f ∨ g), (a ∨ f ∨ g), (a ∨ b), (b ∨ c ∨ g) Algorithms Stochastic local search (GSAT, WalkSat,...) Survey propagation DPLL: Tree search + Unit propagation CDCL: Conflict Driven Clause learning
8 / 53
Conflict Driven Clause Leaning (CDCL)
9 / 53
Conflict Driven Clause Leaning (CDCL) “Evolved” from DPLL Turning point: clause learning ([GRASP] then [Chaff])
◮ First SAT-Solver competition in 2002 9 / 53
Conflict Driven Clause Leaning (CDCL) “Evolved” from DPLL Turning point: clause learning ([GRASP] then [Chaff])
◮ First SAT-Solver competition in 2002
Dive in the “search tree” (make decisions)
◮ Unit propagate: if a must be true, then a cannot satisfy a clause 9 / 53
Conflict Driven Clause Leaning (CDCL) “Evolved” from DPLL Turning point: clause learning ([GRASP] then [Chaff])
◮ First SAT-Solver competition in 2002
Dive in the “search tree” (make decisions)
◮ Unit propagate: if a must be true, then a cannot satisfy a clause ◮ a ∨ b ∨ c effectively becomes b ∨ c 9 / 53
Conflict Driven Clause Leaning (CDCL) “Evolved” from DPLL Turning point: clause learning ([GRASP] then [Chaff])
◮ First SAT-Solver competition in 2002
Dive in the “search tree” (make decisions)
◮ Unit propagate: if a must be true, then a cannot satisfy a clause ◮ a ∨ b ∨ c effectively becomes b ∨ c
Until reaching a conflicts (dead-end)
◮ Extract a learned clause ◮ Backjump several levels and unit-propagate the learned clause 9 / 53
Conflict Driven Clause Leaning (CDCL) “Evolved” from DPLL Turning point: clause learning ([GRASP] then [Chaff])
◮ First SAT-Solver competition in 2002
Dive in the “search tree” (make decisions)
◮ Unit propagate: if a must be true, then a cannot satisfy a clause ◮ a ∨ b ∨ c effectively becomes b ∨ c
Until reaching a conflicts (dead-end)
◮ Extract a learned clause ◮ Backjump several levels and unit-propagate the learned clause
Adaptive branching heuristics (weight conflicting literals)
9 / 53
Conflict Driven Clause Leaning (CDCL) “Evolved” from DPLL Turning point: clause learning ([GRASP] then [Chaff])
◮ First SAT-Solver competition in 2002
Dive in the “search tree” (make decisions)
◮ Unit propagate: if a must be true, then a cannot satisfy a clause ◮ a ∨ b ∨ c effectively becomes b ∨ c
Until reaching a conflicts (dead-end)
◮ Extract a learned clause ◮ Backjump several levels and unit-propagate the learned clause
Adaptive branching heuristics (weight conflicting literals) And also: restart, simplify the clause base, forget clauses, etc.
9 / 53
CDCL: Example f a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
CDCL: Example f a g a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
CDCL: Example f a g b h a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
CDCL: Example f a g b h i a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
CDCL: Example f a g b h i j a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
CDCL: Example f a g b h i j c k l a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
CDCL: Example f a g b h i j c k l d m a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
CDCL: Example f a g b h i j c k l d m e n
- j
a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
CDCL: Example f a g b h i j c k l d m e n
- j
⊥ a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
10 / 53
CDCL: Example h n
- j
(h ∨ o ∨ j ∨ n)
11 / 53
CDCL: Example h n
- j
(h ∨ o ∨ j ∨ n)
11 / 53
CDCL: Example h n
- j
(h ∨ o ∨ j ∨ n) ≡ (h ∧ o ∧ n) → j
11 / 53
CDCL: Example f a g b h i j c k l d m e n
- j
⊥ f , a, b, c, d, e g, i, k, l, m ⊥
- n
h j j
CDCL: Example f a g b h i j c k l d m e n
- j
⊥ n
- j
h f , a, b, c, d, e g, i, k, l, m ⊥
- n
h j j
CDCL: Example f a g b h i j c k l d m e n
- j
⊥ n
- j
h g f , a, b, c, d, e i, k, l, m ⊥
- n
h j j g
12 / 53
CDCL: Example f a g b h i j c k l d m e n
- j
⊥ a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
13 / 53
CDCL: Example f a g b h i j a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i
13 / 53
CDCL: Example f a g b h i j a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i g ∨ h ∨ j ∨ n
13 / 53
CDCL: Example f a g b h i j n a ∨ f ∨ g a ∨ b ∨ h a ∨ c a ∨ i ∨ l a ∨ k ∨ j b ∨ d b ∨ g ∨ n b ∨ f ∨ n ∨ k c ∨ k c ∨ k ∨ i ∨ l c ∨ h ∨ n ∨ m c ∨ l d ∨ k ∨ l d ∨ g ∨ l g ∨ n ∨ o h ∨ o ∨ j ∨ n i ∨ j d ∨ l ∨ m e ∨ m ∨ n f ∨ h ∨ i g ∨ h ∨ j ∨ n
13 / 53
Outline
1
Introduction
2
Scheduling and SAT Encoding Formulation into SAT Scheduling by encoding into SAT
3
Scheduling and SAT Heuristics
4
Scheduling and SAT Hybrids
5
Conclusion
14 / 53
CNF encoding The way we encode problems into SAT has a huge impact on efficiency
◮ Encoding of Planning problems ◮ Encoding of CSP (Direct, Log, AC-encoding) ◮ Encoding of Pseudo-Boolean (Adder, Sorter) 15 / 53
Direct Encoding Domain An atom iv for each pair (xi, v ∈ D(xi))
◮ iv ⇔ xi = v (for instance: 2 ↔ 0100)
Must take at least a value: i1 ∨ i2 ∨ . . . ∨ in Must take at most one value:
v=w∈D(xi) iv ∨ iw
16 / 53
Direct Encoding Domain An atom iv for each pair (xi, v ∈ D(xi))
◮ iv ⇔ xi = v (for instance: 2 ↔ 0100)
Must take at least a value: i1 ∨ i2 ∨ . . . ∨ in Must take at most one value:
v=w∈D(xi) iv ∨ iw
Complexity O(n2) space: n(n − 1)/2 binary clauses and one n-ary clause. There are different ways to encode the constraints.
16 / 53
Constraints: Tuple Encoding Example of constraint: xi < xj xi 1 2 3 4 xj 1 i1 ∨ j1 i2 ∨ j1 i3 ∨ j1 i4 ∨ j1 2 i2 ∨ j2 i3 ∨ j2 i4 ∨ j2 3 i3 ∨ j3 i4 ∨ j3 4 i4 ∨ j3
17 / 53
Constraints: Tuple Encoding Example of constraint: xi < xj xi 1 2 3 4 xj 1 i1 ∨ j1 i2 ∨ j1 i3 ∨ j1 i4 ∨ j1 2 i2 ∨ j2 i3 ∨ j2 i4 ∨ j2 3 i3 ∨ j3 i4 ∨ j3 4 i4 ∨ j3 Costly (in space) and weak (in propagation) O(n2) binary clauses. i4(xi = 4) and j1(xj = 1) are inconsistent, but not unit propagated.
17 / 53
Constraints: AC Encoding [Kasif 90] Example of constraint: xi < xj assignment atom support xi = 1 i1 ∨ j2 ∨ j3 ∨ j4 xi = 2 i2 ∨ j3 ∨ j4 xi = 3 i3 ∨ j4 xi = 4 i4 ∨ ⊥
18 / 53
Constraints: AC Encoding [Kasif 90] Example of constraint: xi < xj assignment atom support xi = 1 i1 ∨ j2 ∨ j3 ∨ j4 xi = 2 i2 ∨ j3 ∨ j4 xi = 3 i3 ∨ j4 xi = 4 i4 ∨ ⊥ Same space complexity, better propagation O(n) n-ary clauses i4(xi = 4) and j1(xj = 1) are unit clauses.
18 / 53
Order Encoding [Crawford & Backer 94] Domain An atom iv for each pair (xi, v ∈ D(xi))
◮ iv ⇔ xi ≤ v (for instance: 2 ↔ 0111)
Bound propagation:
◮ If xi ≤ v then xi ≤ v + 1 ◮
v∈D(xi) iv ∨ iv+1
19 / 53
Order Encoding [Crawford & Backer 94] Domain An atom iv for each pair (xi, v ∈ D(xi))
◮ iv ⇔ xi ≤ v (for instance: 2 ↔ 0111)
Bound propagation:
◮ If xi ≤ v then xi ≤ v + 1 ◮
v∈D(xi) iv ∨ iv+1
Complexity O(n) space (n − 1 binary clauses)
19 / 53
Constraints: BC Encoding Example of constraint: xi < xj relation clause xi > 0 ⇒ xj > 1 ⊥ ∨j1 xi > 1 ⇒ xj > 2 i1 ∨ j2 xi > 2 ⇒ xj > 3 i2 ∨ j3 xi > 3 ⇒ xj > 4 i3∨ ⊥
20 / 53
Constraints: BC Encoding Example of constraint: xi < xj relation clause xi > 0 ⇒ xj > 1 ⊥ ∨j1 xi > 1 ⇒ xj > 2 i1 ∨ j2 xi > 2 ⇒ xj > 3 i2 ∨ j3 xi > 3 ⇒ xj > 4 i3∨ ⊥ Better complexity and same propagation on some linear constraints O(n) space (n binary clauses) i3(xi ≤ 3) and j1(xj > 1) are unit clauses.
20 / 53
Log Encoding [Walsh 00] Domain An atom ik for each value in [1, . . . , ⌊log2 ub⌋] (assuming D(x) = [0, . . . , ub])
◮ ub
k=1 2k ∗ ik = v ⇔ xi = v (for instance: 2 ↔ 01)
For interval domains, no need for extra clauses
21 / 53
Log Encoding [Walsh 00] Domain An atom ik for each value in [1, . . . , ⌊log2 ub⌋] (assuming D(x) = [0, . . . , ub])
◮ ub
k=1 2k ∗ ik = v ⇔ xi = v (for instance: 2 ↔ 01)
For interval domains, no need for extra clauses Complexity O(log2 n) space Propagation Encoding constraints is trickier, and less powerful
21 / 53
Other Encodings Many more! Mix of direct and order encoding [lazy-FD, Numberjack] Mix of AC and log encoding [Gavanelli 2007] Mix of order and log encoding [Sugar, Tamura et al. 2006]
22 / 53
Other Encodings Many more! Mix of direct and order encoding [lazy-FD, Numberjack] Mix of AC and log encoding [Gavanelli 2007] Mix of order and log encoding [Sugar, Tamura et al. 2006]
◮ Log encoding in a base B and order encoding inside a digit ◮ Excellent results on scheduling benchmarks! (with CDCL solvers) 22 / 53
Order Encoding, Now and Then Progress of SAT solvers From a few hundreds variables in the 90’s to millions now
23 / 53
Order Encoding, Now and Then Progress of SAT solvers From a few hundreds variables in the 90’s to millions now [Crawford & Backer 94] Instances from Sadeh, with 10 jobs, 5 operations each (45m cutoff) Tableau solved 90% of the instances (about 2 min when it did)
23 / 53
Order Encoding, Now and Then Progress of SAT solvers From a few hundreds variables in the 90’s to millions now [Crawford & Backer 94] Instances from Sadeh, with 10 jobs, 5 operations each (45m cutoff) Tableau solved 90% of the instances (about 2 min when it did) [Tamura, Tanjo & Banbara] Same instances used during the CSP Solver Competition Similar model, hardware of course incomparable, MiniSat
23 / 53
Order Encoding, Now and Then Progress of SAT solvers From a few hundreds variables in the 90’s to millions now [Crawford & Backer 94] Instances from Sadeh, with 10 jobs, 5 operations each (45m cutoff) Tableau solved 90% of the instances (about 2 min when it did) [Tamura, Tanjo & Banbara] Same instances used during the CSP Solver Competition Similar model, hardware of course incomparable, MiniSat The hardest instance requires a few 100s conflicts at the most
23 / 53
Closing the Open Shop Instances [Gueret & Prins]: hard for local search, extremely easy for SAT/CP [Taillard]: Large, but relatively easy [Brucker]: Three open instances
24 / 53
Closing the Open Shop Instances [Gueret & Prins]: hard for local search, extremely easy for SAT/CP [Taillard]: Large, but relatively easy [Brucker]: Three open instances results All instances solved and proved optimal
◮ The two hardest instances were decomposed into 120 subproblems, and
required up to 13h to solve
24 / 53
Closing the Open Shop Instances [Gueret & Prins]: hard for local search, extremely easy for SAT/CP [Taillard]: Large, but relatively easy [Brucker]: Three open instances results All instances solved and proved optimal
◮ The two hardest instances were decomposed into 120 subproblems, and
required up to 13h to solve
First approach to close the open shop!
24 / 53
Solving vs. Encoding
25 / 53
Solving vs. Encoding [Tamura et al.]’s encoding is better than order encoding
25 / 53
Solving vs. Encoding [Tamura et al.]’s encoding is better than order encoding
◮ However, the huge difference with respect to [Crawford & Backer 94] is
due to the solver
25 / 53
Solving vs. Encoding [Tamura et al.]’s encoding is better than order encoding
◮ However, the huge difference with respect to [Crawford & Backer 94] is
due to the solver
It is now possible to efficiently solve some scheduling problem simply by formulating it as a CNF formula
25 / 53
Outline
1
Introduction
2
Scheduling and SAT Encoding
3
Scheduling and SAT Heuristics A SAT-like Approach Comparison with the State of the Art
4
Scheduling and SAT Hybrids
5
Conclusion
26 / 53
A SAT-like Approach [Grimes & Hebrard 09] CSP Solver Competition: scheduling benchmarks
27 / 53
A SAT-like Approach [Grimes & Hebrard 09] CSP Solver Competition: scheduling benchmarks
◮ Some hard instances ◮ Generic format (XCSP), the notions of resource is lost, no global
constraint
27 / 53
A SAT-like Approach [Grimes & Hebrard 09] CSP Solver Competition: scheduling benchmarks
◮ Some hard instances ◮ Generic format (XCSP), the notions of resource is lost, no global
constraint
◮ Yet many solvers solved them ([Sugar], [Choco], [Mistral]) 27 / 53
A SAT-like Approach [Grimes & Hebrard 09] CSP Solver Competition: scheduling benchmarks
◮ Some hard instances ◮ Generic format (XCSP), the notions of resource is lost, no global
constraint
◮ Yet many solvers solved them ([Sugar], [Choco], [Mistral])
Experiment with Weighted degree [Boussemart et al. 04]
27 / 53
A SAT-like Approach [Grimes & Hebrard 09] CSP Solver Competition: scheduling benchmarks
◮ Some hard instances ◮ Generic format (XCSP), the notions of resource is lost, no global
constraint
◮ Yet many solvers solved them ([Sugar], [Choco], [Mistral])
Experiment with Weighted degree [Boussemart et al. 04]
◮ Similar simple model in [Mistral], same observation [Grimes] 27 / 53
A SAT-like Approach [Grimes & Hebrard 09] CSP Solver Competition: scheduling benchmarks
◮ Some hard instances ◮ Generic format (XCSP), the notions of resource is lost, no global
constraint
◮ Yet many solvers solved them ([Sugar], [Choco], [Mistral])
Experiment with Weighted degree [Boussemart et al. 04]
◮ Similar simple model in [Mistral], same observation [Grimes] ◮ Open shop instances closed by [Tamura et al.] can be solved to
- ptimality in a few minutes
27 / 53
A SAT-like Approach [Grimes & Hebrard 09] CSP Solver Competition: scheduling benchmarks
◮ Some hard instances ◮ Generic format (XCSP), the notions of resource is lost, no global
constraint
◮ Yet many solvers solved them ([Sugar], [Choco], [Mistral])
Experiment with Weighted degree [Boussemart et al. 04]
◮ Similar simple model in [Mistral], same observation [Grimes] ◮ Open shop instances closed by [Tamura et al.] can be solved to
- ptimality in a few minutes
Are adaptive heuristics all that we need to solve disjunctive scheduling problems?
27 / 53
Constraint Model t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
20 50 80 60 45 20 50 30 40
Cmax
20 50 25 50
Model A Variable for the start time of each task: ti ∈ [0, . . . , Cmax].
◮ Precedence constraints: ti + pi ≤ ti+1. 28 / 53
Constraint Model t2 t7 t9 b2,7 b2,9 b7,9 Model A Variable for the start time of each task: ti ∈ [0, . . . , Cmax].
◮ Precedence constraints: ti + pi ≤ ti+1.
A Boolean Variable standing for the relative order of each pair of conflicting tasks (disjunct):
◮ Binary Disjunctive constraints: bij =
0 ⇔ ti + pi ≤ tj 1 ⇔ tj + pj ≤ ti
29 / 53
Search Strategy
30 / 53
Search Strategy Adaptive heuristic Branch on Boolean variables only (order tasks on machines) Minimum domain over weighted degree [Boussemart et al. 04]
30 / 53
Search Strategy Adaptive heuristic Branch on Boolean variables only (order tasks on machines) Minimum domain over weighted degree [Boussemart et al. 04] Guided search Follow the branch corresponding to the best solution [Beck 07] ≃ phase-saving heuristic in SAT [Pipatsrisawat & Darwiche 07]
30 / 53
Search Strategy Adaptive heuristic Branch on Boolean variables only (order tasks on machines) Minimum domain over weighted degree [Boussemart et al. 04] Guided search Follow the branch corresponding to the best solution [Beck 07] ≃ phase-saving heuristic in SAT [Pipatsrisawat & Darwiche 07] Restarts Geometric [Walsh 99], nogoods on restarts [Lecoutre et al. 07]
30 / 53
Search Strategy Adaptive heuristic Branch on Boolean variables only (order tasks on machines) Minimum domain over weighted degree [Boussemart et al. 04] Guided search Follow the branch corresponding to the best solution [Beck 07] ≃ phase-saving heuristic in SAT [Pipatsrisawat & Darwiche 07] Restarts Geometric [Walsh 99], nogoods on restarts [Lecoutre et al. 07] Almost no problem specific method
30 / 53
CP or SAT? Many similarities with SAT:
◮ Search variables are Boolean ◮ Propagation is very basic ◮ SAT-based search strategies 31 / 53
CP or SAT? Many similarities with SAT:
◮ Search variables are Boolean ◮ Propagation is very basic ◮ SAT-based search strategies
Some differences Faster propagation, but no clause learning
31 / 53
CP or SAT? Many similarities with SAT:
◮ Search variables are Boolean ◮ Propagation is very basic ◮ SAT-based search strategies
Some differences Faster propagation, but no clause learning Restarts + weighted degree “simulates” CDCL behavior?
31 / 53
Experiment on Jobshop and Variants
32 / 53
Experiment on Jobshop and Variants Sequence-dependent setup times
◮ Transition between tasks on a machine 32 / 53
Experiment on Jobshop and Variants Sequence-dependent setup times
◮ Transition between tasks on a machine ◮ Add the transition times in the disjunct 32 / 53
Experiment on Jobshop and Variants Sequence-dependent setup times
◮ Transition between tasks on a machine ◮ Add the transition times in the disjunct
Maximum time lags
◮ Maximum duration between consecutive tasks in a job 32 / 53
Experiment on Jobshop and Variants Sequence-dependent setup times
◮ Transition between tasks on a machine ◮ Add the transition times in the disjunct
Maximum time lags
◮ Maximum duration between consecutive tasks in a job ◮ Precedences with negative durations 32 / 53
Experiment on Jobshop and Variants Sequence-dependent setup times
◮ Transition between tasks on a machine ◮ Add the transition times in the disjunct
Maximum time lags
◮ Maximum duration between consecutive tasks in a job ◮ Precedences with negative durations
Just in Time scheduling
◮ Penalties for earliness and tardiness of each job 32 / 53
Experiment on Jobshop and Variants Sequence-dependent setup times
◮ Transition between tasks on a machine ◮ Add the transition times in the disjunct
Maximum time lags
◮ Maximum duration between consecutive tasks in a job ◮ Precedences with negative durations
Just in Time scheduling
◮ Penalties for earliness and tardiness of each job ◮ Simple decomposition to express the new objective 32 / 53
Experimental Protocol This simple model was run on several standard benchmarks
◮ 1 hour cutoff ◮ 10 random runs, we take the best
Best known results on each benchmark (LS, CP, MIP)
◮ The cutoff may be different ◮ The hardware is different 33 / 53
Experimental Protocol This simple model was run on several standard benchmarks
◮ 1 hour cutoff ◮ 10 random runs, we take the best
Best known results on each benchmark (LS, CP, MIP)
◮ The cutoff may be different ◮ The hardware is different
Average % deviation (with respect to a method M in {MIP, CP, LS})
◮
100 ×
- instance x
M objective(x) − SAT objective(x) #instances × best objective(x)
33 / 53
Experimental Protocol This simple model was run on several standard benchmarks
◮ 1 hour cutoff ◮ 10 random runs, we take the best
Best known results on each benchmark (LS, CP, MIP)
◮ The cutoff may be different ◮ The hardware is different
Average % deviation (with respect to a method M in {MIP, CP, LS})
◮
100 ×
- instance x
M objective(x) − SAT objective(x) #instances × best objective(x)
◮ Negative: how much worse than M (when it is) 33 / 53
Experimental Protocol This simple model was run on several standard benchmarks
◮ 1 hour cutoff ◮ 10 random runs, we take the best
Best known results on each benchmark (LS, CP, MIP)
◮ The cutoff may be different ◮ The hardware is different
Average % deviation (with respect to a method M in {MIP, CP, LS})
◮
100 ×
- instance x
M objective(x) − SAT objective(x) #instances × best objective(x)
◮ Negative: how much worse than M (when it is) ◮ Positive: how much better than M (when it is) 33 / 53
Jobshop - Cmax - Taillard
JSP Setup Time-lag No-wait JiT −1.5 −1 −0.5 % Deviation LS [1] CP [2] MIP (no data) JSP Setup Time-lag No-wait JiT −1.5 −1 −0.5 % Deviation [1] i-TSAB (Tabu Search)
- E. Nowicki and C. Smutnicki
- J. of Scheduling (2005)
[2] SGMPCS (Ilog Scheduler)
- J. C. Beck
JAIR (2007)
34 / 53
Jobshop with setup times - Cmax - Brucker & Thiele
JSP Setup Time-lag No-wait JiT −2 2 4 % Deviation LS [3] CP [2] MIP (no data) JSP Setup Time-lag No-wait JiT −2 2 4 % Deviation [3] GA / Tabu Search Gonzalez, Vela, and Varela ICAPS (2008) [2] SGMPCS (Ilog Scheduler)
- J. C. Beck
JAIR (2007)
35 / 53
Jobshop with time lags - Cmax - Lawrence (modified)
JSP Setup Time-lag No-wait JiT 5 10 15 20 % Deviation LS [4] CP [2] MIP (no data) JSP Setup Time-lag No-wait JiT 5 10 15 20 % Deviation [4] Memetic algorithm Caumond, Lacomme and Tchernev Computers & OR (2008) [2] SGMPCS (Ilog Scheduler)
- J. C. Beck
JAIR (2007)
36 / 53
“No-wait” Jobshop - Cmax - Lawrence
JSP Setup Time-lag No-wait JiT 10 20 % Deviation LS [5] CP [2] MIP [6] JSP Setup Time-lag No-wait JiT 10 20 % Deviation [5] Hybrid Tabu Search Bozejko and Makuchowski Computers & IE (2009) [2] SGMPCS (Ilog Scheduler)
- J. C. Beck
JAIR (2007) [6] CPlex
- J. J. J. van den Broek
PhD thesis (2009)
37 / 53
Jobshop - earliness/tardiness - Beck & Refalo; Morton & Pentico
JSP Setup Time-lag No-wait JiT 100 200 300 % Deviation LS [7] CP [8] MIP [9] JSP Setup Time-lag No-wait JiT 100 200 300 % Deviation [7] LNS (CP/LP) Danna and Peron Ilog Tech. Report (2003) [8] Hybrid CP/LP Beck and Refalo Annals of OR (2003) [9] CPlex Danna, Rothberg, Le Pape CPAIOR (2003)
38 / 53
SAT Strategies Often comparable or better than the state of the art
39 / 53
SAT Strategies Often comparable or better than the state of the art
◮ On benchmarks that are more favorable? 39 / 53
SAT Strategies Often comparable or better than the state of the art
◮ On benchmarks that are more favorable? ◮ On benchmarks that received less attention? 39 / 53
SAT Strategies Often comparable or better than the state of the art
◮ On benchmarks that are more favorable? ◮ On benchmarks that received less attention?
Adaptive heuristics are extremely powerful
39 / 53
SAT Strategies Often comparable or better than the state of the art
◮ On benchmarks that are more favorable? ◮ On benchmarks that received less attention?
Adaptive heuristics are extremely powerful
◮ Effective at detecting bottlenecks 39 / 53
SAT Strategies Often comparable or better than the state of the art
◮ On benchmarks that are more favorable? ◮ On benchmarks that received less attention?
Adaptive heuristics are extremely powerful
◮ Effective at detecting bottlenecks ◮ Often better than dedicated CP approaches to prove optimality 39 / 53
SAT Strategies Often comparable or better than the state of the art
◮ On benchmarks that are more favorable? ◮ On benchmarks that received less attention?
Adaptive heuristics are extremely powerful
◮ Effective at detecting bottlenecks ◮ Often better than dedicated CP approaches to prove optimality ⋆ Even this “pseudo” learning helps! 39 / 53
Outline
1
Introduction
2
Scheduling and SAT Encoding
3
Scheduling and SAT Heuristics
4
Scheduling and SAT Hybrids Lazy clause generation Satisfiability Modulo Theories
5
Conclusion
40 / 53
SAT Hybrids Pure reformulation is surprisingly efficient
41 / 53
SAT Hybrids Pure reformulation is surprisingly efficient However, simply using an adaptive heuristic and restart seems at least as good
41 / 53
SAT Hybrids Pure reformulation is surprisingly efficient However, simply using an adaptive heuristic and restart seems at least as good Hybridization
41 / 53
SAT Hybrids Pure reformulation is surprisingly efficient However, simply using an adaptive heuristic and restart seems at least as good Hybridization SAT-based learning AND CP-based propagation
41 / 53
SAT Hybrids Pure reformulation is surprisingly efficient However, simply using an adaptive heuristic and restart seems at least as good Hybridization SAT-based learning AND CP-based propagation
◮ What is the best tradeoff? 41 / 53
SAT Hybrids Pure reformulation is surprisingly efficient However, simply using an adaptive heuristic and restart seems at least as good Hybridization SAT-based learning AND CP-based propagation
◮ What is the best tradeoff? ◮ Does there need to be a tradeoff? 41 / 53
SAT Hybrids Pure reformulation is surprisingly efficient However, simply using an adaptive heuristic and restart seems at least as good Hybridization SAT-based learning AND CP-based propagation
◮ What is the best tradeoff? ◮ Does there need to be a tradeoff?
Lazy Clause Generation SAT Modulo Theories
41 / 53
Lazy Clause Generation [Ohrimenko, Stuckey & Codish 07] - [Feydy & Stuckey 09] Architecture Channel a CP and SAT representations
◮ Search and propagation in CP ◮ Efficient domain representation and propagators 42 / 53
Lazy Clause Generation [Ohrimenko, Stuckey & Codish 07] - [Feydy & Stuckey 09] Architecture Channel a CP and SAT representations
◮ Search and propagation in CP ◮ Efficient domain representation and propagators ⋆ Produce clauses to explain the pruning ⋆ Just enough to extract a conflict 42 / 53
Lazy Clause Generation [Ohrimenko, Stuckey & Codish 07] - [Feydy & Stuckey 09] Architecture Channel a CP and SAT representations
◮ Search and propagation in CP ◮ Efficient domain representation and propagators ⋆ Produce clauses to explain the pruning ⋆ Just enough to extract a conflict ◮ The SAT formulation is generated lazily (learned during search) 42 / 53
Lazy Clause Generation Architecture Search Domains Propagators Unit Literals Clause Database
Lazy Clause Generation Architecture Search Domains Propagators Unit Literals Clause Database
decision
Lazy Clause Generation Architecture Search Domains Propagators Unit Literals Clause Database
decision filtering
Lazy Clause Generation Architecture Search Domains Propagators Unit Literals Clause Database
decision filtering explanation (clause generation)
Lazy Clause Generation Architecture Search Domains Propagators Unit Literals Clause Database
decision filtering explanation (clause generation) unit propagation
Lazy Clause Generation Architecture Search Domains Propagators Unit Literals Clause Database
decision filtering explanation (clause generation) unit propagation channeling
43 / 53
Lazy-FD: Example xi < xj Initial representation CP view SAT view D(xi) {1, . . . , 4} i1 ∨ i2, i2 ∨ i3 D(xj) {2, . . . , 5} j2 ∨ j3, j3 ∨ j4 constraint xi < xj constraint C(xi, xk, . . .)
44 / 53
Lazy-FD: Example xi < xj Some constraint reduces the domain of xi to {2, . . . , 5} CP view SAT view D(xi) {2, . . . , 4} i1 ∨ i2, i2 ∨ i3 D(xj) {2, . . . , 5} j2 ∨ j3, j3 ∨ j4 constraint xi < xj constraint C(xi, xk, . . .)
44 / 53
Lazy-FD: Example xi < xj An explanation clause T ∨ i1 is produced, and the unit literal i1 is propagated CP view SAT view D(xi) {2, . . . , 4} i1 ∨ i2, i2 ∨ i3 D(xj) {2, . . . , 5} j2 ∨ j3, j3 ∨ j4 constraint xi < xj constraint C(xi, xk, . . .) T ∨ i1
44 / 53
Lazy-FD: Example xi < xj The propagator for xi < xj is triggered and reduces the domain of xj CP view SAT view D(xi) {2, . . . , 4} i1 ∨ i2, i2 ∨ i3 D(xj) {3, . . . , 5} j2 ∨ j3, j3 ∨ j4 constraint xi < xj constraint C(xi, xk, . . .) T ∨ i1
44 / 53
Lazy-FD: Example xi < xj An explanation clause is also produced CP view SAT view D(xi) {2, . . . , 4} i1 ∨ i2, i2 ∨ i3 D(xj) {3, . . . , 5} j2 ∨ j3, j3 ∨ j4 constraint xi < xj ii ∨ j2 constraint C(xi, xk, . . .) T ∨ i1
44 / 53
Results on Resource Constrained Project Scheduling Problem (RCPSP) [Schutt, Feydy, Stuckey & Wallace 09] Resource Constrained Project Scheduling Problem (RCPSP) Cumulative resources, each task has a demand rk for the resource k
45 / 53
Results on Resource Constrained Project Scheduling Problem (RCPSP) [Schutt, Feydy, Stuckey & Wallace 09] Resource Constrained Project Scheduling Problem (RCPSP) Cumulative resources, each task has a demand rk for the resource k Model Formulated using sums on the order encoding A fixed number of runs with a dedicated heuristic, then VSIDS (adaptive heuristic)
45 / 53
Results on Resource Constrained Project Scheduling Problem (RCPSP) [Schutt, Feydy, Stuckey & Wallace 09] Resource Constrained Project Scheduling Problem (RCPSP) Cumulative resources, each task has a demand rk for the resource k Model Formulated using sums on the order encoding A fixed number of runs with a dedicated heuristic, then VSIDS (adaptive heuristic) Results Favorable comparison with state of the art approaches
◮ MCS (implemented on top of Ilog-Scheduler [Laborie 05]) ◮ CP approach by [Liess & Michelon 08] ◮ MIP approach by [Kon´
e et al.]
45 / 53
Results on Resource Constrained Project Scheduling Problem (RCPSP) [Schutt, Feydy, Stuckey & Wallace 09] Resource Constrained Project Scheduling Problem (RCPSP) Cumulative resources, each task has a demand rk for the resource k Model Formulated using sums on the order encoding A fixed number of runs with a dedicated heuristic, then VSIDS (adaptive heuristic) Results Favorable comparison with state of the art approaches
◮ MCS (implemented on top of Ilog-Scheduler [Laborie 05]) ◮ CP approach by [Liess & Michelon 08] ◮ MIP approach by [Kon´
e et al.]
54 open instances closed!
45 / 53
SAT Modulo Theories (SMT) Framework to hybrid dedicated solvers (Theories, or T-Solvers) with CDCL solvers
◮ T-Solver view: a set of propositions each represented by a literal in F ◮ CDCL-Solver view: a CNF formula F partially representing the problem
CDCL-Solver makes decisions and analyzes the conflicts T-Solver detects conflicts and/or propagates and generates explanation clauses
46 / 53
SMT Solver Architecture Search Literals Clauses Database T-Solver
SMT Solver Architecture Search Literals Clauses Database T-Solver
decision
SMT Solver Architecture Search Literals Clauses Database T-Solver
decision Unit propagation
SMT Solver Architecture Search Literals Clauses Database T-Solver
decision Unit propagation channeling propagation
SMT Solver Architecture Search Literals Clauses Database T-Solver
decision Unit propagation channeling propagation explanation
47 / 53
Several Theories T-Solvers Linear Real Arithmetic, Arrays, Bit-Vectors, Equality with Uninterpreted Functions,
48 / 53
Several Theories T-Solvers Linear Real Arithmetic, Arrays, Bit-Vectors, Equality with Uninterpreted Functions, Difference Logic (i.e. formulas contain atoms of the form x − y ≤ k).
48 / 53
Several Theories T-Solvers Linear Real Arithmetic, Arrays, Bit-Vectors, Equality with Uninterpreted Functions, Difference Logic (i.e. formulas contain atoms of the form x − y ≤ k). SMT for scheduling Satisfiability Modulo Difference Logic.
48 / 53
Example: Jobshop Scheduling problem t1 t2 t3 t4 t5 t6
2 6 5
z
5 4 3
49 / 53
Example: Jobshop Scheduling problem t1 t2 t3 t4 t5 t6
2 6 5
z
5 4 3
T-Solver view
s1 − s2 ≤ −2 s3 − s4 ≤ −4 s5 − s6 ≤ −5 s2 − z ≤ −5 s4 − z ≤ −4 s6 − z ≤ −3 a − s1 ≤ 0 a − s3 ≤ 0 a − s5 ≤ 0 z − a ≤ 15 l1≺5 ⇔ s1−s5 ≤ −2 l5≺1 ⇔ s5−s1 ≤ −5 l2≺4 ⇔ s2−s4 ≤ −5 l4≺2 ⇔ s4−s2 ≤ −4 l3≺6 ⇔ s3−s6 ≤ −6 l6≺3 ⇔ s6−s3 ≤ −3
49 / 53
Example: Jobshop Scheduling problem t1 t2 t3 t4 t5 t6
2 6 5
z
5 4 3
T-Solver view
s1 − s2 ≤ −2 s3 − s4 ≤ −4 s5 − s6 ≤ −5 s2 − z ≤ −5 s4 − z ≤ −4 s6 − z ≤ −3 a − s1 ≤ 0 a − s3 ≤ 0 a − s5 ≤ 0 z − a ≤ 15 l1≺5 ⇔ s1−s5 ≤ −2 l5≺1 ⇔ s5−s1 ≤ −5 l2≺4 ⇔ s2−s4 ≤ −5 l4≺2 ⇔ s4−s2 ≤ −4 l3≺6 ⇔ s3−s6 ≤ −6 l6≺3 ⇔ s6−s3 ≤ −3
CDCL-Solver view l1≺5 ∨ l5≺1 l2≺4 ∨ l4≺2 l3≺6 ∨ l6≺3
49 / 53
Example: Jobshop Scheduling Reasoning: detection of negative cycles ([Bellman-Ford]) a t1 t2 t3 t4 t5 t6 z
−2 −6 −5 −5 −3 −4 15
l1≺5 ⇔ s1 − s5 ≤ −2 l5≺1 ⇔ s5 − s1 ≤ −5 l2≺4 ⇔ s2 − s4 ≤ −5 l4≺2 ⇔ s4 − s2 ≤ −4 l3≺6 ⇔ s3 − s6 ≤ −6 l6≺3 ⇔ s6 − s3 ≤ −3
50 / 53
Example: Jobshop Scheduling Reasoning: detection of negative cycles ([Bellman-Ford]) a t1 t2 t3 t4 t5 t6 z
−2 −6 −5 −5 −3 −4 15 −3
l1≺5 ⇔ s1 − s5 ≤ −2 l5≺1 ⇔ s5 − s1 ≤ −5 l2≺4 ⇔ s2 − s4 ≤ −5 l4≺2 ⇔ s4 − s2 ≤ −4 l3≺6 ⇔ s3 − s6 ≤ −6 l6≺3 ⇔ s6 − s3 ≤ −3
50 / 53
Example: Jobshop Scheduling Reasoning: detection of negative cycles ([Bellman-Ford]) a t1 t2 t3 t4 t5 t6 z
−2 −5 −3 −5 −3 −6 −4 15
l1≺5 ⇔ s1 − s5 ≤ −2 l5≺1 ⇔ s5 − s1 ≤ −5 l2≺4 ⇔ s2 − s4 ≤ −5 l4≺2 ⇔ s4 − s2 ≤ −4 l3≺6 ⇔ s3 − s6 ≤ −6 l6≺3 ⇔ s6 − s3 ≤ −3
50 / 53
Example: Jobshop Scheduling Reasoning: detection of negative cycles ([Bellman-Ford]) a t1 t2 t3 t4 t5 t6 z
−2 −6 −5 −5 −3 −4 15 −6
l1≺5 ⇔ s1 − s5 ≤ −2 l5≺1 ⇔ s5 − s1 ≤ −5 l2≺4 ⇔ s2 − s4 ≤ −5 l4≺2 ⇔ s4 − s2 ≤ −4 l3≺6 ⇔ s3 − s6 ≤ −6 l6≺3 ⇔ s6 − s3 ≤ −3
50 / 53
Example: Jobshop Scheduling Reasoning: detection of negative cycles ([Bellman-Ford]) a t1 t2 t3 t4 t5 t6 z
−2 −6 −5 −5 −3 −4 −5 15 −6
l1≺5 ⇔ s1 − s5 ≤ −2 l5≺1 ⇔ s5 − s1 ≤ −5 l2≺4 ⇔ s2 − s4 ≤ −5 l4≺2 ⇔ s4 − s2 ≤ −4 l3≺6 ⇔ s3 − s6 ≤ −6 l6≺3 ⇔ s6 − s3 ≤ −3
50 / 53
Example: Jobshop Scheduling Reasoning: detection of negative cycles ([Bellman-Ford]) a t1 t2 t3 t4 t5 t6 z
−2 −6 −5 −5 −3 −4 −5 −4 15 −6
l1≺5 ⇔ s1 − s5 ≤ −2 l5≺1 ⇔ s5 − s1 ≤ −5 l2≺4 ⇔ s2 − s4 ≤ −5 l4≺2 ⇔ s4 − s2 ≤ −4 l3≺6 ⇔ s3 − s6 ≤ −6 l6≺3 ⇔ s6 − s3 ≤ −3
50 / 53
Example: Jobshop Scheduling Reasoning: detection of negative cycles ([Bellman-Ford]) a t1 t2 t3 t4 t5 t6 z
−6 −5 −5 −3 −5 −2 −5 −4 15 −6
l1≺5 ⇔ s1 − s5 ≤ −2 l5≺1 ⇔ s5 − s1 ≤ −5 l2≺4 ⇔ s2 − s4 ≤ −5 l4≺2 ⇔ s4 − s2 ≤ −4 l3≺6 ⇔ s3 − s6 ≤ −6 l6≺3 ⇔ s6 − s3 ≤ −3
50 / 53
Example: Jobshop Scheduling Reasoning: detection of negative cycles ([Bellman-Ford]) a t1 t2 t3 t4 t5 t6 z
−6 −5 −5 −3 −5 −2 −5 −4 15 −6
l1≺5 ⇔ s1 − s5 ≤ −2 l5≺1 ⇔ s5 − s1 ≤ −5 l2≺4 ⇔ s2 − s4 ≤ −5 l4≺2 ⇔ s4 − s2 ≤ −4 l3≺6 ⇔ s3 − s6 ≤ −6 l6≺3 ⇔ s6 − s3 ≤ −3 Learned clause l5≺1 ∨ l2≺4
50 / 53
Results on Resource Constrained Project Scheduling Problem (RCPSP) [Ans´
- tegui et al. 11]
51 / 53
Results on Resource Constrained Project Scheduling Problem (RCPSP) [Ans´
- tegui et al. 11]
Two fomulations Time encoding Task encoding
51 / 53
Results on Resource Constrained Project Scheduling Problem (RCPSP) [Ans´
- tegui et al. 11]
Two fomulations Time encoding Task encoding Results More robust than lazy-FD
51 / 53
Results on Resource Constrained Project Scheduling Problem (RCPSP) [Ans´
- tegui et al. 11]
Two fomulations Time encoding Task encoding Results More robust than lazy-FD State of the art for RCPSP!
51 / 53
Outline
1
Introduction
2
Scheduling and SAT Encoding
3
Scheduling and SAT Heuristics
4
Scheduling and SAT Hybrids
5
Conclusion
52 / 53
Conclusion
53 / 53
Conclusion Scheduling with SAT is not as bad as it sounds
53 / 53
Conclusion Scheduling with SAT is not as bad as it sounds Generic algorithms can sometimes be difficult to match
◮ Adaptive heuristics ◮ Clause learning 53 / 53
Conclusion Scheduling with SAT is not as bad as it sounds Generic algorithms can sometimes be difficult to match
◮ Adaptive heuristics ◮ Clause learning
Nogood learning [Schiex & Verfaillie 93] and explanation for global constraints [Rochart & Jussien 03], disjunctive resource [Vil´ ım 05]?
◮ Somehow it does not have the same impact as in SAT 53 / 53
Conclusion Scheduling with SAT is not as bad as it sounds Generic algorithms can sometimes be difficult to match
◮ Adaptive heuristics ◮ Clause learning
Nogood learning [Schiex & Verfaillie 93] and explanation for global constraints [Rochart & Jussien 03], disjunctive resource [Vil´ ım 05]?
◮ Somehow it does not have the same impact as in SAT
Hybridization (learning + dedicated reasoning) is the way to go
◮ SAT Modulo Theories? ◮ CDCL with global constraints and integer domains? ◮ Explanation algorithms for global constraints? 53 / 53