Scheduling and SAT

Scheduling and SAT
Emmanuel Hebrard
Toulouse
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
I
I
[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
I
I
[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
I
I
[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
I
I
[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)
I
Apparent issue, the numerical aspect can often be avoided
5 / 53
Scheduling with Boolean Satisfiability
Important theoretical results
I
I
[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)
I
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
I
I
[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)
I
Apparent issue, the numerical aspect can often be avoided
Efficiency? SAT Solvers have not always been good
I
They have made huge progress in the past 10 years
5 / 53
Scheduling with Boolean Satisfiability
Important theoretical results
I
I
[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)
I
Apparent issue, the numerical aspect can often be avoided
Efficiency? SAT Solvers have not always been good
I
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
I
I
[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)
I
Apparent issue, the numerical aspect can often be avoided
Efficiency? SAT Solvers have not always been good
I
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.
I
Minimization of makespan for non-preemptive tasks and disjunctive
resources
6 / 53
Jobshop Scheduling Problem
t1
t2
t3
t5
t9
t6
t10
t7
t11
Problem description
A set of non-preemptive tasks
t4
t8
t12
Jobshop Scheduling Problem
20
t1
60
t5
t9
50
t2
50
45
t6
t10
80
t3
30
t11
Problem description
A set of non-preemptive tasks
Organized in jobs (sequences)
t7
20
40
t8
t12
t4
Jobshop Scheduling Problem
20
t1
60
t5
t9
50
t2
50
45
t6
t10
80
t3
30
t11
t7
20
40
Problem description
A set of non-preemptive tasks
Organized in jobs (sequences)
Requiring one of m disjunctive resources
t8
t12
t4
Jobshop Scheduling Problem
20
t1
60
t5
t9
50
t2
50
45
t6
t10
80
t3
30
t11
t7
20
40
Problem description
A set of non-preemptive tasks
Organized in jobs (sequences)
Requiring one of m disjunctive resources
t8
t12
t4
Jobshop Scheduling Problem
20
t1
60
t5
t9
50
t2
50
45
t6
t10
80
t3
30
t11
t7
20
40
Problem description
A set of non-preemptive tasks
Organized in jobs (sequences)
Requiring one of m disjunctive resources
t8
t12
t4
Jobshop Scheduling Problem
20
t1
60
t5
t9
50
t2
50
45
t6
t10
80
t3
30
t11
t7
20
40
Problem description
A set of non-preemptive tasks
Organized in jobs (sequences)
Requiring one of m disjunctive resources
t8
t12
t4
Jobshop Scheduling Problem
20
t1
50
t2
80
t3
t4
50
60
t5
45
t6
t7
20
t8
25
Cmax
50
t9
50
t10
30
t11
40
t12
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])
I
First SAT-Solver competition in 2002
9 / 53
Conflict Driven Clause Leaning (CDCL)
“Evolved” from DPLL
Turning point: clause learning ([GRASP] then [Chaff])
I
First SAT-Solver competition in 2002
Dive in the “search tree” (make decisions)
I
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])
I
First SAT-Solver competition in 2002
Dive in the “search tree” (make decisions)
I
I
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])
I
First SAT-Solver competition in 2002
Dive in the “search tree” (make decisions)
I
I
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)
I
I
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])
I
First SAT-Solver competition in 2002
Dive in the “search tree” (make decisions)
I
I
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)
I
I
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])
I
First SAT-Solver competition in 2002
Dive in the “search tree” (make decisions)
I
I
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)
I
I
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
c
k
l
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
c
k
l
d
m
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
c
k
l
d
m
e
n
o
j
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
c
k
l
d
m
e
n
o
j
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
o
(h ∨ o ∨ j ∨ n)
j
11 / 53
CDCL: Example
h
n
o
(h ∨ o ∨ j ∨ n)
j
11 / 53
CDCL: Example
h
n
o
(h ∨ o ∨ j ∨ n)
≡
(h ∧ o ∧ n) → j
j
11 / 53
CDCL: Example
f
f , a, b, c, d, e
a
g
g , i, k, l, m
b
h
i
c
k
l
d
m
e
n
j
h
n
o
j
o
j
⊥
⊥
j
CDCL: Example
f
f , a, b, c, d, e
a
g
g , i, k, l, m
b
h
i
c
k
l
d
m
e
n
j
h
n
o
j
o
j
⊥
⊥
j
CDCL: Example
f
f , a, b, c, d, e
a
g
i, k, l, m
b
h
i
c
k
l
d
m
e
n
g
j
j
n
o
o
h
j
⊥
j
⊥
12 / 53
CDCL: Example
f
a
g
b
h
i
c
k
l
d
m
e
n
o
j
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
I
I
I
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 ))
I
iv ⇔ xi = v (for instance: 2 ↔ 0100)
Must take at least a value: i1 ∨ i2 ∨ . . . ∨ in
V
Must take at most one value: v 6=w ∈D(xi ) iv ∨ iw
16 / 53
Direct Encoding
Domain
An atom iv for each pair (xi , v ∈ D(xi ))
I
iv ⇔ xi = v (for instance: 2 ↔ 0100)
Must take at least a value: i1 ∨ i2 ∨ . . . ∨ in
V
Must take at most one value: v 6=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
xj
1
2
3
4
1
2
3
4
i1 ∨ j1
i2 ∨ j1
i2 ∨ j2
i3 ∨ j1
i3 ∨ j2
i3 ∨ j3
i4 ∨ j1
i4 ∨ j2
i4 ∨ j3
i4 ∨ j3
17 / 53
Constraints: Tuple Encoding
Example of constraint: xi < xj
xi
xj
1
2
3
4
1
2
3
4
i1 ∨ j1
i2 ∨ j1
i2 ∨ j2
i3 ∨ j1
i3 ∨ j2
i3 ∨ j3
i4 ∨ j1
i4 ∨ j2
i4 ∨ j3
i4 ∨ j3
Costly (in space) and weak (in propagation)
O(n2 ) binary clauses.
i4 (xi 6= 4) and j1 (xj 6= 1) are inconsistent, but not unit propagated.
17 / 53
Constraints: AC Encoding [Kasif 90]
Example of constraint: xi < xj
assignment
xi = 1
xi = 2
xi = 3
xi = 4
atom
i1
i2
i3
i4
∨
∨
∨
∨
support
j2 ∨ j3 ∨ j4
j3 ∨ j4
j4
⊥
18 / 53
Constraints: AC Encoding [Kasif 90]
Example of constraint: xi < xj
assignment
xi = 1
xi = 2
xi = 3
xi = 4
atom
i1
i2
i3
i4
∨
∨
∨
∨
support
j2 ∨ j3 ∨ j4
j3 ∨ j4
j4
⊥
Same space complexity, better propagation
O(n) n-ary clauses
i4 (xi 6= 4) and j1 (xj 6= 1) are unit clauses.
18 / 53
Order Encoding [Crawford & Backer 94]
Domain
An atom iv for each pair (xi , v ∈ D(xi ))
I
iv ⇔ xi ≤ v (for instance: 2 ↔ 0111)
Bound propagation:
I
I
If
V 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 ))
I
iv ⇔ xi ≤ v (for instance: 2 ↔ 0111)
Bound propagation:
I
I
If
V 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
xi
xi
xi
xi
relation
> 0 ⇒ xj > 1
> 1 ⇒ xj > 2
> 2 ⇒ xj > 3
> 3 ⇒ xj > 4
clause
⊥ ∨j1
i1 ∨ j2
i2 ∨ j3
i3 ∨ ⊥
20 / 53
Constraints: BC Encoding
Example of constraint: xi < xj
xi
xi
xi
xi
relation
> 0 ⇒ xj > 1
> 1 ⇒ xj > 2
> 2 ⇒ xj > 3
> 3 ⇒ xj > 4
clause
⊥ ∨j1
i1 ∨ j2
i2 ∨ j3
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, . . . , blog2 ubc] (assuming
D(x) = [0, . . . , ub])
I
Pub
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, . . . , blog2 ubc] (assuming
D(x) = [0, . . . , ub])
I
Pub
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]
I
I
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
I
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
I
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
I
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
I
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
I
I
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
I
I
I
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
I
I
I
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
I
I
I
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]
I
Similar simple model in [Mistral], same observation [Grimes]
27 / 53
A SAT-like Approach [Grimes & Hebrard 09]
CSP Solver Competition: scheduling benchmarks
I
I
I
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]
I
I
Similar simple model in [Mistral], same observation [Grimes]
Open shop instances closed by [Tamura et al.] can be solved to
optimality in a few minutes
27 / 53
A SAT-like Approach [Grimes & Hebrard 09]
CSP Solver Competition: scheduling benchmarks
I
I
I
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]
I
I
Similar simple model in [Mistral], same observation [Grimes]
Open shop instances closed by [Tamura et al.] can be solved to
optimality in a few minutes
Are adaptive heuristics all that we need to solve disjunctive scheduling
problems?
27 / 53
Constraint Model
20
t1
50
t2
80
t3
t4
50
60
t5
50
t9
45
t6
t10
30
t11
t7
20
40
t8
25
50
Cmax
t12
Model
A Variable for the start time of each task: ti ∈ [0, . . . , Cmax ].
I
Precedence constraints: ti + pi ≤ ti+1 .
28 / 53
Constraint Model
t2
b2,7
b2,9
t7
b7,9
t9
Model
A Variable for the start time of each task: ti ∈ [0, . . . , Cmax ].
I
Precedence constraints: ti + pi ≤ ti+1 .
A Boolean Variable standing for the relative order of each pair of
conflicting tasks (disjunct):
I
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:
I
I
I
Search variables are Boolean
Propagation is very basic
SAT-based search strategies
31 / 53
CP or SAT?
Many similarities with SAT:
I
I
I
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:
I
I
I
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
I
Transition between tasks on a machine
32 / 53
Experiment on Jobshop and Variants
Sequence-dependent setup times
I
I
Transition between tasks on a machine
Add the transition times in the disjunct
32 / 53
Experiment on Jobshop and Variants
Sequence-dependent setup times
I
I
Transition between tasks on a machine
Add the transition times in the disjunct
Maximum time lags
I
Maximum duration between consecutive tasks in a job
32 / 53
Experiment on Jobshop and Variants
Sequence-dependent setup times
I
I
Transition between tasks on a machine
Add the transition times in the disjunct
Maximum time lags
I
I
Maximum duration between consecutive tasks in a job
Precedences with negative durations
32 / 53
Experiment on Jobshop and Variants
Sequence-dependent setup times
I
I
Transition between tasks on a machine
Add the transition times in the disjunct
Maximum time lags
I
I
Maximum duration between consecutive tasks in a job
Precedences with negative durations
Just in Time scheduling
I
Penalties for earliness and tardiness of each job
32 / 53
Experiment on Jobshop and Variants
Sequence-dependent setup times
I
I
Transition between tasks on a machine
Add the transition times in the disjunct
Maximum time lags
I
I
Maximum duration between consecutive tasks in a job
Precedences with negative durations
Just in Time scheduling
I
I
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
I
I
1 hour cutoff
10 random runs, we take the best
Best known results on each benchmark (LS, CP, MIP)
I
I
The cutoff may be different
The hardware is different
33 / 53
Experimental Protocol
This simple model was run on several standard benchmarks
I
I
1 hour cutoff
10 random runs, we take the best
Best known results on each benchmark (LS, CP, MIP)
I
I
The cutoff may be different
The hardware is different
Average % deviation (with respect to a method M in {MIP, CP, LS})
I
100 ×
X
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
I
I
1 hour cutoff
10 random runs, we take the best
Best known results on each benchmark (LS, CP, MIP)
I
I
The cutoff may be different
The hardware is different
Average % deviation (with respect to a method M in {MIP, CP, LS})
I
100 ×
X
instance x
I
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
I
I
1 hour cutoff
10 random runs, we take the best
Best known results on each benchmark (LS, CP, MIP)
I
I
The cutoff may be different
The hardware is different
Average % deviation (with respect to a method M in {MIP, CP, LS})
I
100 ×
X
instance x
I
I
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
LS [1]
CP [2]
MIP (no data)
% Deviation
0
−0.5
[1] i-TSAB (Tabu Search)
E. Nowicki and C. Smutnicki
J. of Scheduling (2005)
−1
[2] SGMPCS (Ilog Scheduler)
−1.5
J. C. Beck
JAIR (2007)
JSP
Setup
Time-lag No-wait
JiT
34 / 53
Jobshop with setup times - Cmax - Brucker & Thiele
LS [3]
CP [2]
MIP (no data)
% Deviation
4
[3] GA / Tabu Search
Gonzalez, Vela, and Varela
ICAPS (2008)
2
0
[2] SGMPCS (Ilog Scheduler)
J. C. Beck
JAIR (2007)
−2
JSP
Setup
Time-lag No-wait
JiT
35 / 53
Jobshop with time lags - Cmax - Lawrence (modified)
LS [4]
CP [2]
MIP (no data)
20
% Deviation
15
[4] Memetic algorithm
Caumond, Lacomme
and Tchernev
Computers & OR (2008)
10
5
[2] SGMPCS (Ilog Scheduler)
J. C. Beck
JAIR (2007)
0
JSP
Setup
Time-lag No-wait
JiT
36 / 53
“No-wait” Jobshop - Cmax - Lawrence
LS [5]
CP [2]
MIP [6]
% Deviation
20
[5] Hybrid Tabu Search
Bozejko and Makuchowski
Computers & IE (2009)
10
[2] SGMPCS (Ilog Scheduler)
J. C. Beck
JAIR (2007)
0
JSP
Setup
Time-lag No-wait
JiT
[6] CPlex
J. J. J. van den Broek
PhD thesis (2009)
37 / 53
Jobshop - earliness/tardiness - Beck & Refalo; Morton & Pentico
LS [7]
CP [8]
MIP [9]
% Deviation
300
[7] LNS (CP/LP)
200
Danna and Peron
Ilog Tech. Report (2003)
100
[8] Hybrid CP/LP
Beck and Refalo
Annals of OR (2003)
0
JSP
Setup
Time-lag No-wait
JiT
[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
I
On benchmarks that are more favorable?
39 / 53
SAT Strategies
Often comparable or better than the state of the art
I
I
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
I
I
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
I
I
On benchmarks that are more favorable?
On benchmarks that received less attention?
Adaptive heuristics are extremely powerful
I
Effective at detecting bottlenecks
39 / 53
SAT Strategies
Often comparable or better than the state of the art
I
I
On benchmarks that are more favorable?
On benchmarks that received less attention?
Adaptive heuristics are extremely powerful
I
I
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
I
I
On benchmarks that are more favorable?
On benchmarks that received less attention?
Adaptive heuristics are extremely powerful
I
I
Effective at detecting bottlenecks
Often better than dedicated CP approaches to prove optimality
F
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
I
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
I
I
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
I
I
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
I
I
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
I
I
Search and propagation in CP
Efficient domain representation and propagators
F
F
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
I
I
Search and propagation in CP
Efficient domain representation and propagators
F
F
I
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
Unit Literals
Propagators
Clause Database
Lazy Clause Generation
Architecture
Search
decision
Domains
Unit Literals
Propagators
Clause Database
Lazy Clause Generation
Architecture
Search
decision
Domains
Unit Literals
filtering
Propagators
Clause Database
Lazy Clause Generation
Architecture
Search
decision
Domains
Unit Literals
filtering
Propagators
explanation
(clause generation)
Clause Database
Lazy Clause Generation
Architecture
Search
decision
Domains
Unit Literals
unit propagation
filtering
Propagators
explanation
(clause generation)
Clause Database
Lazy Clause Generation
Architecture
Search
decision
Domains
channeling
unit propagation
filtering
Propagators
Unit Literals
explanation
(clause generation)
Clause Database
43 / 53
Lazy-FD: Example
xi < xj
Initial representation
D(xi )
D(xj )
constraint
constraint
CP view
{1, . . . , 4}
{2, . . . , 5}
xi < xj
C (xi , xk , . . .)
SAT view
i1 ∨ i2 , i2 ∨ i3
j2 ∨ j3 , j3 ∨ j4
44 / 53
Lazy-FD: Example
xi < xj
Some constraint reduces the domain of xi to {2, . . . , 5}
D(xi )
D(xj )
constraint
constraint
CP view
{2, . . . , 4}
{2, . . . , 5}
xi < xj
C (xi , xk , . . .)
SAT view
i1 ∨ i2 , i2 ∨ i3
j2 ∨ j3 , j3 ∨ j4
44 / 53
Lazy-FD: Example
xi < xj
An explanation clause T ∨ i1 is produced, and the unit literal i1 is
propagated
D(xi )
D(xj )
constraint
constraint
CP view
{2, . . . , 4}
{2, . . . , 5}
xi < xj
C (xi , xk , . . .)
SAT view
i1 ∨ i2 , i2 ∨ i3
j2 ∨ j3 , j3 ∨ j4
T ∨ i1
44 / 53
Lazy-FD: Example
xi < xj
The propagator for xi < xj is triggered and reduces the domain of xj
D(xi )
D(xj )
constraint
constraint
CP view
{2, . . . , 4}
{3, . . . , 5}
xi < xj
C (xi , xk , . . .)
SAT view
i1 ∨ i2 , i2 ∨ i3
j2 ∨ j3 , j3 ∨ j4
T ∨ i1
44 / 53
Lazy-FD: Example
xi < xj
An explanation clause is also produced
D(xi )
D(xj )
constraint
constraint
CP view
{2, . . . , 4}
{3, . . . , 5}
xi < xj
C (xi , xk , . . .)
SAT view
i1 ∨ i2 , i2 ∨ i3
j2 ∨ j3 , j3 ∨ j4
ii ∨ j2
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
I
I
I
MCS (implemented on top of Ilog-Scheduler [Laborie 05])
CP approach by [Liess & Michelon 08]
MIP approach by [Koné 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
I
I
I
MCS (implemented on top of Ilog-Scheduler [Laborie 05])
CP approach by [Liess & Michelon 08]
MIP approach by [Koné et al.]
54 open instances closed!
45 / 53
SAT Modulo Theories (SMT)
Framework to hybrid dedicated solvers (Theories, or T-Solvers) with
CDCL solvers
I
I
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
T-Solver
Clauses Database
SMT Solver
Architecture
Search
decision
Literals
T-Solver
Clauses Database
SMT Solver
Architecture
Search
decision
Literals
Unit propagation
Clauses Database
T-Solver
SMT Solver
Architecture
Search
decision
channeling
Literals
propagation
Unit propagation
Clauses Database
T-Solver
SMT Solver
Architecture
Search
decision
channeling
Literals
propagation
T-Solver
Unit propagation
Clauses Database
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
2
t2
5
6
t3
4
t4
z
3
t5
5
t6
49 / 53
Example: Jobshop Scheduling
T-Solver view
problem
t1
2
t2
5
6
t3
4
t4
z
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
l5≺1
l2≺4
l4≺2
l3≺6
l6≺3
⇔ s1 −s5
⇔ s5 −s1
⇔ s2 −s4
⇔ s4 −s2
⇔ s3 −s6
⇔ s6 −s3
≤ −2
≤ −5
≤ −5
≤ −4
≤ −6
≤ −3
3
t5
5
t6
49 / 53
Example: Jobshop Scheduling
T-Solver view
problem
t1
2
t2
5
6
t3
4
t4
z
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
l5≺1
l2≺4
l4≺2
l3≺6
l6≺3
⇔ s1 −s5
⇔ s5 −s1
⇔ s2 −s4
⇔ s4 −s2
⇔ s3 −s6
⇔ s6 −s3
≤ −2
≤ −5
≤ −5
≤ −4
≤ −6
≤ −3
3
t5
5
t6
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])
15
t1
t2
−2
−5
0
a
z
−4
t3
0
t4
−6
−3
0
t5
−5
l1≺5
l5≺1
l2≺4
l4≺2
l3≺6
l6≺3
⇔ s1 − s5
⇔ s5 − s1
⇔ s2 − s4
⇔ s4 − s2
⇔ s3 − s6
⇔ s6 − s3
≤ −2
≤ −5
≤ −5
≤ −4
≤ −6
≤ −3
t6
50 / 53
Example: Jobshop Scheduling
Reasoning: detection of negative cycles ([Bellman-Ford])
15
t1
t2
−2
−5
0
a
z
−4
t3
0
t4
−6
−3
0
−3
t5
−5
l1≺5
l5≺1
l2≺4
l4≺2
l3≺6
l6≺3
⇔ s1 − s5
⇔ s5 − s1
⇔ s2 − s4
⇔ s4 − s2
⇔ s3 − s6
⇔ s6 − s3
≤ −2
≤ −5
≤ −5
≤ −4
≤ −6
≤ −3
t6
50 / 53
Example: Jobshop Scheduling
Reasoning: detection of negative cycles ([Bellman-Ford])
15
t1
t2
−2
−5
0
a
z
−4
t3
0
t4
−6
−3
0
−3
t5
−5
l1≺5
l5≺1
l2≺4
l4≺2
l3≺6
l6≺3
⇔ s1 − s5
⇔ s5 − s1
⇔ s2 − s4
⇔ s4 − s2
⇔ s3 − s6
⇔ s6 − s3
≤ −2
≤ −5
≤ −5
≤ −4
≤ −6
≤ −3
t6
50 / 53
Example: Jobshop Scheduling
Reasoning: detection of negative cycles ([Bellman-Ford])
15
t1
t2
−2
−5
0
a
z
−4
t3
0
t4
−6
−3
0
−6
t5
−5
l1≺5
l5≺1
l2≺4
l4≺2
l3≺6
l6≺3
⇔ s1 − s5
⇔ s5 − s1
⇔ s2 − s4
⇔ s4 − s2
⇔ s3 − s6
⇔ s6 − s3
≤ −2
≤ −5
≤ −5
≤ −4
≤ −6
≤ −3
t6
50 / 53
Example: Jobshop Scheduling
Reasoning: detection of negative cycles ([Bellman-Ford])
15
t1
t2
−2
−5
0
a
z
−4
0 −5
t3
t4
−6
−3
0
−6
t5
−5
l1≺5
l5≺1
l2≺4
l4≺2
l3≺6
l6≺3
⇔ s1 − s5
⇔ s5 − s1
⇔ s2 − s4
⇔ s4 − s2
⇔ s3 − s6
⇔ s6 − s3
≤ −2
≤ −5
≤ −5
≤ −4
≤ −6
≤ −3
t6
50 / 53
Example: Jobshop Scheduling
Reasoning: detection of negative cycles ([Bellman-Ford])
15
t1
t2
−2
0
a
−5
0 −5
t3
z
−4
−4
t4
−6
−3
0
−6
t5
−5
l1≺5
l5≺1
l2≺4
l4≺2
l3≺6
l6≺3
⇔ s1 − s5
⇔ s5 − s1
⇔ s2 − s4
⇔ s4 − s2
⇔ s3 − s6
⇔ s6 − s3
≤ −2
≤ −5
≤ −5
≤ −4
≤ −6
≤ −3
t6
50 / 53
Example: Jobshop Scheduling
Reasoning: detection of negative cycles ([Bellman-Ford])
15
t1
t2
−2
0
a
−5
0 −5
t3
z
−4
−5
t4
−6
−3
0
−6
t5
−5
l1≺5
l5≺1
l2≺4
l4≺2
l3≺6
l6≺3
⇔ s1 − s5
⇔ s5 − s1
⇔ s2 − s4
⇔ s4 − s2
⇔ s3 − s6
⇔ s6 − s3
≤ −2
≤ −5
≤ −5
≤ −4
≤ −6
≤ −3
t6
50 / 53
Example: Jobshop Scheduling
Reasoning: detection of negative cycles ([Bellman-Ford])
15
t1
t2
−2
0
a
−5
t3
z
−4
−5
0 −5
t4
−6
−3
0
−6
t5
−5
l1≺5
l5≺1
l2≺4
l4≺2
l3≺6
l6≺3
⇔ s1 − s5
⇔ s5 − s1
⇔ s2 − s4
⇔ s4 − s2
⇔ s3 − s6
⇔ s6 − s3
≤ −2
≤ −5
≤ −5
≤ −4
≤ −6
≤ −3
t6
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
I
I
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
I
I
Adaptive heuristics
Clause learning
Nogood learning [Schiex & Verfaillie 93] and explanation for global
constraints [Rochart & Jussien 03], disjunctive resource [Vilı́m 05]?
I
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
I
I
Adaptive heuristics
Clause learning
Nogood learning [Schiex & Verfaillie 93] and explanation for global
constraints [Rochart & Jussien 03], disjunctive resource [Vilı́m 05]?
I
Somehow it does not have the same impact as in SAT
Hybridization (learning + dedicated reasoning) is the way to go
I
I
I
SAT Modulo Theories?
CDCL with global constraints and integer domains?
Explanation algorithms for global constraints?
53 / 53