the evergreen project: how to learn from mistakes caused by blurry vision in max-csp solving

74
PhD March 2007 1 The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in MAX-CSP Solving Karl J. Lieberherr Northeastern University Boston joint work with Ahmed Abdelmeged, Christine Hang and Daniel Rineha

Upload: marlee

Post on 05-Jan-2016

21 views

Category:

Documents


0 download

DESCRIPTION

The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in MAX-CSP Solving. Karl J. Lieberherr Northeastern University Boston. joint work with Ahmed Abdelmeged, Christine Hang and Daniel Rinehart. Where we are. Introduction Look-forward Look-backward Packed truth tables - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 1

The Evergreen Project:How To Learn From Mistakes Caused by Blurry Vision in

MAX-CSP Solving

Karl J. Lieberherr

Northeastern University

Boston

joint work with Ahmed Abdelmeged, Christine Hang and Daniel Rinehart

Page 2: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 2

Where we are

• Introduction

• Look-forward

• Look-backward

• Packed truth tables

• SPOT: how to use the look-ahead polynomials (look-forward) together with superresolution (look-backward).

Page 3: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 3

Problem Snapshot• SAT: classic problem in complexity theory• SAT & MAX-SAT Solvers: working on CNFs (a

multi-set of disjunctions).

• CSP: constraint satisfaction problem– Each constraint uses a Boolean relation.– e.g. a Boolean relation 1in3(x y z) is satisfied iff

exactly one of its parameters is true.

• CSP & MAX-CSP Solvers: working on CSP instances (a multi-set of constraints).

Page 4: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 4

Introduction

• Boolean MAX-CSP(G) for rank d, G = set of relations of rank d– Input

• Input = Bag of Constraint• Constraint = Relation + Set of Variable• Relation = int. // Relation number < 2 ^ (2 ^ d) in G• Variable = int

– Output• (0,1) assignment to variables which maximizes the number of

satisfied constraints.

• Example Input: G = {22} of rank 3– 22:1 2 3 0 – 22:1 2 4 0 – 22:1 3 4 0 1in3 has number 22

M = {1 !2 !3 !4} satisfies all

Page 5: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 5

Variation

MAX-CSP(G,f): Given a MAX-CSP(G) instance expressed in n variables

which may assume only the values 0 or 1, find an assignment to the n variables which satisfies at least the fraction f of the constraints.

Example: G = {22} of rank 3MAX-CSP({22},f):

22:1 2 3 0 22:1 2 4 0 22:1 3 4 022: 2 3 4 0

Page 6: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 6

Our Approach

• Superresolution & P-Optimality Based MAX-CSP Solver

• Highlights– Look Forward (in Abstract Representation)– Look Backward (in Transition System)– Packed Truth Tables (in Intermediate Representation)

Page 7: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 7

Where we are

• Introduction

• Look-forward

• Look-backward

• Packed truth tables

• SPOT: how to use the look-ahead polynomials together with superresolution.

Page 8: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 8

Look Forward

• Why?– To make informed decisions

• How?– Abstract representation based on look-ahead

polynomials

Page 9: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 9

Look-ahead Polynomial(Intuition)

• The look-ahead polynomial computes the expected fraction of satisfied constraints among all random assignments that are produced with bias p.

Page 10: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 10

Consider an instance: 40 variables,1000 constraints (1in3)

1, … ,40

22: 6 7 9 0

22: 12 27 38 0

Abstract representation:reduce the instance tolook-ahead poly. 3p(1-p)2

Page 11: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 11

1in3

0

0.1

0.2

0.3

0.4

0.5

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

Coin bias (Probability of setting a variable to true)

Fra

ctio

n o

f co

nst

rain

ts t

hat

ar

e g

uar

ante

ed t

o b

e sa

tisf

ied

3p(1-p)2 for MAX-CSP({22})

Page 12: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 12

Look-ahead Polynomial(Definition)

• F is a MAX-CSP(G) instance.

• N is an arbitrary assignment.

• The look-ahead polynomial laF,N(p) computes the expected fraction of satisfied constraints of F when each variable in N is flipped with probability p.

Page 13: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 13

The general case MAX-CSP(G)

G = {R1, … }, tR(F) = fraction of constraints in F that use R.

x = p

Page 14: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 14

Page 15: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 15

Look-ahead Polynomial in Action

• Focus on purely mathematical question first

• Algorithmic solution will follow

• Mathematical question: Given a MAX-CSP(G) instance. For which fractions f is there always an assignment satisfying fraction f of the constraints? In which constraint systems is it impossible to satisfy many constraints?

Page 16: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 16

Remember?

MAX-CSP(G,f): Given a MAX-CSP(G) instance expressed in n variables

which may assume only the values 0 or 1, find an assignment to the n variables which satisfies at least the fraction f of the constraints.

Example: G = {22} of rank 3MAX-CSP({22},f):

22:1 2 3 0 22:1 2 4 0 22:1 3 4 022: 2 3 4 0

Page 17: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 17

Simple example

MAX-CSP({22},f):

For f <= u: problem has always a solutionFor f = u + : problem has not always a solution,

u critical transition point

always (fluid)

not always (solid)

Page 18: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 18

The Magic Number

• u = 4/9

Page 19: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 19

1in3

0

0.1

0.2

0.3

0.4

0.5

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

Coin bias (Probability of setting a variable to true)

Fra

ctio

n o

f co

nst

rain

ts t

hat

ar

e g

uar

ante

ed t

o b

e sa

tisf

ied

3p(1-p)2 for MAX-CSP({22})

Page 20: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 20

Produce the Magic Number

• Use an optimally biased coin– 1/3 in this case

• In general: min max problem

Page 21: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 21

General Dichotomy Theorem

MAX-CSP(G,f): For each finite set G of relationsthere exists an algebraic number tG

For f <= tG: MAX-CSP(G,f) has polynomial solutionFor f = tG+ : MAX-CSP(G,f) is NP-complete,

tG critical transition point

easy (fluid)

hard (solid)

due to Lieberherr/Specker

polynomial solution:Use optimally biased coin.Derandomize.P-Optimal.

Page 22: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 22

Observations

• The look-ahead polynomial look-forward approach has not been used in state-of-the-art MAX-SAT and Boolean MAX-CSP solvers.

• Often a fair coin is used. The optimally biased coin is often significantly better.

Page 23: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 23

Page 24: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 24N0 ={!v1,!v2,!v3,!v4}

Page 25: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 25N0‘ ={v1,!v2,!v3,!v4}

Page 26: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 26

SAT Rank 2 example9 constraints

14 : 1 2 014 :       3 4 014 :           5 6 0  7 : 1     3            0 7 : 1         5      0 7 :       3   5      0 7 :   2     4          0 7 :   2         6   0 7 :         4   6   0

14: 1 2 = or(1 2) 7: 1 3 = or(!1 !3)

What is the look-aheadpolynomial?

Page 27: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 27appmean = lookahead is an approximation of the true mean

Blurry vision

What do we learn from the abstract representation?• set 1/3 of the variables to true (maximize).• the best assignment will satisfy at least 7/9 constraints.• very useful but the vision is blurred in the “middle”.

excellent peripheral vision

Page 28: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 28

Where we are

• Introduction

• Look-forward

• Look-back

• Packed truth tables

• SPOT: how to use the look-ahead polynomials

Page 29: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 29

Look Backward

• Why?– to avoid past mistakes

• How?– Transition system based on superresolution

Page 30: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 30

Observation

• Optimally biased coin technique based on look-ahead polynomials is “best-possible”.

• If we could improve it by a trillionth in polynomial time, then P=NP.

• We improve it now by learning new constraints that will influence the polynomial.

Page 31: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 31

Clause Learning• Let’s go beyond what an optimally biased

coin guarantees!• Goal: satisfy the maximum number of

constraints. • Approach: Superresolution.

– When to apply: number of constraints guaranteed to be unsatisfied doesn’t decrease

• A mistake is made.

– Who to blame: the decision literals• They are the culprits.

– How to penalize: add the disjunctions of their negations as a superresolvent

• The gang of culprits is watched.

Page 32: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 32

Transition Rules

• Semi-Superresolution (SSR):

NewSR = V (¬k), where k Md

M || F || SR || N → M || F || SR, NewSR || N

• if unsat(M,SR) > 0 or unsat(M,F) ≥ unsat(N,F).

Page 33: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 33

Algorithm plan

• start with an arbitrary assignment N.

• while (proof incomplete) {– try to improve N by creating new assignment

from scratch using optimally biased coin to flip the assignments;

• success: Update N;• failure: learn a new constraint that will prevent

same mistake and will “improve” the polynomial. }

Page 34: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 34

Page 35: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 35

Page 36: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 36

Properties of TS

• TS finds the maximum in a finite number of steps.

• It creates a proof that we indeed found the maximum.

Page 37: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 37

Optimized Semi-Superresolution

• Not all decision literals may be responsible for the “mistake”.

• Want to find a minimal superresolvent so that deleting one literal would destroy the superresolvent property.

• Can be implemented by a traversal back the implication graph that is built as part of unit propagation.

Page 38: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 38

Where we are

• Introduction

• Look-forward

• Look-back

• Packed Truth Tables

• SPOT: how to use the look-ahead polynomials

Page 39: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 39

Requirements for Packed Truth Tables

• The look-ahead polynomial can be computed efficiently. Requires efficient truth table analysis.

• Reduction of an instance must be efficient.

• Efficiently compute the forced variables.

• Each relation has a unique representation.

Page 40: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 40

Packed Truth Tables

22 254

Page 41: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 41

RelationI: implemented by bitwise operations

int isForced(int variablePosition)boolean isIrrelevant(int variablePosition)int nMap(int variablePosition)int numberOfRelevantVariables()int q(int s) int reduce(int variablePosition, int value)int rename(int permutationSemantics,

int... permutation)

Page 42: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 42

Where we are

• Introduction

• Look-forward

• Look-back

• Packed truth tables

• SPOT: how to use the look-ahead polynomials with superresolution

Page 43: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 43

Using the look-ahead polynomials

• Value Ordering– Decide: how to set the variable

• Variable Ordering– Which variable to set next

Page 44: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 44

There is hope that the look-ahead polynomials are useful

Page 45: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 45

What is new?

• New: Packed Truth Tables

• New: Superresolution for MAX-CSP

• New: Integration of look-ahead polynomials with superresolution

• Old: Superresolution for SAT (1977)

• Old: Look-ahead polynomials (1983)

Page 46: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 46

Future work

• Exploring best combination of look-forward and look-back techniques.

• Find all maximum-assignments or estimate their number.

• Robustness of maximum assignments.

• Are our MAX-CSP solvers useful for reasoning about biological pathways?

Page 47: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 47

Conclusions

• Presented SPOT, a family of MAX-CSP solvers based on look-ahead polynomials and non-chronological backtracking.

• SPOT has a desirable property: P-optimal.

• Preliminary experimental results are encouraging.

Page 48: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 48

end for now

Page 49: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 49

Rank 2 example

• 14 : 1 2 014 :       3 4 014 :           5 6 0  7 : 1     3            0 7 : 1         5        0 7 :       3   5        0 7 :   2     4          0 7 :   2         6      0 7 :         4   6      0

Page 50: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 50appmean is an approximation of the true mean

Page 51: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 51

Page 52: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 52

Transition Manager

Page 53: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 53

Page 54: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 54

MAX-CSP:Superresolution and P-Optimality

Karl J. Lieberherr

Northeastern University

Boston

joint work with Ahmed Abdelmeged, Christine Hang and Daniel Rinehart

Page 55: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 55

Page 56: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 56

Binomial Distribution

Page 57: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 57

Page 58: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 58

Example

x1 + x2 + x3 = 1x1 + x2 + + x4 = 1 can satisfy 6/7x1 + x3 + x4 = 1 x1 + x3 + x4 = 1x1 + x2 + + x5 = 1x1 + x3 + x5 = 1 x2 + x3 + x5 =1

Page 59: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 59

1in3

0

0.1

0.2

0.3

0.4

0.5

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

Coin bias (Probability of setting a variable to true)

Fra

ctio

n o

f co

nst

rain

ts t

hat

ar

e g

uar

ante

ed t

o b

e sa

tisf

ied

maximize 3x(1-x)2

Page 60: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 60

Organization of Solver

look back look forward

Page 61: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 61

Transition Rules

• Unit-Propagation (UP):

M || F || SR || N → Mk || F || SR || N

• if k is undefined in M, and• unsat (M¬k,SR) > 0 or unsat(M¬k,F) ≥ unsat(N,F).

Page 62: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 62

Transition Rules

• Decide (D):

M || F || SR || N → Mkd || F || SR || N

• if k is undefined in M, and• v(k) occurs in some constraint of F.

Page 63: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 63

Transition Rules

• Update:

M || F || SR || N → M || F || SR || M

• if M is complete, and• unsat(M,F) < unsat(N,F).

Page 64: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 64

Transition Rules

• Restart:

M || F || SR || N → { } || F || SR || N

Page 65: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 65

Transition Rules

• Finale:

M || F || SR || N → M || F || SR || N

• if Φ SR or unsat(N,F) = 0.

Page 66: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 66

Transition Rules

• Semi-Superresolution (SSR):

NewSR = V (¬k), where k Md

M || F || SR || N → M || F || SR, NewSR || N

• if unsat(M,SR) > 0 or unsat(M,F) ≥ unsat(N,F).

Page 67: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 67

Transition Rules

Page 68: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 68

Transition Rules (cont.)

Page 69: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 69

Transition Rules

• Semi-Superresolution (SSR):

NewSR = V (¬k), where k Md

M || F || SR || N → M || F || SR, NewSR || N

• if unsat(M,SR) > 0 or unsat(M,F) ≥ unsat(N,F).

Page 70: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 70

Transition Rules

• Semi-Superresolution (SSR):

NewSR = V (¬k), where k Md

M || F || SR || N → M || F || SR, NewSR || N

• if unsat(M,SR) > 0 or unsat(M,F) ≥ unsat(N,F).

Page 71: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 71

Transition Rules

• Semi-Superresolution (SSR):

NewSR = V (¬k), where kєM’ subset Md

M || F || SR || N → M || F || SR, NewSR || N

• if mistake(M) and UP*(reduce(F,A(NewSR)))

Page 72: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 72

Our Approach

• Superresolution & P-Optimality Based MAX-CSP Solver

• Highlights– Optimally Biased Coin (in Abstract Representation)– Clause Learning (in Transition System)– Bitwise Relation Reduction (in Intermediate

Representation)

Page 73: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 73

Clause Learning• Let’s go beyond what an optimally biased

coin guarantees!• Goal: satisfy the maximum number of

constraints. • Approach: Superresolution.

– When to apply: number of constraints guaranteed to be unsatisfied doesn’t decrease

• A mistake is made.

– Who to blame: the decision literals• They are the culprits.

– How to penalize: add the disjunctions of their negations as a superresolvent

• The gang of culprits is watched.

Page 74: The Evergreen Project: How To Learn From Mistakes Caused by Blurry Vision in  MAX-CSP Solving

PhD March 2007 74

Sudoku