takayuki sakai (kyoto university) joint work with kazuhisa seto(seikeiuniversity) · 2014. 7....

40
Takayuki Sakai (Kyoto University) Joint work with Kazuhisa Seto (Seikei University) SuguruTamaki (Kyoto University) 1

Upload: others

Post on 27-Jan-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

  • Takayuki Sakai (Kyoto University)

    Joint work with

    Kazuhisa Seto (Seikei University)

    Suguru Tamaki (Kyoto University) 1

  • � Theoretical Aspects

    � Worst case upper bound

    � Moderately exponential time algorithm

    � Practical Aspects (not our scope)

    � Some branching rules (width reduction & greedy

    restriction) might be worth implementing

    � Sparse instances might be easy

    2

  • � Introduction

    � Previous and our results

    � Motivation for sparse instances

    � Previous Exponential Time Algorithms

    � Memorization

    � Branch and Bound

    � Our Algorithm and its Analysis

    � Width reduction

    � Greedy restriction

    � Summary

    3

  • � Input:a set of clauses with weights

    � Ci:conjunction of literals,wi:positive value

    � Output:Maximum total weight of clauses satisfied

    � Example

    ( ) ( ) ( ) ( ) ( ){ }3,xx,2,xx,5,xx,4,xx,1,xx 3121212121 ∨∨∨∨∨4

  • total

    weight

    0 0 0 0 1 1 1 0 11

    0 0 1 0 1 1 1 1 14 (max)

    0 1 0 1 0 1 1 0 8

    0 1 1 1 0 1 1 1 11

    1 0 0 1 1 0 1 1 10

    1 0 1 1 1 0 1 1 10

    1 1 0 1 1 1 0 1 13

    1 1 1 1 1 1 0 1 13

    3x1x 2x 3121212121 xxxxxxxxxx ∨∨∨∨∨

    ( ) ( ) ( ) ( ) ( ){ }3,xx,2,xx,5,xx,4,xx,1,xx 3121212121 ∨∨∨∨∨

    5

  • Facts

    - Max SAT is NP-hard

    - Exhaustive Search:

    Question

    - Moderately exponential time algorithm?

    6

  • Running Time Problem Space Reference

    Max SAT Poly. [BG12]

    Max 2-SAT Poly. [GH03]

    Max SAT Poly. [BR99]

    Max 2-SAT Poly. [GS12]

    Max 2-CSP Poly. [GS12]

    Max SAT Poly. [CK04]

    Max 2-SAT Exp. [Koi06][Wil05]

    ( )k4414.02O( )lO 1000.02( )lO 1450.02( )m1583.02O( )m1901.02O( )m4057.02O( )n7909.02O

    • k: objective value

    • l: length of instance

    • m: #constraints

    • n: # variables

    7

  • Weight of

    clause

    Running Time Space det./rand.

    type

    Dantsin and

    Wolpert 2006

    1 Exp. deterministicmemorization

    Kulikov and

    Kutzkov 2007

    unbounded Poly. deterministicbranch & bound

    Sparse instance: #clauses = cn

    Our Result 1 unbounded Poly. deterministicbranch & bound

    Our Result 2 unbounded Poly. randomizedbranch & bound

    8

    ( )( )( )nclogc11 32O Ω−( )( )( )nclogc11 222O Ω−

    ( )( )( )( )n211 cO2O Ω−( )( )( )nclogc112O Ω−

  • � Best upper bounds for Max k-SAT (any instances)

    � Max 2-SAT: [Williams 2004]� Max 3-SAT:

    (cf. k-SAT : )

    � Strong Exponential Time Hypothesis [CIP09]“SAT (without restriction on clause length) cannot be solved

    in time for constant ”

    … and Max SAT is at least as difficult as SAT

    ( ) 0 2 1 >− εε n

    9

  • If we consider linear size instances (#caluses = cn),then

    Our Goal

    Design an exponentially faster algorithm for linear

    size instances of Max SAT

    10

  • � Introduction

    � Previous and our results

    � Motivation for sparse instances

    � Previous Exponential Time Algorithms

    � Memorization

    � Branch and Bound

    � Our Algorithm and its Analysis

    � Width reduction

    � Greedy restriction

    � Summary

    11

  • � Complete Algorithm

    � Branch and bound

    � Memorization (often exponential space)

    � Split and list (often exponential space)

    � Reduction to SAT (#variables increases, e.g. n log n)

    � …

    � Incomplete Algorithm

    � Branch and bound with heuristics

    � Local search

    � …

    12

  • Weight of

    clause

    Running Time Space det./rand.

    type

    Dantsin and

    Wolpert 2006

    1 Exp. deterministicmemorization

    Kulikov and

    Kutzkov 2007

    unbounded Poly. deterministicbranch & bound

    Sparse instance: #clauses = cn

    Our Result 1 unbounded Poly. deterministicbranch & bound

    Our Result 2 unbounded Poly. randomizedbranch & bound

    13

    ( )( )( )nclogc11 32O Ω−( )( )( )nclogc11 222O Ω−

    ( )( )( )( )n211 cO2O Ω−( )( )( )nclogc112O Ω−

  • � Make many small instances by partial assignments

    � Find each small instance and its optimal value from

    prepared database (memorization)

    � Running Time = #partial assignments + preparing

    database

  • Weight of

    clause

    Running Time Space det./rand.

    type

    Dantsin and

    Wolpert 2006

    1 Exp. deterministicmemorization

    Kulikov and

    Kutzkov 2007

    unbounded Poly. deterministicbranch & bound

    Sparse instance: #clauses = cn

    Our Result 1 unbounded Poly. deterministicbranch & bound

    Our Result 2 unbounded Poly. randomizedbranch & bound

    15

    ( )( )( )nclogc11 32O Ω−( )( )( )nclogc11 222O Ω−

    ( )( )( )( )n211 cO2O Ω−( )( )( )nclogc112O Ω−

  • Idea #1 (high frequency)If there is a literal x occurring at least d times in the instance

    (d=d(c): some parameter)

    ⇒ Recursively solve two cases x=0 and x=1(This case: we can reduce the size of instance efficiently)

    Branch and Bound Algorithm based on two ideas:

    16

  • Idea #2 (pruning)Otherwise, consider Max of #satisfiable clauses including x1

    is always worse than

    We only have to examine and

    (This case: we can reduce search space efficiently)

    ( ) ( ) ( ) ( ) ( ) ( )2132121321321321 xx,xxx,xx,xxx,xxx,xxx ∨∨∨∨∨∨∨∨∨∨

    1/0x,0x0x1x1x

    321

    21===

    == ⇒ OPT is 6 when⇒ OPT is 5 when

    ( ) ( )1,0x,x 21 =( ) ( )0,0x,x1x 211 ==

    17

    Branch and Bound Algorithm based on two ideas:

    ( ) ( )1,1, 21 =xx

  • � Introduction

    � Previous and our results

    � Motivation for sparse instances

    � Previous Exponential Time Algorithms

    � Memorization

    � Branch and Bound

    � Our Algorithm and its Analysis

    � Width reduction

    � Greedy restriction

    � Summary

    18

  • Idea #1 (width reduction)If there is a clause C of width > k in the instance

    (k = k (c): some parameter)

    ⇒Apply clause-shortening algorithm

    (producing two sub-problems)

    Branch and Bound Algorithm based on two ideas:

    19

    Idea #2 (greedy restriction)Otherwise, pick a variable x that occurs most frequently⇒ Recursively solve two cases x=0 and x=1

  • � Width reduction

    � Max SAT instance ⇒ a set of Max k-SAT insntances

    � Greedy restriction

    � Max k-SAT is a special case of Max Formula SAT

    � Greedy restriction algorithm for (Max) formula SAT

    20

  • � Key Idea : reduce a given Max SAT instance to

    the union of Max-k-SAT instances.

    � Using clause shortening algorithm!

    � Branch #1 : Pick up the first k literals and remove

    other variables

    � Branch #2 : Set the first k literals to be false.

    21

  • • OPT of original instance = max of OPTs of two new instances

    22

    Branch #1 : Pick up the first k literals and remove

    other variables

    Branch #2 : Set the first k literals to be false.

  • � Each Branch#1 reduce one clause of width > k

    � After cn times, all clauses have length at most k

    � Each Branch#2 reduce k variables

    � After n/2k times, the number of variables is at most n/2 23

    Branch #1 : Pick up the first k literals and remove

    other variables

    Branch #2 : Set the first k literals to be false.

  • k=2 : when we reduce original instance to Max 2-SAT instances

    Input

    Branch 1 Branch 2

    x1=0, x2 =1

    24

  • � Width reduction

    � Max SAT instance ⇒ a set of Max k-SAT insntances

    � Greedy restriction

    � Max k-SAT is a special case of Max Formula SAT

    � Greedy restriction algorithm for (Max) formula SAT

    25

  • � We need some definitions

    � De Morgan formula

    � formula SAT

    � Max formula SAT

    26

  • � Binary Tree

    � Internal node : AND, OR

    � NOT appears in only leaves

    � Size = #leaves1x 2x

    2x 3x

    ∨∨

    ∧∧

    3x

    #variables = 3

    Size = 5

    27

  • Input: De Morgan formula

    Output: yes if formula is satisfiable

    1x 2x

    2x 3x

    ∨∨

    ∧∧

    2x

    28

  • � Max De Morgan formula SAT

    � Input:a set of weighted De Morgan formula

    � Output:Maximum total weight of constraints satisfied

    29

  • � Max De Morgan formula SAT

    � Input:a set of weighted De Morgan formula

    � Output:Maximum total weight of constraints satisfied

    � Max k-SAT is a special case of Max formula SAT

    � Each De Morgan formula has size at most k

    � Each De Morgan formula has only OR label

    30

  • � Width reduction

    � Max SAT instance ⇒ a set of Max k-SAT insntances

    � Greedy restriction

    � Max k-SAT is a special case of Max Formula SAT

    � Greedy restriction algorithm for (Max) formula SAT

    31

  • � Greedy Restriction and Simplification

    � Greedy Restriction = Assign 0/1 to x which occurs most frequently

    � Simplification= Simplify the formula via the following rules

    (1) 1∧ψ → ψ, 0∨ψ → ψ(2) 0∧ψ → 0, 1∨ψ →1(3) z∧ψ → z∧ψ[z =1] (4) z∨ψ → z∨ψ[z = 0](ψ : any subformula of φ)

    32

  • 1x 2x

    2x 3x

    ∨∨

    ∧∧

    3x

    (3)

    0

    1x 2x

    2x

    ∨∨

    ∧∧

    3x

    (2)

    1x 2x 2x

    ∨ ∧∧

    3x

    (1) 1∧ψ → ψ, 0∨ψ → ψ(2) 0∧ψ → 0, 1∨ψ →1(3) z∧ψ → z∧ψ[z =1] (4) z∨ψ → z∨ψ[z = 0](ψ : any subformula of φ)

    33

  • (1) 1∧ψ → ψ, 0∨ψ → ψ(2) 0∧ψ → 0, 1∨ψ →1(3) z∧ψ → z∧ψ[z =1] (4) z∨ψ → z∨ψ[z = 0](ψ : any subformula of φ)

    1x 2x 2x

    ∨ ∧∧

    3x

    x2=0

    x2=1

    001x

    ∨ ∧∧

    3x

    111x

    ∨ ∧∧

    3x

    For each formula, we use simplification rules.

    0

    3x

    34

  • Corollary

    Max k-SAT with cn clauses (kcn literals) can be solved by deterministic polynomial space algorithm in time

    Lemma

    Max formula SAT with cn size can be solved by deterministic polynomial space algorithm in time

    35

    ( )( )( )nc11 22O Ω−

    ( )( )( )nck11 222O Ω−

  • � Running time analysis of combining width reduction and k-SAT

    algorithm was given by [Sch05, CIP06]

    � Basically we replace k-SAT algorithm by Max k-SAT algorithm

    Our Result 1

    Max SAT with cn clauses can be solved by deterministic polynomial space algorithm in time

    36

    ( )( )( )nclogc11 222O Ω−

  • � Introduction

    � Previous and our results

    � Motivation for sparse instances

    � Previous Exponential Time Algorithms

    � Memorization

    � Branch and Bound

    � Our Algorithm and its Analysis

    � Width reduction

    � Greedy restriction

    � Summary

    37

  • Weight of

    clause

    Running Time Space det./rand.

    type

    Dantsin and

    Wolpert 2006

    1 Exp. deterministicmemorization

    Kulikov and

    Kutzkov 2007

    unbounded Poly. deterministicbranch & bound

    Sparse instance: #clauses = cn

    Our Result 1 unbounded Poly. deterministicbranch & bound

    Our Result 2 unbounded Poly. randomizedbranch & bound

    38

    ( )( )( )nclogc11 32O Ω−( )( )( )nclogc11 222O Ω−

    ( )( )( )( )n211 cO2O Ω−( )( )( )nclogc112O Ω−

  • � Our randomized algorithm uses random restriction

    instead of greedy restriction

    � Our algorithms can count the number of optimal

    assignments

    � Our algorithms can handle hard constraints (partial Max

    SAT)

    39

  • � Improve the applicable size ?

    � Now, applicable for size in time

    � De Morgan Formula SAT Algorithm is applicable to

    ▪ Deterministic: size▪ Chen, Kabanets, Kolokolova, Shaltiel, Zuckerman (ECCC 2012)

    ▪ Randomized: size▪ Komargodski, Raz, Tal (FOCS 2013)

    � Fast Max 2-SAT Algorithm with Polynomial Space

    � Non-Trivial Algorithm for Max 3-SAT

    Thank you for your attention! 40