NPSOLVER
A SAT Based Solver For Optimization Problems
Norbert Manthey and Peter Steinke
NPSOLVER A SAT Based Solver For Optimization Problems Norbert - - PowerPoint PPT Presentation
NPSOLVER A SAT Based Solver For Optimization Problems Norbert Manthey and Peter Steinke Trento, 16.06.2012 Efficient SAT Solvers During the last decade SAT solvers improved heavily There is an own research field Search heuristics
Norbert Manthey and Peter Steinke
During the last decade
– Search heuristics – Preprocessing and inprocessing – Parameter tuning – . . .
TU Dresden, 16.06.2012 npSolver slide 2 of 23
Having a solution only is often not enough
– nice (nurse rostering) – small (size of a plan) – optimal (number of cargo trains per hour)
TU Dresden, 16.06.2012 npSolver slide 3 of 23
Having a solution only is often not enough
– nice (nurse rostering) – small (size of a plan) – optimal (number of cargo trains per hour)
TU Dresden, 16.06.2012 npSolver slide 3 of 23
Having a solution only is often not enough
– nice (nurse rostering) – small (size of a plan) – optimal (number of cargo trains per hour)
TU Dresden, 16.06.2012 npSolver slide 3 of 23
TU Dresden, 16.06.2012 npSolver slide 4 of 23
– Each train has to go on its route – The cost of these constraints is infinite
– Having less trains carrying the same goods would be nice – Missing such a goal has a price (each)
TU Dresden, 16.06.2012 npSolver slide 5 of 23
Problems are described for example as PB instance:
i wixi ⊲ k
TU Dresden, 16.06.2012 npSolver slide 6 of 23
Problems are described for example as PB instance:
i wixi ⊲ k
i wixi TU Dresden, 16.06.2012 npSolver slide 6 of 23
Problems are described for example as PB instance:
i wixi ⊲ k
i wixi
Solving:
i wiJ(xi)
TU Dresden, 16.06.2012 npSolver slide 6 of 23
MaxSAT:
TU Dresden, 16.06.2012 npSolver slide 7 of 23
MaxSAT:
Translate into PBO:
i wixi as in PBO TU Dresden, 16.06.2012 npSolver slide 7 of 23
Weighted Boolean Optimization (WBO):
TU Dresden, 16.06.2012 npSolver slide 8 of 23
Weighted Boolean Optimization (WBO):
Translate into PBO:
TU Dresden, 16.06.2012 npSolver slide 8 of 23
Weighted Boolean Optimization (WBO):
Translate into PBO:
Another translation into MaxSAT:
TU Dresden, 16.06.2012 npSolver slide 8 of 23
TU Dresden, 16.06.2012 npSolver slide 9 of 23
Why do we implement npSolver?
TU Dresden, 16.06.2012 npSolver slide 10 of 23
TU Dresden, 16.06.2012 npSolver slide 11 of 23
We measured the distribution of constraints in the PB competition instances
TU Dresden, 16.06.2012 npSolver slide 12 of 23
We measured the distribution of constraints in the PB competition instances
Note:
TU Dresden, 16.06.2012 npSolver slide 12 of 23
What to do after the PB constraint have been read?
– trivial, at-most-one, at-most-k – general PB constraint with BDD, BDD-path or ADDERs
TU Dresden, 16.06.2012 npSolver slide 13 of 23
What to do after the PB constraint have been read?
Encoding AMO 2-product Sorting NW BDDs Watch Dog Adder NW absolute 611859 19227 112253 22967061 517 567 relative 2.58 % 0.08 % 0.47 % 96.86 % 0.00 % 0.00 % TU Dresden, 16.06.2012 npSolver slide 13 of 23
There are several ways to encode the at-most one constraint
TU Dresden, 16.06.2012 npSolver slide 14 of 23
There are several ways to encode the at-most one constraint
√n))
TU Dresden, 16.06.2012 npSolver slide 14 of 23
There are several ways to encode the at-most one constraint
√n))
– We split a bigger AMO and introduce fresh variables – x1 + · · · + xn ≤ 1 (y +
⌊ n
2 ⌋
xi ≤ 1) (¬y +
n
2 ⌋+1
xi ≤ 1) – Produces ∼ 3n clauses, best for small n
TU Dresden, 16.06.2012 npSolver slide 14 of 23
There are several ways to encode the at-most one constraint
√n))
– We split a bigger AMO and introduce fresh variables – x1 + · · · + xn ≤ 1 (y +
⌊ n
2 ⌋
xi ≤ 1) (¬y +
n
2 ⌋+1
xi ≤ 1) – Produces ∼ 3n clauses, best for small n – Is there a reference for this?
TU Dresden, 16.06.2012 npSolver slide 14 of 23
BDDs can be understood as dynamic programming approach
– The current sum is bigger than k
TU Dresden, 16.06.2012 npSolver slide 15 of 23
BDDs can be understood as dynamic programming approach
– The current sum is bigger than k
TU Dresden, 16.06.2012 npSolver slide 15 of 23
TU Dresden, 16.06.2012 npSolver slide 16 of 23
npSolver offers two main methods to search for an optimal solution
TU Dresden, 16.06.2012 npSolver slide 17 of 23
npSolver offers two main methods to search for an optimal solution
TU Dresden, 16.06.2012 npSolver slide 17 of 23
npSolver offers two main methods to search for an optimal solution
TU Dresden, 16.06.2012 npSolver slide 17 of 23
npSolver offers two main methods to search for an optimal solution
For MaxSAT, we decrease the number of k in the cardinality constraint
i⌈ wi r ⌉ < ⌊ k r ⌋ TU Dresden, 16.06.2012 npSolver slide 17 of 23
TU Dresden, 16.06.2012 npSolver slide 18 of 23
PB Encoder CP2 Optimization Constraint Iterative Solver SAT Solver BDD, Sorting Network, . . . PB F F′ F′
i, Ui
J′
i
TU Dresden, 16.06.2012 npSolver slide 18 of 23
PB Encoder CP2 Optimization Constraint Iterative Solver SAT Solver BDD, Sorting Network, . . . PB F F′ F′
i, Ui
J′
i
TU Dresden, 16.06.2012 npSolver slide 18 of 23
TU Dresden, 16.06.2012 npSolver slide 19 of 23
With npSolver, you can:
TU Dresden, 16.06.2012 npSolver slide 20 of 23
With npSolver, you can:
Ongoing work includes
TU Dresden, 16.06.2012 npSolver slide 20 of 23
TU Dresden, 16.06.2012 npSolver slide 21 of 23
We (soon) provide
TU Dresden, 16.06.2012 npSolver slide 22 of 23
The solver is available at http://tools.computational-logic.org TU Dresden, 16.06.2012 npSolver slide 23 of 23