Exploiting the Power of MIP Solvers in MAXSAT Jessica Davies 1 and - - PowerPoint PPT Presentation

exploiting the power of mip solvers in maxsat
SMART_READER_LITE
LIVE PREVIEW

Exploiting the Power of MIP Solvers in MAXSAT Jessica Davies 1 and - - PowerPoint PPT Presentation

Exploiting the Power of MIP Solvers in MAXSAT Jessica Davies 1 and Fahiem Bacchus 2 1 MIAT, INRA, Toulouse, France 2 Department of Computer Science, University of Toronto Outline 1. Background 2. The MaxHS Approach 3. Exploiting CPLEX 4.


slide-1
SLIDE 1

Exploiting the Power of MIP Solvers in MAXSAT

Jessica Davies1 and Fahiem Bacchus2

1MIAT, INRA, Toulouse, France 2Department of Computer Science, University of Toronto

slide-2
SLIDE 2

Outline

  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results
slide-3
SLIDE 3
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

The MAXSAT Problem

  • MAXSAT is an optimization version of SAT
  • An instance of the MAXSAT problem is given by a CNF

formula F and a cost wt(C) ∈ N ∪ {∞} associated with each clause C

  • A truth assignment π has cost equal to the sum of the

costs of the clauses it falsifies

  • Goal: find an optimal truth assignment, i.e., a truth

assignment of minimum cost mincost(F)

  • Clauses with wt(C) = ∞ are hard, all others are soft
slide-4
SLIDE 4
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Cores

¯ x ∨ z x ¯ x y ∨ ¯ z ¯ y x ∨ y

  • A core is any subset of the soft clauses that is inconsistent

with the hard clauses

  • This instance F has 4 cores
slide-5
SLIDE 5
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Cores

¯ x ∨ z x ¯ x y ∨ ¯ z ¯ y x ∨ y

  • A core is any subset of the soft clauses that is inconsistent

with the hard clauses

  • This instance F has 4 cores
slide-6
SLIDE 6
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Cores

¯ x ∨ z x ¯ x y ∨ ¯ z ¯ y x ∨ y

  • A core is any subset of the soft clauses that is inconsistent

with the hard clauses

  • This instance F has 4 cores
slide-7
SLIDE 7
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Cores

¯ x ∨ z x ¯ x y ∨ ¯ z ¯ y x ∨ y

  • A core is any subset of the soft clauses that is inconsistent

with the hard clauses

  • This instance F has 4 cores
slide-8
SLIDE 8
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Hitting Sets

¯ x ∨ z x ¯ x y ∨ ¯ z ¯ y x ∨ y π = {x, ¯ y, z}

  • The clauses falsified by π are a hitting set of the cores
slide-9
SLIDE 9
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

MaxHS Theorem

¯ x ∨ z x ¯ x y ∨ ¯ z ¯ y x ∨ y By the theorem, π = {x, ¯ y, z} is a solution Theorem: if π satisfies F \ hs where hs is a minimum cost hitting set of a collection of cores, then π is a solution

slide-10
SLIDE 10

Outline

  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results
slide-11
SLIDE 11
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

The MaxHS Approach

  • In this paper we extend this existing approach for solving

MAXSAT Min Cost Hitting Set

  • f

κ1, . . . , κk F \ hs is SAT? No Yes π hs Core κi ⊆ F \ hs

slide-12
SLIDE 12
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

The SAT Model

  • The SAT solver works with a relaxed formula

Fb = hard(F) ∪ {Ci ∨ bi|Ci ∈ soft(F)}

  • The bi are the relaxation variables, each appearing in only
  • ne clause
  • To test if F \ hs is SAT, we use the set of assumptions

Ahs = {bi|Ci ∈ hs} ∪ {¬bi|Ci / ∈ hs}

  • Applying these assumptions to Fb produces F \ hs
slide-13
SLIDE 13
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Core Generation

Fb C1 ¯ x ∨ z ∨ b1 C2 x ∨ b2 C3 ¯ x ∨ b3 C4 y ∨ ¯ z ∨ b4 C5 ¯ y ∨ b5 C6 x ∨ y ∨ b6

slide-14
SLIDE 14
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Core Generation

Fb Known Cores C1 ¯ x ∨ z ∨ b1 κ1 = {C2, C3} C2 x ∨ b2 κ2 = {C3, C5, C6} C3 ¯ x ∨ b3 κ3 = {C1, C4, C5, C6} C4 y ∨ ¯ z ∨ b4 C5 ¯ y ∨ b5 C6 x ∨ y ∨ b6

slide-15
SLIDE 15
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Core Generation

Fb Known Cores C1 ¯ x ∨ z ∨ b1 κ1 = {C2, C3} C2 x ∨ b2 κ2 = {C3, C5, C6} C3 ¯ x ∨ b3 κ3 = {C1, C4, C5, C6} C4 y ∨ ¯ z ∨ b4 C5 ¯ y ∨ b5 Hitting Set C6 x ∨ y ∨ b6 hs = {C3, C6}

slide-16
SLIDE 16
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Core Generation

Fb Known Cores Assumptions Ahs C1 ¯ x ∨ z ∨ b1 κ1 = {C2, C3} ¬b1 C2 x ∨ b2 κ2 = {C3, C5, C6} ¬b2 C3 ¯ x ∨ b3 κ3 = {C1, C4, C5, C6} b3 C4 y ∨ ¯ z ∨ b4 ¬b4 C5 ¯ y ∨ b5 Hitting Set ¬b5 C6 x ∨ y ∨ b6 hs = {C3, C6} b6

slide-17
SLIDE 17
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Core Generation

Fb|Ahs Known Cores Assumptions Ahs C1 ¯ x ∨ z κ1 = {C2, C3} ¬b1 C2 x κ2 = {C3, C5, C6} ¬b2 κ3 = {C1, C4, C5, C6} b3 C4 y ∨ ¯ z ¬b4 C5 ¯ y Hitting Set ¬b5 hs = {C3, C6} b6

slide-18
SLIDE 18
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Core Generation

Fb|Ahs Known Cores Assumptions Ahs C1 ¯ x ∨ z κ1 = {C2, C3} ¬b1 C2 x κ2 = {C3, C5, C6} ¬b2 κ3 = {C1, C4, C5, C6} b3 C4 y ∨ ¯ z ¬b4 C5 ¯ y Hitting Set ¬b5 hs = {C3, C6} b6 Conflict Clause b1 ∨ b2 ∨ b4 ∨ b5

slide-19
SLIDE 19
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Core Generation

  • The conflict clause (b1 ∨ b2 ∨ b4 ∨ b5) intuitively means

that one of the corresponding clauses must be falsified:

  • κ4 = {C1, C2, C4, C5} is a new core
  • The b-variables appear only positively in Fb
  • Positive b-variables in the assumptions only satisfy clauses,

and cannot contribute to conflicts

  • ∴ all conflict clauses derived by the SAT solver correspond

to cores

slide-20
SLIDE 20
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Core Generation

  • The conflict clause (b1 ∨ b2 ∨ b4 ∨ b5) intuitively means

that one of the corresponding clauses must be falsified:

  • κ4 = {C1, C2, C4, C5} is a new core
  • The b-variables appear only positively in Fb
  • Positive b-variables in the assumptions only satisfy clauses,

and cannot contribute to conflicts

  • ∴ all conflict clauses derived by the SAT solver correspond

to cores

slide-21
SLIDE 21
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Hitting Set IP Model

Objective: min Σibiwt(Ci) Constraints: Σbi|Ci∈κjbi ≥ 1 for all known cores κj CPLEX Ahs

slide-22
SLIDE 22
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

MaxHS Performance

  • The existing MaxHS solver performs well but is not

state-of-the-art [Davies and Bacchus, CP-11]

  • The time required to solve the hitting set problems

dominates

  • In this paper we present methods that improve the

performance of MaxHS

  • These methods involve giving CPLEX more information, in
  • rder to
  • reduce the difficulty of solving the IP model
  • reduce the number of times the IP model is solved
slide-23
SLIDE 23

Outline

  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results
slide-24
SLIDE 24
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

CPLEX as MAXSAT Solver

minimaxsat bincd cplex wpm1 Industrial 1637 2251 1779 2152 Crafted 933 534 1019 711 Total 2570 2785 2798 2863 (Number solved out of a total of 3826 non-random instances)

  • MAXSAT can be translated to IP using a standard encoding
  • CPLEX is actually a very good MAXSAT solver, especially
  • n Crafted instances
  • MaxHS uses CPLEX, so can we further exploit CPLEX?
slide-25
SLIDE 25
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

CPLEX as MAXSAT Solver

minimaxsat bincd cplex wpm1 Industrial 1637 2251 1779 2152 Crafted 933 534 1019 711 Total 2570 2785 2798 2863 (Number solved out of a total of 3826 non-random instances)

  • MAXSAT can be translated to IP using a standard encoding
  • CPLEX is actually a very good MAXSAT solver, especially
  • n Crafted instances
  • MaxHS uses CPLEX, so can we further exploit CPLEX?
slide-26
SLIDE 26
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

SAT Model with Equivalences

  • In the MaxHS approach, setting a relaxation variable bi to

true represents falsifying Ci

  • However, this relationship is not fully captured by the SAT

model

  • We modify the SAT model Fb by adding equivalence

clauses that enforce bi ≡ ¯ Ci Fb

eq = Fb

∪ Equivalence Clauses (¬x ∨ z ∨ b1) (¬b1 ∨ x), (¬b1 ∨ ¬z) (x ∨ b2) (¬b2 ∨ ¬x) (¬x ∨ b3) (¬b3 ∨ x) (y ∨ ¬z ∨ b4) (¬b4 ∨ ¬y), (¬b4 ∨ z) (¬y ∨ b5) (¬b5 ∨ y) (x ∨ y ∨ b6) (¬b6 ∨ ¬x), (¬b6 ∨ ¬y)

slide-27
SLIDE 27
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

SAT Model with Equivalences

  • In the MaxHS approach, setting a relaxation variable bi to

true represents falsifying Ci

  • However, this relationship is not fully captured by the SAT

model

  • We modify the SAT model Fb by adding equivalence

clauses that enforce bi ≡ ¯ Ci Fb

eq = Fb

∪ Equivalence Clauses (¬x ∨ z ∨ b1) (¬b1 ∨ x), (¬b1 ∨ ¬z) (x ∨ b2) (¬b2 ∨ ¬x) (¬x ∨ b3) (¬b3 ∨ x) (y ∨ ¬z ∨ b4) (¬b4 ∨ ¬y), (¬b4 ∨ z) (¬y ∨ b5) (¬b5 ∨ y) (x ∨ y ∨ b6) (¬b6 ∨ ¬x), (¬b6 ∨ ¬y)

slide-28
SLIDE 28
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Non-Core Constraints

  • Now, the b-variables appear both positively and negatively

in the SAT model

  • Hence, propagating bi = true can contribute to a

contradiction

  • Conflict clauses returned by the SAT solver can now

contain both positive and negative b-literals

slide-29
SLIDE 29
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Non-Core Constraints

  • E.g., (b1 ∨ b2 ∨ ¬b3)
  • This clauses says that either C1 or C2 must be falsified OR

C3 must be truthified, in any MAXSAT solution

  • These clauses no longer represents cores, but can still be

added to the IP model to guide CPLEX

  • CPLEX no longer solves a pure hitting set problem
slide-30
SLIDE 30
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Non-Core Constraints

  • The non-core constraints also capture the previously

defined Realizability condition on the hitting sets [Davies and Bacchus, CP-11]

  • Mutual falsifiability:
  • Clauses with clashing literals can not be falsified at the

same time e.g., (¬x ∨ z ∨ b1) and (x ∨ y ∨ b6)

  • The equivalence clauses (¬b1 ∨ x), (¬b6 ∨ ¬x) allow us

to derive the non-core constraint (¬b1 ∨ ¬b6) to enforce this condition

  • Compatibility with hard(F): automatically checks that

falsifying the clauses in the hitting set is compatible with satisfying the hard clauses

slide-31
SLIDE 31
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Seeding

  • In MaxHS, CPLEX starts with no constraints, and then

receives cores only one at time

  • We can give CPLEX more information to begin with, using

the technique of seeding

  • Seeding involves deriving initial constraints for CPLEX
  • We propose 3 different seeding techniques
slide-32
SLIDE 32
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Eq-Seeding

  • Many MAXSAT instances contain unit soft clauses
  • Ci = (x) means bi ≡ ¬x
  • Given these equivalencies, check if any clauses of Fb can

be rewritten as clauses over only b-literals

  • E.g., given

C2 = (x ∨ b2) → ¬b2 ≡ x C5 = (¬y ∨ b5) → b5 ≡ y from (x ∨ y ∨ b6) we obtain (¬b2 ∨ b5 ∨ b6)

  • Such clauses can be added to CPLEX initially
slide-33
SLIDE 33
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Implication Seeding

  • Given the equivalence theory Fb

eq we can unit propagate

each b-literal (probing)

  • For each bi (and ¬bi) we collect the set of b-literals it

implies, {b1

i , . . . , bk i }

  • This represents k binary clauses
  • We can add a single linear constraint to CPLEX:

−k ∗ bi + b1

i + · · · + bk i ≥ 0

slide-34
SLIDE 34
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Reverse Implication Seeding

  • During Implication Seeding, when we unit propagate each

b-literal we also find implied original literals e.g., b1 → x, b2 → y

  • Unlike in Eq-Seeding, these relationships are not

equivalences

  • However, we can replace x and y in a clause

(¬x, ¬y) ∈ Fb to obtain a b-variable clause (¬b1, ¬b2)

slide-35
SLIDE 35
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Other Methods

  • We improve the information given to CPLEX via two

additional methods

  • 1. Strengthen the constraints: reduce the conflict clauses to

be minimal using a greedy MUS algorithm

  • 2. More initial constraints for CPLEX: greedily compute a set
  • f disjoint cores
  • See the paper for more details
slide-36
SLIDE 36

Outline

  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results
slide-37
SLIDE 37
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Experimental Setup

  • All crafted and industrial instances from the previous seven

MAXSAT Evaluations, with duplicates removed

  • We removed 17 families that we felt are better classified as
  • random. This leaves 3826 instances out of 4502.
  • 2.1 GHz CPUs, 2.5 GB, 1200 sec. timeout
  • Note that the previous two MAXSAT Evaluations were

limited to 0.5GB machines

slide-38
SLIDE 38
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Overall Results

MaxHS+ wpm1 cplex bincd minimaxsat MaxHS-Orig wpm2 wbo sat4j akmaxsat CPU Sec.

250 500 750 1000 1250 Number of non-random problems solved 1750 2000 2250 2500 2750 3000

slide-39
SLIDE 39
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Industrial Instances

bincd MaxHS+ wpm1 wpm2 MaxHS-Orig wbo cplex sat4j minimaxsat akmaxsat CPU Sec. 250 500 750 1000 1250 Number of industrial problems solved 1000 1250 1500 1750 2000 2250

slide-40
SLIDE 40
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Crafted Instances

cplex minimaxsat akmaxsat MaxHS+ wpm1 MaxHS-Orig wpm2 bincd wbo sat4j CPU Sec. 250 500 750 1000 1250 Number of non-Random Crafted problems solved 200 400 600 800 1000

slide-41
SLIDE 41
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Comparison of Our New Methods

MaxHS-Orig +min +noncore Imp-Seeding Imp+Rev-Seeding MaxHS+ (Eq-Seeding) CPU Sec. 250 500 750 1000 1250 All non-random problems solved 2400 2500 2600 2700 2800 2900 3000

slide-42
SLIDE 42
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Divergence of Performance

MaxHS+ wpm1 cplex bincd minimaxsat MaxHS+ 399 439 325 584 wpm1 292 508 324 756 cplex 303 449 546 529 bincd 143 232 502 566 minimaxsat 187 457 289 421

  • Entry (i, j) in the table shows the number of problems

solved by i in 600 sec. that j failed to solve within twice as much time

  • Each of the top 5 solvers outperforms the others on a

non-trivial number of instances

  • Indicates that each of these solvers embeds useful ideas
slide-43
SLIDE 43
  • 1. Background
  • 2. The MaxHS Approach
  • 3. Exploiting CPLEX
  • 4. Empirical Results

Conclusion

  • The basic approach of MaxHS involves splitting the

problem between two solvers, a SAT solver and a MIPS solver

  • The approach is very flexible and in this paper we have

exploited some of this flexibility to split the task between the two solvers in a different way

  • Using approximations to avoid solving the IP model to
  • ptimality yields even better performance [to appear,

CP-2013]