189
Combinatorial Optimization for Graphical Models Rina Dechter nald Bren School of Computer Science niversity of California, Irvine, USA Radu Marinescu Cork Constraint Computation Cent University College Cork, Irelan Simon de Givry & Thomas Schiex Dept. de Mathématique et Informatique Appliquées INRA, Toulouse, France

Combinatorial Optimization for Graphical Models

  • Upload
    ipo

  • View
    31

  • Download
    2

Embed Size (px)

DESCRIPTION

Combinatorial Optimization for Graphical Models. Rina Dechter Donald Bren School of Computer Science University of California, Irvine, USA. Radu Marinescu Cork Constraint Computation Centre University College Cork, Ireland. Simon de Givry & Thomas Schiex - PowerPoint PPT Presentation

Citation preview

Page 1: Combinatorial Optimization for Graphical Models

Combinatorial Optimization for Graphical Models

Rina DechterDonald Bren School of Computer Science

University of California, Irvine, USA

Radu MarinescuCork Constraint Computation Centre

University College Cork, Ireland

Simon de Givry & Thomas SchiexDept. de Mathématique et Informatique Appliquées

INRA, Toulouse, France

Page 2: Combinatorial Optimization for Graphical Models

2

Outline Introduction

Graphical models Optimization tasks for graphical models Fundamental operations on cost functions

Inference Bucket Elimination, Bucket-Tree and Cluster-Tree Elimination Polynomial classes based on structure

Search (OR) Branch-and-Bound and Best-First Search Local search and Partial search

Lower-bounds and relaxations Bounded inference, local consistency and continuous

relaxations Exploiting problem structure in search

AND/OR search spaces (trees, graphs) Other hybrids of search and inference

Cutset decomposition, boosting search with VE, super-bucket scheme

Software & Applications

Page 3: Combinatorial Optimization for Graphical Models

3

Outline Introduction

Graphical models Optimization tasks for graphical models Solving optimization problems by inference and search Fundamental operations on cost functions

Inference Search (OR) Lower-bounds and relaxations Exploiting problem structure in search Other hybrids of search and inference Software & Applications

Page 4: Combinatorial Optimization for Graphical Models

4

Constraint Optimization Problemsfor Graphical Models

functionscost - },...,{

domains - },...,{

variables- },...,{

:where,, triplea is A

1

1

1

m

n

n

ffF

DDD

XXX

FDXRCOPfinite

A B D Cost1 2 3 31 3 2 22 1 3 02 3 1 03 1 2 53 2 1 0

G

A

B C

D F

m

i i XfXF1

)(

FunctionCost Global

Primal graph =Variables --> nodesFunctions, Constraints - arcs

f(A,B,D) has scope {A,B,D}

F(a,b,c,d,f,g)= f1(a,b,d)+f2(d,f,g)+f3(b,c,f)

Page 5: Combinatorial Optimization for Graphical Models

5

A Bred greenred yellowgreen redgreen yellowyellow greenyellow red

Map coloring

Variables: countries (A B C etc.)

Values: colors (red green blue)

Constraints: etc. ,ED D, AB,A

C

A

B

DE

F

G

Constraint Networks

Constraint graph

A

BD

CG

F

E

Page 6: Combinatorial Optimization for Graphical Models

6

Constrained Optimization

Example: power plant scheduling

)X,...,ost(XTotalFuelC minimize :

)(Power : demandpower time,down-min and up-min ,, :sConstraint

. domain ,Variables

N1

4321

1

Objective

DemandXXXXX

{ON,OFF}},...,X{X

i

n

Page 7: Combinatorial Optimization for Graphical Models

7

Probabilistic Networks

Smoking

BronchitisCancer

X-Ray

Dyspnoea

P(S)

P(B|S)

P(D|C,B)

P(C|S)

P(X|C,S)

P(S,C,B,X,D) = P(S)· P(C|S)· P(B|S)· P(X|C,S)· P(D|C,B)MPE= Find a maximum probability assignment, given evidenceMPE= find argmax P(S)· P(C|S)· P(B|S)· P(X|C,S)· P(D|C,B)

C B D=0 D=1

0 0 0.1 0.9

0 1 0.7 0.3

1 0 0.8 0.2

1 1 0.9 0.1

P(D|C,B)

BN = (X,D,G,P)

Page 8: Combinatorial Optimization for Graphical Models

8

Monitoring Intensive-Care Patients

The “alarm” network - 37 variables, 509 parameters (instead of 237)

PCWP CO

HRBP

HREKG HRSAT

ERRCAUTERHRHISTORY

CATECHOL

SAO2 EXPCO2

ARTCO2

VENTALV

VENTLUNG VENITUBE

DISCONNECT

MINVOLSET

VENTMACHKINKEDTUBEINTUBATIONPULMEMBOLUS

PAP SHUNT

ANAPHYLAXIS

MINOVL

PVSAT

FIO2PRESS

INSUFFANESTHTPR

LVFAILURE

ERRBLOWOUTPUTSTROEVOLUMELVEDVOLUME

HYPOVOLEMIA

CVP

BP

Page 9: Combinatorial Optimization for Graphical Models

9

Influence Diagrams

Test

DrillOil salepolicy

Testresult

Seismicstructure

Oilunderground

Oilproduced

Testcost

Drillcost

Salescost

Oil sales

Marketinformation

Influence diagram ID = (X,D,P,R).

Chance variables: over domains.

Decision variables:

CPT’s for chance variables:

Reward components:

Utility function: iiru },...,{ 1 jrrR

nipaXPP iii ..1),|( mDDD ,...,1

nXXX ,...,1

)()(max)1)1 ,...,(,...,(

xuxPE iixxx nm

Task: find optimal policy:

Page 10: Combinatorial Optimization for Graphical Models

10

A graphical model (X,D,F): X = {X1,…Xn}

variables D = {D1, … Dn} domains F = {f1,…,fr} functions

(constraints, CPTS, CNFs …)

Operators: combination elimination (projection)

Tasks: Belief updating: X-y j Pi

MPE: maxX j Pj

CSP: X j Cj

Max-CSP: minX j Fj

Graphical Models

)( : CAFfi

A

D

BC

E

F

All these tasks are NP-hard exploit problem structure identify special cases approximate

A C F P(F|A,C)

0 0 0 0.140 0 1 0.960 1 0 0.400 1 1 0.601 0 0 0.351 0 1 0.651 1 0 0.721 1 1 0.68

Conditional ProbabilityTable (CPT)

Primal graph(interaction graph)

A C F

red green blueblue red redblue blue green

green red blue

Relation

Page 11: Combinatorial Optimization for Graphical Models

11

Sample Domains for GM Web Pages and Link Analysis Communication Networks (Cell phone Fraud

Detection) Natural Language Processing (e.g. Information

Extraction and Semantic Parsing) Battle-space Awareness Epidemiological Studies Citation Networks Intelligence Analysis (Terrorist Networks) Financial Transactions (Money Laundering) Computational Biology Object Recognition and Scene Analysis

Page 12: Combinatorial Optimization for Graphical Models

12

Types of Constraint Optimization

Valued CSPs, Weighted CSPs, Max-CSPs, Max-SAT

Most Probable Explanation (MPE) Linear Integer Programs

Examples: Problems translated from planning Unit scheduling maintenance Combinatorial auctions Maximum-likelihood haplotypes in linkage

Page 13: Combinatorial Optimization for Graphical Models

13

Outline Introduction

Graphical models Optimization tasks for graphical models Solving optimization problems by inference and search Fundamental operations on cost functions

Inference Search (OR) Lower-bounds and relaxations Exploiting problem structure in search Other hybrids of search and inference Software & Applications

Page 14: Combinatorial Optimization for Graphical Models

14

Graphical Models Reasoning

Search: Conditioning

Inference: Elimination

Complete

IncompleteSimulated Annealing

Gradient Descent

Complete

Incomplete

Adaptive ConsistencyTree Clustering

Dynamic ProgrammingResolution

Local Consistency

Unit Resolution mini-bucket(i)

Time: exp(w*)Space: exp(w*)

Time: exp(n)Space: linear

Hybrids:

Depth-first searchBranch-and-BoundA* search

Page 15: Combinatorial Optimization for Graphical Models

15

Bucket E: E D, E C

Bucket D: D A

Bucket C: C B

Bucket B: B A

Bucket A:

A C1 * w:easyare trees

width-tree width,induced

-*

*

w

))exp(w O(n :Complexity

contradiction

=

D = C

B = A

Bucket Elimination(Variable Elimination)

=

Page 16: Combinatorial Optimization for Graphical Models

16

The Idea of Conditioning

tree dfs of depth in b)

size cutset-cycle in lexponentia a) :complexity Refined

space linear time, lexponentia :Complexity

Page 17: Combinatorial Optimization for Graphical Models

17

Conditioning vs. Elimination

A

G

B

C

E

D

F

Conditioning (search) Elimination (inference)

A=1 A=k…

G

B

C

E

D

F

G

B

C

E

D

F

A

G

B

C

E

D

F

G

B

C

E

D

F

k “sparser” problems 1 “denser” problem

Page 18: Combinatorial Optimization for Graphical Models

18

Outline Introduction

Graphical models Optimization tasks for graphical models Solving optimization problems by inference and search Fundamental operations on cost functions

Inference Search (OR) Lower-bounds and relaxations Exploiting problem structure in search Other hybrids of search and inference Software & Applications

Page 19: Combinatorial Optimization for Graphical Models

Fundamental Operations on Cost Functions

To be completed …

19

Page 20: Combinatorial Optimization for Graphical Models

20

Outline Introduction

Inference Bucket Elimination Bucket-Tree Elimination and Cluster-Tree Elimination Polynomial classes based on structure

Search (OR) Lower-bounds and relaxations Exploiting problem structure in search Other hybrids of search and inference Software & Applications

Page 21: Combinatorial Optimization for Graphical Models

21

Computing the Optimal Cost Solution

0emin

Constraint graph

A

D E

CBB C

ED

Variable Elimination

bcde ,,,min0

F(a,b)+F(a,c)+F(a,d)+F(b,c)+F(b,d)+F(b,e)+F(c,e)OPT =

F(a,c)+F(c,e) +c

min

),,,( ecdahB

F(a,b)+F(b,c)+F(b,d)+F(b,e)b

mind

min F(a,d) +

Page 22: Combinatorial Optimization for Graphical Models

22

Elimination operator

OPT

bucket B:

F(c,a) F(c,e)

F(a,b) F(b,c) F(b,d) F(b,e)

bucket C:

bucket D:

bucket E:

bucket A:

e=0

(a)hE

e)c,d,(a,hB

e)d,(a,hC

Finding

b

min

r

jj

XXXfOPT

n 11

)(min,...,

Algorithm elim-opt (Dechter, 1996)Non-serial Dynamic Programming (Bertele & Briochi, 1973)

B

C

D

E

A

F(a,d)

e)(a,hD

),(),(),(),(),(),(),(min,,,,

ecFebFdbFcbFdaFcaFbaFOPTbcdea

Page 23: Combinatorial Optimization for Graphical Models

23

Generating the Optimal Assignment

C:

E:

F(a,b) F(b,c) F(b,d) F(b,e)B:

D:

A:

F(c,a) F(c,e)

e=0 e)(a,hD

(a)hE

e)c,d,(a,hB

e)d,(a,hC

(a)hE

amin arga' 1.

0e' 2.

(a',d,e')hF(a',d) Cd

min argd' 3.

)',,','(

)',(

ecdah

ecFF(c,a')

B

c

min argc' 4.

F(b,e')F(b,d')

F(b,c')F(a',b)

bmin argb' 5.

)e',d',c',b',(a' Return

F(a,d)

Page 24: Combinatorial Optimization for Graphical Models

24

exp(w*=4)”induced width” (max clique size)

Complexity

Elimination operator

OPT

bucket B:

F(c,a) F(c,e)

F(a,b) F(b,c) F(b,d) F(b,e)

bucket C:

bucket D:

bucket E:

bucket A:

e=0

(a)hE

e)c,d,(a,hB

e)d,(a,hC

b

min

B

C

D

E

A

F(a,d)

e)(a,hD

Algorithm elim-opt (Dechter, 1996)Non-serial Dynamic Programming (Bertele & Briochi, 1973)

),(),(),(),(),(),(),(min,,,,

ecFebFdbFcbFdaFcaFbaFOPTbcdea

Page 25: Combinatorial Optimization for Graphical Models

25

Induced-width

Width along ordering d, w(d): max # of previous neighbors

(parents)

Induced width along ordering d, w*(d): The width in the ordered

induced graph, obtained by connecting “parents” of each node X, recursively from top to bottom

E

D

C

B

A

Page 26: Combinatorial Optimization for Graphical Models

26

Complexity of Bucket Elimination

))((exp ( * dwrOddw ordering alonggraph primal theof width induced the)(*

The effect of the ordering:

4)( 1* dw 2)( 2

* dwconstraint graph

A

D E

CB

B

C

D

E

A

E

D

C

B

A

Finding smallest induced-width is hard!

r = number of functions

Bucket-Elimination is time and space

Page 27: Combinatorial Optimization for Graphical Models

Bucket-Tree Elimination

Describe BTE

27

Page 28: Combinatorial Optimization for Graphical Models

Cluster-Tree Elimination

Describe CTE

28

Page 29: Combinatorial Optimization for Graphical Models

29

Outline Introduction Inference

Search (OR) Branch-and-Bound and Best-First search Branching schemes, variable and value orderings Local search and Partial search

Lower-bounds and relaxations Exploiting problem structure in search Other hybrids of search and inference Software & Applications

Page 30: Combinatorial Optimization for Graphical Models

30

The Search Space

9

1

mini

iX ff

A

E

C

B

F

D

0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1

C

D

F

E

B

A 0 1

Objective function:

A B f1

0 0 20 1 01 0 11 1 4

A C f2

0 0 30 1 01 0 01 1 1

A E f3

0 0 00 1 31 0 21 1 0

A F f4

0 0 20 1 01 0 01 1 2

B C f5

0 0 00 1 11 0 21 1 4

B D f6

0 0 40 1 21 0 11 1 0

B E f7

0 0 30 1 21 0 11 1 0

C D f8

0 0 10 1 41 0 01 1 0

E F f9

0 0 10 1 01 0 01 1 2

Page 31: Combinatorial Optimization for Graphical Models

31

The Search Space

Arc-cost is calculated based on cost components.

0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1

C

D

F

E

B

A 0 1

A B f1

0 0 20 1 01 0 11 1 4

A

E

C

B

F

D

A C f2

0 0 30 1 01 0 01 1 1

A E f3

0 0 00 1 31 0 21 1 0

A F f4

0 0 20 1 01 0 01 1 2

B C f5

0 0 00 1 11 0 21 1 4

B D f6

0 0 40 1 21 0 11 1 0

B E f7

0 0 30 1 21 0 11 1 0

C D f8

0 0 10 1 41 0 01 1 0

E F f9

0 0 10 1 01 0 01 1 2

3 02 23 02 23 02 23 02 2 3 02 23 02 23 02 23 02 2

0 0

3 5 3 5 3 5 3 5 1 3 1 3 1 3 1 3

5 6 4 2 2 4 1 0

3 1

2

5 4

0

1 20 41 20 41 20 41 20 4 1 20 41 20 41 20 41 20 4

5 2 5 2 5 2 5 2 3 0 3 0 3 0 3 0

5 6 4 2 2 4 1 0

0 2 2 5

0 4

9

1

mini

iX ff

Page 32: Combinatorial Optimization for Graphical Models

32

The Value Function

Value of node = minimal cost solution below it

0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1

C

D

F

E

B

A 0 1

A B f1

0 0 20 1 01 0 11 1 4

A

E

C

B

F

D

A C f2

0 0 30 1 01 0 01 1 1

A E f3

0 0 00 1 31 0 21 1 0

A F f4

0 0 20 1 01 0 01 1 2

B C f5

0 0 00 1 11 0 21 1 4

B D f6

0 0 40 1 21 0 11 1 0

B E f7

0 0 30 1 21 0 11 1 0

C D f8

0 0 10 1 41 0 01 1 0

E F f9

0 0 10 1 01 0 01 1 2

3 00

2 2

6

2

3

3 02 23 02 23 02 2 3 02 23 02 23 02 23 02 20 0 02 2 2 0 2 0 0 02 2 2

3 3 3 1 1 1 1

8 5 3 1

5

5

1 0 1 1 10 0 0 1 0 1 1 10 0 0

2 2 2 2 0 0 0 0

7 4 2 0

7 4

7

50 0

3 5 3 5 3 5 3 5 1 3 1 3 1 3 1 3

5 6 4 2 2 4 1 0

3 1

2

5 4

0

1 20 41 20 41 20 41 20 4 1 20 41 20 41 20 41 20 4

5 2 5 2 5 2 5 2 3 0 3 0 3 0 3 0

5 6 4 2 2 4 1 0

0 2 2 5

0 4

9

1

mini

iX ff

Page 33: Combinatorial Optimization for Graphical Models

33

An Optimal Solution

Value of node = minimal cost solution below it

0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1

C

D

F

E

B

A 0 1

A B f1

0 0 20 1 01 0 11 1 4

A

E

C

B

F

D

A C f2

0 0 30 1 01 0 01 1 1

A E f3

0 0 00 1 31 0 21 1 0

A F f4

0 0 20 1 01 0 01 1 2

B C f5

0 0 00 1 11 0 21 1 4

B D f6

0 0 40 1 21 0 11 1 0

B E f7

0 0 30 1 21 0 11 1 0

C D f8

0 0 10 1 41 0 01 1 0

E F f9

0 0 10 1 01 0 01 1 2

3 00

2 2

6

2

3

3 02 23 02 23 02 2 3 02 23 02 23 02 23 02 20 0 02 2 2 0 2 0 0 02 2 2

3 3 3 1 1 1 1

8 5 3 1

5

5

1 0 1 1 10 0 0 1 0 1 1 10 0 0

2 2 2 2 0 0 0 0

7 4 2 0

7 4

7

50 0

3 5 3 5 3 5 3 5 1 3 1 3 1 3 1 3

5 6 4 2 2 4 1 0

3 1

2

5 4

0

1 20 41 20 41 20 41 20 4 1 20 41 20 41 20 41 20 4

5 2 5 2 5 2 5 2 3 0 3 0 3 0 3 0

5 6 4 2 2 4 1 0

0 2 2 5

0 4

9

1

mini

iX ff

Page 34: Combinatorial Optimization for Graphical Models

34

Basic Heuristic Search Schemes

Heuristic function f(xp) computes a lower bound on the best

extension of xp and can be used to guide a heuristic search algorithm. We focus on:

1. Branch-and-BoundUse heuristic function f(xp) to prune the depth-first search treeLinear space

2. Best-First SearchAlways expand the node with the highest heuristic value f(xp)Needs lots of memory

f L

L

Page 35: Combinatorial Optimization for Graphical Models

35

Best-First vs. Depth-first Branch-and-Bound

Best-First (A*): (optimal) Expand least number of nodes given h Requires to store all search tree

Depth-first Branch-and-Bound: Can use only linear space If find an optimal solution early will expand

the same space as Best-First (if search space is a tree)

B&B can improve heuristic function dynamically

Page 36: Combinatorial Optimization for Graphical Models

36

How to Generate Heuristics

The principle of relaxed models

Mini-Bucket Elimination Bounded directional consistency ideas Linear relaxation for integer programs

Page 37: Combinatorial Optimization for Graphical Models

37

Outline Introduction Inference Search (OR)

Lower-bounds and relaxations Bounded inference

Mini-Bucket Elimination Static and dynamic mini-bucket heuristics

Local consistency Continuous relaxations

Exploiting problem structure in search Other hybrids of search and inference Software & Applications

Page 38: Combinatorial Optimization for Graphical Models

38

Mini-Bucket Approximation

n

ii

X

X hh1

min

n

rii

X

r

ii

X

X hhg11

minmin

Split a bucket into mini-buckets => bound complexity

)()()O(e :decrease complexity lExponentia n rnr eOeO

bucket (X) ={ h1, …, hr, hr+1, …, hn }

{ h1, …, hr } { hr+1, …, hn }

XX hg

Page 39: Combinatorial Optimization for Graphical Models

39

Mini-Bucket Elimination

bucket A:

bucket E:

bucket D:

bucket C:

bucket B:

minBΣ

F(b,e)

F(a,d)

hE(a)

hB(e)

hB(a,d)

hD(a)

F(a,b) F(b,d)

F(c,e) F(a,c)

hC(e,a)

L = lower bound

Mini-buckets

A

B C

D E

Page 40: Combinatorial Optimization for Graphical Models

40

Semantics of Mini-Bucket: Splitting a Node

U UÛ

Before Splitting:Network N

After Splitting:Network N'

Variables in different buckets are renamed and duplicated (Kask et. al., 2001), (Geffner et. al., 2007), (Choi, Chavira, Darwiche , 2007)

Page 41: Combinatorial Optimization for Graphical Models

41

MBE-MPE(i) Algorithm Approx-MPE (Dechter & Rish, 1997)

Input: i – max number of variables allowed in a mini-bucket Output: [lower bound (P of a sub-optimal solution), upper bound]

Example: approx-mpe(3) versus elim-mpe

2* w 4* w

Page 42: Combinatorial Optimization for Graphical Models

42

Properties of MBE(i) Complexity: O(r exp(i)) time and O(exp(i)) space Yields an upper-bound and a lower-bound

Accuracy: determined by upper/lower (U/L) bound

As i increases, both accuracy and complexity increase

Possible use of mini-bucket approximations: As anytime algorithms As heuristics in search

Other tasks: similar mini-bucket approximations for: Belief updating, MAP and MEU (Dechter & Rish, 1997)

Page 43: Combinatorial Optimization for Graphical Models

43

Anytime Approximation

UL

L

U

mpe(i)-approxL

mpe(i)-approxU

iii

ii

step

smallest theand largest the

solutionreturn ,11

far so foundsolution best thekeep

by computed boundlower

by computed boundupper

available are resources space and time0

return

end

if

While

:Initialize

)mpe(-anytime

Page 44: Combinatorial Optimization for Graphical Models

44

Empirical Evaluation(Rish & Dechter, 1999)

Benchmarks Randomly generated networks CPCS networks Probabilistic decoding

Task Comparing approx-mpe and anytime-

mpe versus bucket-elimination (elim-mpe)

Page 45: Combinatorial Optimization for Graphical Models

45

Anytime-mpe(0.0001) U/L error vs time

Time and parameter i

1 10 100 1000

Up

pe

r/L

ow

er

0.6

1.0

1.4

1.8

2.2

2.6

3.0

3.4

3.8 cpcs422b cpcs360b

i=1 i=21

CPCS networks – medical diagnosis(noisy-OR model)

Test case: no evidence

505.2 70.3anytime-mpe( ),

110.5 70.3anytime-mpe( ),

1697.6 115.8elim-mpecpcs422 cpcs360 Algorithm

Time (sec)

410 110

Page 46: Combinatorial Optimization for Graphical Models

46

Outline Introduction Inference Search (OR)

Lower-bounds and relaxations Bounded inference

Mini-Bucket Elimination Static and dynamic mini-bucket heuristics

Local consistency Continuous relaxations

Exploiting problem structure in search Other hybrids of search and inference Software & Applications

Page 47: Combinatorial Optimization for Graphical Models

47

Generating Heuristic for Graphical Models(Kask & Dechter, AIJ’01)

Given a cost function

C(a,b,c,d,e) = F(a) + F(b,a) + F(c,a) + F(e,b,c) + F(d,b,a)

Define an evaluation function over a partial assignment as theprobability of it’s best extension

f*(a,e,d) = minb,c F(a,b,c,d,e) = = F(a) + minb,c F(b,a) + F(c,a) + F(e,b,c) + F(d,a,b)

= g(a,e,d) • H*(a,e,d)

D

E

E

DA

D

BD

B0

1

1

0

1

0

Page 48: Combinatorial Optimization for Graphical Models

48

Generating Heuristics (cont.)

H*(a,e,d) = minb,c F(b,a) + F(c,a) + F(e,b,c) + F(d,a,b)

= minc [F(c,a) + minb [F(e,b,c) + F(b,a) + F(d,a,b)]]

minc [F(c,a) + minb F(e,b,c) + minb [F(b,a) + F(d,a,b)]]

minb [F(b,a) + F(d,a,b)] + minc [F(c,a) + minb F(e,b,c)]

= hB(d,a) + hC(e,a)

= H(a,e,d)

f(a,e,d) = g(a,e,d) + H(a,e,d) f*(a,e,d)

The heuristic function H is what is compiled during the

preprocessing stage of the Mini-Bucket algorithm.

Page 49: Combinatorial Optimization for Graphical Models

49

Generating Heuristics (cont.)

H*(a,e,d) = minb,c F(b,a) + F(c,a) + F(e,b,c) + F(d,a,b)

= minc [F(c,a) + minb [F(e,b,c) + F(b,a) + F(d,a,b)]]

minc [F(c,a) + minb F(e,b,c) + minb [F(b,a) + F(d,a,b)]]

minb [F(b,a) + F(d,a,b)] + minc [F(c,a) + minb F(e,b,c)]

= hB(d,a) + hC(e,a)

= H(a,e,d)

f(a,e,d) = g(a,e,d) + H(a,e,d) f*(a,e,d)

The heuristic function H is what is compiled during the preprocessing stage of the

Mini-Bucket algorithm.

Page 50: Combinatorial Optimization for Graphical Models

50

Static MBE Heuristics Given a partial assignment xp, estimate the cost of the best

extension to a full solution The evaluation function f(xp) can be computed using function

recorded by the Mini-Bucket scheme

B: F(E,B,C) F(D,A,B) F(B,A)

A:

E:

D:

C: F(C,A) hB(E,C)

hB(D,A)

hC(E,A)

F(A) hE(A) hD(A)

f(a,e,D) = F(a) + hB(D,a) + hC(e,a)

g h – is admissible

A

B C

D

E

Cost Network

E

E

DA

D

BD

B

0

1

1

0

1

0

f(a,e,D))=g(a,e) + H(a,e,D )

Page 51: Combinatorial Optimization for Graphical Models

51

Heuristics Properties

MB Heuristic is monotone, admissible Computed in linear time

IMPORTANT: Heuristic strength can vary by MB(i) Higher i-bound more pre-processing

stronger heuristic less search

Allows controlled trade-off between preprocessing and search

Page 52: Combinatorial Optimization for Graphical Models

52

Combinatorial Auctions Example

BIDS B1 = {1, 2, 3, 4} B2 = {2, 3, 6} B3 = {1, 4, 5} B4 = {2, 8} B5 = {5, 6}

PRICES P1 = 8 P2 = 6 P3 = 5 P4 = 2 P5 = 2

Constraint Optimization Problem Variables: b1, b2, b3, b4, b5 (i.e., bids) Domains: {0, 1} Constraints: R12, R13, R14, R24, R25, R35

Cost functions: r(b1), r(b2), r(b3), r(b4), r(b5)

Page 53: Combinatorial Optimization for Graphical Models

53

Combinatorial Auctions

OPT

Page 54: Combinatorial Optimization for Graphical Models

54

Experimental Methodology Algorithms

BBMB(i) - Branch-and-Bound with MB(i) BBFB(i) - Best-First with MB(i) MBE(i) – Mini-Bucket Elimination

Benchmarks Random Coding (Bayesian) CPCS (Bayesian) Random (CSP)

Measures of performance Compare accuracy given a fixed amount of time

i.e., how close is the cost found to the optimal solution Compare trade-off performance as a function of time

Page 55: Combinatorial Optimization for Graphical Models

55

Empirical Evaluation of Mini-Bucket heuristics:Random coding networks (Kask & Dechter, UAI’99)

Time [sec]

0 10 20 30

% S

olve

d E

xact

ly

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0

BBMB i=2

BFMB i=2

BBMB i=6

BFMB i=6

BBMB i=10

BFMB i=10

BBMB i=14

BFMB i=14

Random Coding, K=100, noise=0.28 Random Coding, K=100, noise 0.32

Time [sec]

0 10 20 30

% S

olve

d E

xact

ly

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0

BBMB i=6 BFMB i=6 BBMB i=10 BFMB i=10 BBMB i=14 BFMB i=14

Random Coding, K=100, noise=0.32

Each data point represents an average over 100 random instances

Page 56: Combinatorial Optimization for Graphical Models

56

Max-CSP Experiments(Kask & Dechter, CP’00)

Page 57: Combinatorial Optimization for Graphical Models

57

Dynamic MB and MBTE Heuristics(Kask, Marinescu and Dechter, UAI’03)

Rather than pre-compile compute the heuristics during search

Dynamic MB: use the Mini-Bucket algorithm to produce a bound for any node during search

Dynamic MBTE: We can compute heuristics simultaneously for all un-instantiated variables using mini-bucket-tree elimination

MBTE is an approximation scheme defined over cluster-trees. It outputs multiple bounds for each variable and value extension at once

Page 58: Combinatorial Optimization for Graphical Models

58

ABC

2

4

),()2,1( cbh1

3 BEF

EFG

),()1,2( cbh

),()3,2( fbh

),()2,3( fbh

),()4,3( feh

),()3,4( fehEF

BF

BC

BCDF

),(1)2,1( cbh

)(

)(2

)1,2(

1)1,2(

ch

bh

)(

)(2

)3,2(

1)3,2(

fh

bh

),(1)2,3( fbh

),(1)4,3( feh

),(1)3,4( feh

)2,1(H

)1,2(H

)3,2(H

)2,3(H

)4,3(H

)3,4(H

ABC

2

4

1

3 BEF

EFG

EF

BF

BC

BCDF

Mini Bucket Tree Elimination

Page 59: Combinatorial Optimization for Graphical Models

59

Branch-and-Bound w/ Mini-Buckets

BB with static Mini-Bucket Heuristics (s-BBMB) Heuristic information is pre-compiled before search Static variable ordering, prunes current variable

BB with dynamic Mini-Bucket Heuristics (d-BBMB) Heuristic information is assembled during search Static variable ordering, prunes current variable

BB with dynamic Mini-Bucket-Tree Heuristics (BBBT) Heuristic information is assembled during search. Dynamic variable ordering, prunes all future variables

Page 60: Combinatorial Optimization for Graphical Models

60

Empirical Evaluation

Algorithms: Complete

BBBT BBMB

Incomplete DLM GLS SLS IJGP IBP (coding)

Measures: Time Accuracy (% exact) #Backtracks Bit Error Rate (coding)

Benchmarks: Coding networks Bayesian Network Repository Grid networks (N-by-N) Random noisy-OR networks Random networks

Page 61: Combinatorial Optimization for Graphical Models

61

Real World Benchmarks

Average Accuracy and Time. 30 samples, 10 observations, 30 seconds

(Marinescu, Kask & Dechter, UAI’03)

Page 62: Combinatorial Optimization for Graphical Models

62

Empirical Results: Max-CSP Random Binary Problems: <N, K, C, T>

N: number of variables K: domain size C: number of constraints T: Tightness

Task: Max-CSP

Page 63: Combinatorial Optimization for Graphical Models

63

BBBT(i) vs. BBMB(i).

BBBT(i) vs. BBMB(i), N=100

i=2 i=3 i=4 i=5 i=6 i=7 i=2

(Kask & Dechter, CP’00)

Page 64: Combinatorial Optimization for Graphical Models

64

Outline Introduction Inference Search (OR)

Lower-bounds and relaxations Bounded inference Local consistency

Equivalence preserving transformations Directional arc-consistency and other local consistencies Polynomial classes based on cost functions semantics Global cost functions

Continuous relaxations

Exploiting problem structure in search Other hybrids of search and inference Software & Applications

Page 65: Combinatorial Optimization for Graphical Models

Local Consistency

To be completed …

65

Page 66: Combinatorial Optimization for Graphical Models

66

Outline Introduction Inference Search (OR) Lower-bounds and relaxations

Exploiting problem structure in search AND/OR search trees (linear space) AND/OR search graphs (caching) Searching the AND/OR spaces

Other hybrids of search and inference Software & Applications

Page 67: Combinatorial Optimization for Graphical Models

67

Classic OR Search Space

0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1

E

C

F

D

B

A 0 1

Ordering: A B E C D F

A

D

B C

E

F

Page 68: Combinatorial Optimization for Graphical Models

68

AND/OR Search Space

AOR

0AND 1

BOR B

0AND 1 0 1

EOR C E C E C E C

OR D F D F D F D F D F D F D F D F

AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

AND 0 10 1 0 10 1 0 10 1 0 10 1

A

D

B C

E

F

A

D

B

CE

F

Primal graph DFS tree

A

D

B C

E

F

A

D

B C

E

F

Page 69: Combinatorial Optimization for Graphical Models

69

AND/OR vs. OR

E 0 1 0 1 0 1 0 1

0C 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

F 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0 1

A 0 1

AOR

0AND 1

BOR B

0AND 1 0 1

EOR C E C E C E C

OR D F D F D F D F D F D F D F D F

AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

AND 0 10 1 0 10 1 0 10 1 0 10 1

E 0 1 0 1 0 1 0 1

0C 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

F 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0 1

A 0 1

E 0 1 0 1 0 1 0 1

0C 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

F 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0 1

A 0 1

AND/OR

OR

A

D

B C

E

F

A

D

B

CE

F

AND/OR size: exp(4), OR size exp(6)

Page 70: Combinatorial Optimization for Graphical Models

70

OR space vs. AND/OR space

width heightOR space AND/OR space

Time (sec.) Nodes Backtracks Time (sec.) AND nodes OR nodes

5 10 3.154 2,097,150 1,048,575 0.03 10,494 5,247

4 9 3.135 2,097,150 1,048,575 0.01 5,102 2,551

5 10 3.124 2,097,150 1,048,575 0.03 8,926 4,463

4 10 3.125 2,097,150 1,048,575 0.02 7,806 3,903

5 13 3.104 2,097,150 1,048,575 0.1 36,510 18,255

Random graphs with 20 nodes, 20 edges and 2 values per node.

Page 71: Combinatorial Optimization for Graphical Models

71

AND/OR Tree Search for COP

A

0

B

0

E

F F

0 1 0 1

OR

AND

OR

AND

OR

OR

AND

AND 0 1

C

D D

0 1 0 1

0 1

1

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

A

E

C

B

F

D

A B f1

0 0 20 1 01 0 11 1 4

A C f2

0 0 30 1 01 0 01 1 1

A E f3

0 0 00 1 31 0 21 1 0

A F f4

0 0 20 1 01 0 01 1 2

B C f5

0 0 00 1 11 0 21 1 4

B D f6

0 0 40 1 21 0 11 1 0

B E f7

0 0 30 1 21 0 11 1 0

C D f8

0 0 10 1 41 0 01 1 0

E F f9

0 0 10 1 01 0 01 1 2

5 6 4 2 3 0 2 2

5 2 0 2

5 2 0 2

3 3

6

5

5

5

3 1 3 5

2

2 4 1 0 3 0 2 2

2 0 0 2

2 0 0 2

4 1

5

5 4 1 3

0

0

1

B

0

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

1

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

5 6 4 2 1 2 0 4 2 4 1 0 1 2 0 4

6 4

7

7

5 2 1 0 2 0 1 0

5 2 1 0 2 0 1 0

4 2 4 0

0

0 2 5 2 2 5 3 0

1 4

A

D

B

EC

F

AND node = Combination operator (summation)

9

1min :Goal

i iX Xf

OR node = Marginalization operator (minimization)

Page 72: Combinatorial Optimization for Graphical Models

72

Summary of AND/OR Search Trees

Based on a backbone pseudo-tree

A solution is a subtree

Each node has a value – cost of the optimal solution to the subproblem (computed recursively based on the values of the descendants)

Solving a task = finding the value of the root node

AND/OR search tree and algorithms are (Freuder & Quinn, 1985), (Collin, Dechter & Katz, 1991), (Bayardo & Miranker, 1995) Space: O(n) Time: O(exp(m)), where m is the depth of the pseudo-tree Time: O(exp(w* log n)) BFS is time and space: O(exp(w* log n)

Page 73: Combinatorial Optimization for Graphical Models

73

From AND/OR Trees to AND/OR Graphs Any two nodes that root identical subtrees or

subgraphs can be merged

Minimal AND/OR search graph: closure under merge of the AND/OR search tree

Inconsistent sub-trees can be pruned too Some portions can be collapsed or reduced

Page 74: Combinatorial Optimization for Graphical Models

74

AND/OR TreeA

D

B C

E

F

A

D

B

CE

F

G H

J

K

G

H

J

KAOR

0AND 1

BOR B

0AND 1 0 1

EOR C E C E C E C

OR D F D F D F D F D F D F D F D F

AND

AND 0 10 1 0 10 1 0 10 1 0 10 1

OR

OR

AND

AND

0

G

H H

0 1 0 1

0 1

1

G

H H

0 1 0 1

0 1

0

J

K K

0 1 0 1

0 1

1

J

K K

0 1 0 1

0 1

0

G

H H

0 1 0 1

0 1

1

G

H H

0 1 0 1

0 1

0

J

K K

0 1 0 1

0 1

1

J

K K

0 1 0 1

0 1

0

G

H H

0 1 0 1

0 1

1

G

H H

0 1 0 1

0 1

0

J

K K

0 1 0 1

0 1

1

J

K K

0 1 0 1

0 1

0

G

H H

0 1 0 1

0 1

1

G

H H

0 1 0 1

0 1

0

J

K K

0 1 0 1

0 1

1

J

K K

0 1 0 1

0 1

0

G

H H

0 1 0 1

0 1

1

G

H H

0 1 0 1

0 1

0

J

K K

0 1 0 1

0 1

1

J

K K

0 1 0 1

0 1

0

G

H H

0 1 0 1

0 1

1

G

H H

0 1 0 1

0 1

0

J

K K

0 1 0 1

0 1

1

J

K K

0 1 0 1

0 1

0

G

H H

0 1 0 1

0 1

1

G

H H

0 1 0 1

0 1

0

J

K K

0 1 0 1

0 1

1

J

K K

0 1 0 1

0 1

0

G

H H

0 1 0 1

0 1

1

G

H H

0 1 0 1

0 1

0

J

K K

0 1 0 1

0 1

1

J

K K

0 1 0 1

0 1

Page 75: Combinatorial Optimization for Graphical Models

75

An AND/OR Graph: Caching Goods

A

D

B C

E

F

A

D

B

CE

F

G H

J

K

G

H

J

KAOR

0AND 1

BOR B

0AND 1 0 1

EOR C E C E C E C

OR D F D F D F D F D F D F D F D F

AND

AND 0 10 1 0 10 1 0 10 1 0 10 1

OR

OR

AND

AND

0

G

H H

0 1 0 1

0 1

1

G

H H

0 1 0 1

0 1

0

J

K K

0 1 0 1

0 1

1

J

K K

0 1 0 1

0 1

Page 76: Combinatorial Optimization for Graphical Models

76

AND/OR Search Graph (Context-based Caching)

Identify unifiable subtrees Context = parent separator set in

induced pseudo-tree = current variable + ancestors connected to subtree below

A

D

B

EC

F

context(A) = {A}context(B) = {B,A}context(C) = {C,B}context(D) = {D}context(E) = {E,A}context(F) = {F}

(Dechter & Mateescu, UAI’04), (Mateescu & Dechter, IJCAI’05)

A

E

C

B

F

D

Page 77: Combinatorial Optimization for Graphical Models

77

AND/OR Search Graph

A

E

C

B

F

D

A

D

B

EC

FPrimal graph

Pseudo-tree

context(A) = {A}context(B) = {B,A}context(C) = {C,B}context(D) = {D}context(E) = {E,A}context(F) = {F}

AOR

0AND

BOR

0AND

OR E

OR F F

AND 0 1 0 1

AND 0 1

C

D D

0 1 0 1

0 1

1

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

1

B

0

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

1

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

Page 78: Combinatorial Optimization for Graphical Models

78

AND/OR Search Graph

OR

AND

OR

AND

OR E

OR F F

AND0 1

AND 0 1

D D

0 1

1

1

EC

D D

0 1

E

F F

0 1

A

0

B

0

C

0

1

B

0

C

1

EC

A

E

C

B

F

D

A

D

B

EC

FPrimal graph

Pseudo-tree

context(A) = {A}context(B) = {B,A}context(C) = {C,B}context(D) = {D}context(E) = {E,A}context(F) = {F}

Page 79: Combinatorial Optimization for Graphical Models

79

AND/OR Tree vs. Graph

OR

AND

OR

AND

OR E

OR F F

AND0 1

AND 0 1

D D

0 1

1

1

EC

D D

0 1

E

F F

0 1

A

0

B

0

C

0

1

B

0

C

1

EC

AOR

0AND

BOR

0AND

OR E

OR F F

AND 0 1 0 1

AND 0 1

C

D D

0 1 0 1

0 1

1

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

1

B

0

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

1

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

18 nodes

54 nodes

A

D

B

EC

F

Space: O(exp(w*))

Space: O(n)

Page 80: Combinatorial Optimization for Graphical Models

80

Context-based Caching

A

D

B

EC

F

context(A) = {A}context(B) = {B,A}context(C) = {C,B}context(D) = {D}context(E) = {E,A}context(F) = {F}

Cache Table (C)

B C Value0 0 50 1 21 0 21 1 0

A

0

B

0

EC

D D

0 1

1

EC

D D

0 1

1

B

0

EC

1

EC

5

5

5 2

3

6

2 0

4

5

4 4

46

7

7

A

E

C

B

F

D

Primal graph

Space: O(exp(2))

Page 81: Combinatorial Optimization for Graphical Models

81

Example (graph search)

AOR

0AND

BOR

0AND

OR E

OR F F

AND0 1

AND 0 1

C

D D

0 1

0 1

1

EC

D D

0 1

1

B

0

E

F F

0 1

C

1

EC

56

30

3

5

5

5 2

5 2

13

0 2

0 23

53

6

2 0

2 0

2 0

1 0

1 0

54

31

4 1

5

0

4 2 4 0

46

7

0

7

02

52 2

5 30

1 4

42

0 0 0 0

22

42

01

21

40

A

E

C

B

F

D

A B f1

0 0 20 1 01 0 11 1 4

A C f2

0 0 30 1 01 0 01 1 1

A E f3

0 0 00 1 31 0 21 1 0

A F f4

0 0 20 1 01 0 01 1 2

B C f5

0 0 00 1 11 0 21 1 4

B D f6

0 0 40 1 21 0 11 1 0

B E f7

0 0 30 1 21 0 11 1 0

C D f8

0 0 10 1 41 0 01 1 0

E F f9

0 0 10 1 01 0 01 1 2

A

D

B

EC

F

9

1min :Goal

i iX Xf5

Page 82: Combinatorial Optimization for Graphical Models

82

All Four Search Spaces

Full OR search tree

126 nodes

0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1

C

D

F

E

B

A 0 1

Full AND/OR search tree

54 AND nodes

AOR

0AND

BOR

0AND

OR E

OR F F

AND 0 1 0 1

AND 0 1

C

D D

0 1 0 1

0 1

1

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

1

B

0

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

1

E

F F

0 1 0 1

0 1

C

D D

0 1 0 1

0 1

Context minimal OR search graph

28 nodes

0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1

0 1

0 1 0 1

0 1 0 1

C

D

F

E

B

A 0 1

Context minimal AND/OR search graph

18 AND nodes

AOR0ANDBOR

0AND

OR E

OR F F

AND 0 1

AND 0 1

C

D D

0 1

0 1

1

EC

D D

0 1

1

B

0

E

F F

0 1

C

1

EC

Page 83: Combinatorial Optimization for Graphical Models

83

AND/OR vs. OR DFS Algorithms

AND/OR tree Space: O(n) Time: O(n km)

O(n kw* log n)(Freuder, 1985; Bayardo, 1995; Darwiche, 2001)

AND/OR graph Space: O(n kw*) Time: O(n kw*)

k = domain sizem = pseudo-tree depthn = number of variablesw*= induced widthpw*= path width

OR tree Space: O(n) Time: O(kn)

OR graph Space: O(n kpw*) Time: O(n kpw*)

Page 84: Combinatorial Optimization for Graphical Models

84

Searching AND/OR Graphs

AO(j): searches depth-first, cache j-context j = the max size of a cache table

(i.e. number of variables in a context)

j=0 j=w*

Space: O(n)

Time: O(exp(w* log n))

Space: O(exp w*)

Time: O(exp w*)

AO(j) time complexity?

Page 85: Combinatorial Optimization for Graphical Models

85

Pseudo-trees (I)

AND/OR graph/tree search algorithms influenced by the pseudo-tree quality

Finding the minimal context/depth pseudo-tree is a hard problem

Heuristics Min-fill (min context) Hypergraph separation (min depth)

Page 86: Combinatorial Optimization for Graphical Models

86

Pseudo-trees (II) MIN-FILL (Kjæaerulff, 1990), (Bayardo & Miranker,

1995) Depth-first traversal of the induced graph

constructed along some elimination order Elimination order prefers variables with

smallest “fill set”

HYPERGRAPH (Darwiche, 2001) Constraints are vertices in the hypergraph

and variables are hyperedges Recursive decomposition of the hypergraph

while minimizing the separator size (i.e. number of variables) at each step

Using state-of-the-art software package hMeTiS

Page 87: Combinatorial Optimization for Graphical Models

87

Quality of Pseudo-trees

Network hypergraph min-fill

  width depth width depth

barley 7 13 7 23

diabetes 7 16 4 77

link 21 40 15 53

mildew 5 9 4 13

munin1 12 17 12 29

munin2 9 16 9 32

munin3 9 15 9 30

munin4 9 18 9 30

water 11 16 10 15

pigs 11 20 11 26

Network hypergraph min-fill

  width depth width depth

spot5 47 152 39 204

spot28 108 138 79 199

spot29 16 23 14 42

spot42 36 48 33 87

spot54 12 16 11 33

spot404 19 26 19 42

spot408 47 52 35 97

spot503 11 20 9 39

spot505 29 42 23 74

spot507 70 122 59 160

Bayesian Networks Repository SPOT5 Benchmarks

Page 88: Combinatorial Optimization for Graphical Models

88

Outline Introduction Inference Search (OR) Lower-bounds and relaxations

Exploiting problem structure in search AND/OR search trees (linear space) AND/OR search graphs (caching) Searching the AND/OR spaces

AND/OR Branch-and-Bound search Best-First AND/OR search

Other hybrids of search and inference Software & Applications

Page 89: Combinatorial Optimization for Graphical Models

89

Classic Branch-and-Bound Search

nn

g(n)

h(n)

LB(n) = g(n) + h(n)

Lower Bound LB

OR Search Tree

Prune if LB(n) ≥ UB

Upper Bound UB

Page 90: Combinatorial Optimization for Graphical Models

Partial Solution Tree

0

D

0

(A=0, B=0, C=0, D=0)

0

A

B C

0

0

A

B C

00

D

1

(A=0, B=0, C=0, D=1)(A=0, B=1, C=0, D=0)(A=0, B=1, C=0, D=1)

Pseudo tree

Extension(T’) – solution trees that extend T’

90

Page 91: Combinatorial Optimization for Graphical Models

Exact Evaluation Function

OR

AND

OR

AND

OR

OR

AND

AND

A

0

B

0

D

E E

0 1 0 1

0 1

C

1

1

6 4 8 54 5

4 5

2 4

9

9

2 5 0 0

0 0

0

1

0

0

D

0

C

1

v(D,0)

3

3 5 0

0

9

tip nodes

F

1

3

3 5

0

F v(F)

f*(T’) = w(A,0) + w(B,1) + w(C,0) + w(D,0) + v(D,0) + v(F)91

Page 92: Combinatorial Optimization for Graphical Models

Heuristic Evaluation Function

OR

AND

OR

AND

OR

OR

AND

AND

A

0

B

0

D

E E

0 1 0 1

0 1

C

1

1

6 4 8 54 5

4 5

2 4

9

9

2 5 0 0

0 0

0

1

0

0

D

0

C

1

h(D,0) = 4

3

3 5 0

0

9

tip nodes

F

1

3

3 5

0

F h(F) = 5

f(T’) = w(A,0) + w(B,1) + w(C,0) + w(D,0) + h(D,0) + h(F) = 12 ≤ f*(T’)

h(n) ≤ v(n)

92

Page 93: Combinatorial Optimization for Graphical Models

AND/OR Branch-and-Bound Search

OR

AND

OR

AND

OR

OR

AND

AND

A

0

B

0

D

E E

0 1 0 1

0 1

C

1

1

∞ 3 ∞ 43 4

3 4

∞ 4

5

5

5

∞ ∞ 1 ∞

0

5

0

0

111

0

0

D

E E

0 1 0 1

0 1

C

1

∞ 3 ∞ 43 4

3 4

2 3

∞ 2 0 2

0

B

0 111

11

0 0

f(T’) ≥ UB

UB

93

Page 94: Combinatorial Optimization for Graphical Models

AND/OR Branch-and-Bound Search

Associate each node n with a heuristic lower bound h(n) on v(n)

EXPAND (top-down) Evaluate f(T’) of the current partial solution

sub-tree T’, and prune search if f(T’) ≥ UB Expand the tip node n by generating its

successors PROPAGATE (bottom-up)

Update value of the parent p of n OR nodes: minimization AND nodes: summation

(Marinescu & Dechter, 2005)94

Page 95: Combinatorial Optimization for Graphical Models

Deep Cutoff

OR

AND

OR

AND

OR

OR

AND

AND

A

0

B

0

D

E E

0 1 0 1

0 1

C

1

1

6 4 8 54 5

4 5

2 4

9

9

2 5 0 0

0 0

0

1

0

0

D

0

C

1

h(D,0) = 4

3

3 5 00

9

Search is here

F

1

3

3 50

F h(F) = 5

h(n) ≤ v(n)

f(T’B) = w(B,1) + w(C,0) + w(D,0) + h(D,0) + h(F) = 9

f(T’D) = w(D,0) + h(D,0) = 4

≥ v(B) = 9

95

Page 96: Combinatorial Optimization for Graphical Models

96

Heuristics for AND/OR Branch-and-Bound

In the AND/OR search space h(n) can be computed using any heuristic. We used:

Static Mini-Bucket heuristics (Kask & Dechter, AIJ’01), (Marinescu & Dechter, IJCAI’05)

Dynamic Mini-Bucket heuristics (Marinescu & Dechter, IJCAI’05)

Maintaining local consistency (Larrosa & Schiex, AAAI’03), (de Givry et al., IJCAI’05)

LP relaxations (Nemhauser & Wosley, 1998)

Page 97: Combinatorial Optimization for Graphical Models

Mini-Bucket Heuristics

Static Mini-Buckets Pre-compiled Reduced overhead Less accurate Static variable

ordering

Dynamic Mini-Buckets Computed

dynamically Higher overhead High accuracy Dynamic variable

ordering

97

Page 98: Combinatorial Optimization for Graphical Models

Bucket Elimination

A

f(A,B)B

f(B,C)C f(B,F)F

f(A,G) f(F,G)

Gf(B,E) f(C,E)

E

f(A,D)

f(B,D)

f(C,D)

D

hG (A,F)

hF (A,B)

hB (A)

hE (B,C)hD (A,B,C)

hC (A,B)

Ordering: (A, B, C, D, E, F, G)

h*(a, b, c) = hD(a, b, c) + hE(b, c)

98

Page 99: Combinatorial Optimization for Graphical Models

Static Mini-Bucket Heuristics

A

f(A,B)B

f(B,C)C f(B,F)F

f(A,G) f(F,G)

Gf(B,E) f(C,E)

Ef(B,D) f(C,D)

D

hG (A,F)

hF (A,B)

hB (A)

hE (B,C)hD (B,C)

hC (B)

hD (A)

f(A,D)D

mini-buckets

Ordering: (A, B, C, D, E, F, G)

h(a, b, c) = hD(a) + hD(b, c) + hE(b, c) ≤ h*(a, b, c)

MBE(3)

99

Page 100: Combinatorial Optimization for Graphical Models

Dynamic Mini-Bucket Heuristics

A

f(a,b)B

f(b,C)C f(b,F)F

f(a,G) f(F,G)

Gf(b,E) f(C,E)

E

f(a,D)

f(b,D)

f(C,D)

D

hG (F)

hF ()

hB ()

hE (C)hD (C)

hC ()

Ordering: (A, B, C, D, E, F, G)

h(a, b, c) = hD(c) + hE(c) = h*(a, b, c)

MBE(3)

100

Page 101: Combinatorial Optimization for Graphical Models

101

Dynamic Variable Orderings(Marinescu & Dechter, ECAI’06)

Variable ordering heuristics: Semantic-based

Aim at shrinking the size of the search space based on context and current value assignments

e.g. min-domain, min-dom/deg, min reduced cost

Graph-based Aim at maximizing the problem decomposition

e.g. pseudo-tree

Orthogonal forces, use one as primary and break ties based on the other

Page 102: Combinatorial Optimization for Graphical Models

Partial Variable Ordering

A

E

C

B

F

D

A

D

B

EC

F

B

D

A

EC

F

Variables on chains in the pseudo tree can be instantiated dynamically, basedon some semantic ordering heuristic

Variable Groups/Chains: • {A,B} • {C,D} • {E,F}

Instantiate {A,B} before {C,D} and {E,F}

*{A,B} is a separator/chain

[similar idea is exploited by BTD (Jegou & Terrioux04)]

Primal graph

102

Page 103: Combinatorial Optimization for Graphical Models

Full Dynamic Variable Ordering

DA={0,1} DB={0,1,2}DE={0,1,2,3}DC=DD=DF=DG=DH=DE

domains

cost functions

A

D

B C

E F

H

GA

B

D

C

F

P1 P2

H

E

G

[similar idea exploited in #SAT (Bayardo & Pehoushek00)]

0

0

1

E

1

B

1

D

C

F

P1 P2

H G

103

Page 104: Combinatorial Optimization for Graphical Models

Dynamic Separator Ordering

A

D

B I

E F

H

G

C

separatorA

B

C

P1

H

E

G

P2

D

I

F

Constraint Propagation may create singletonvariables in P1 and P2 (changing the problem’s

structure), which in turn may yield smaller separators

CP

[similar idea exploited in SAT (Li & van Beek04)]

Primal graph

104

Page 105: Combinatorial Optimization for Graphical Models

Experiments

Benchmarks Belief Networks (BN) Weighted CSPs (WCSP)

Algorithms AOBB SamIam (BN) Superlink (Genetic linkage analysis) Toolbar (WCSP)

Heuristics Mini-Bucket heuristics (BN, WCSP) EDAC heuristics (WCSP)

105

Page 106: Combinatorial Optimization for Graphical Models

Grid Networks (BN)

Min-fill pseudo tree. Time limit 1 hour.

(Sang et al.05)

106

Page 107: Combinatorial Optimization for Graphical Models

107

L11m L11f

X11

L12m L12f

X12

L13m L13f

X13

L14m L14f

X14

L15m L15f

X15

L16m L16f

X16

S13m

S15m

S16mS15m

S15m

S15m

L21m L21f

X21

L22m L22f

X22

L23m L23f

X23

L24m L24f

X24

L25m L25f

X25

L26m L26f

X26

S23m

S25m

S26mS25m

S25m

S25m

L31m L31f

X31

L32m L32f

X32

L33m L33f

X33

L34m L34f

X34

L35m L35f

X35

L36m L36f

X36

S33m

S35m

S36mS35m

S35m

S35m

Pedigree: 6 people, 3 markers

Page 108: Combinatorial Optimization for Graphical Models

Genetic Linkage Analysis (BN)

(Fishelson&Geiger02)

Min-fill pseudo tree. Time limit 3 hours.108

Page 109: Combinatorial Optimization for Graphical Models

Impact of the Pseudo Tree

Runtime distribution for hypergraph pseudo trees over 20 independent runs.ped30 and ped33 linkage networks.

109

Page 110: Combinatorial Optimization for Graphical Models

ISCAS’89 Circuits (WCSP)

Min-fill pseudo trees. Time limit 1 hour.EDAC-based solvers were not able to solve any instance.

(http://graphmod.ics.uci.edu/group/Repository/)

110

Page 111: Combinatorial Optimization for Graphical Models

Static vs. Dynamic Mini-Bucket Heuristics

s1196 ISCAS’89 circuit.

111

Page 112: Combinatorial Optimization for Graphical Models

Mastermind Games (WCSP)

Min-fill pseudo trees. Time limit 1 hour.EDAC-based solvers were not able to solve any instance.

(http://graphmod.ics.uci.edu/group/Repository/)

112

Page 113: Combinatorial Optimization for Graphical Models

Dynamic Variable Orderings

SPOT5 benchmark. Time limit 2 hours.

(Bensana et al.99)

113

Page 114: Combinatorial Optimization for Graphical Models

Impact of the Pseudo Tree

Runtime distribution for hypergraph pseudo trees over 20 independent runs.spot404 and spot503 Earth observing satellite scheduling instances.

114

Page 115: Combinatorial Optimization for Graphical Models

Summary

New generation of depth-first AND/OR Branch-and-Bound search

Heuristics based on Mini-Bucket approximation (static, dynamic) Directional local consistency (EDAC)

Dynamic variable orderings Superior to state-of-the-art solvers

traversing the classic OR search space

117

Page 116: Combinatorial Optimization for Graphical Models

118

Outline Introduction Inference Search (OR) Lower-bounds and relaxations

Exploiting problem structure in search AND/OR search spaces (tree, graph) Searching the AND/OR tree (linear space) Searching the AND/OR graph (caching)

AND/OR Branch-and-Bound search Best-First AND/OR search

Other hybrids of search and inference Software & Applications

Page 117: Combinatorial Optimization for Graphical Models

119

Graph AND/OR Branch-and-Bound - AOBB(j)(Marinescu & Dechter, AAAI’06)

Associate each node n with a static heuristic estimate h(n) of v(n) h(n) is a lower bound on the value v(n)

For every node n in the search tree: ub(n) – current best solution cost rooted at n lb(n) – lower bound on the minimal cost at n

During search, cache nodes based on context maintain cache tables of size O(exp(j)), where j is a

bound on the size of the context.

Page 118: Combinatorial Optimization for Graphical Models

120

Full Context-based Caching

A

D

B

EC

context(C) = {C,B,A}

B

0

EC

D D

0 1

1

EC

D D

0 1

B

0

EC

1

ECF G

H

A

0 1

H

0 1

B

0

EC

D D

0 1

1

EC

D D

0 1

B

0

EC

1

EC

H

0 1

A B C Value

0 0 0 5

0 0 1 20 1 0 20 1 1 0…

Cache Table (C)

Space: O(exp(3))

Page 119: Combinatorial Optimization for Graphical Models

121

Adaptive Caching

A

D

B

EC

context(C) = {C,B,A}

B

0

EC

D D

0 1

1

EC

D D

0 1

B

0

EC

1

ECF G

H

A

0 1

H

0 1

B

0

EC

D D

0 1

1

EC

D D

0 1

B

0

EC

1

EC

H

0 1

Cache table on [C,B] only!

Reset cache table when A changes its value!Space: O(exp(2))

B C Value0 0 50 1 21 0 21 1 0

Page 120: Combinatorial Optimization for Graphical Models

122

Example (graph search)

AOR

0AND

BOR

0AND

OR E

OR F F

AND0 1

AND 0 1

C

D D

0 1

0 1

1

EC

D D

0 1

1

B

0

E

F F

0 1

C

1

EC

56

30

3

5

5

5 2

5 2

13

0 2

0 23

53

6

2 0

2 0

2 0

1 0

1 0

54

31

4 1

5

0

4 2 4 0

46

7

0

7

02

52 2

5 30

1 4

42

0 0 0 0

22

42

01

21

40

A

E

C

B

F

D

A B f1

0 0 20 1 01 0 11 1 4

A C f2

0 0 30 1 01 0 01 1 1

A E f3

0 0 00 1 31 0 21 1 0

A F f4

0 0 20 1 01 0 01 1 2

B C f5

0 0 00 1 11 0 21 1 4

B D f6

0 0 40 1 21 0 11 1 0

B E f7

0 0 30 1 21 0 11 1 0

C D f8

0 0 10 1 41 0 01 1 0

E F f9

0 0 10 1 01 0 01 1 2

A

D

B

EC

F

9

1min :Goal

i iX Xf5

Page 121: Combinatorial Optimization for Graphical Models

123

Exploiting Constraint Processing in Optimization

Constraints should be recognized Constraint processing should be

incorporated into optimization search: Constraint propagation in look-ahead Back-jumping No-good recording

Page 122: Combinatorial Optimization for Graphical Models

124

AND/OR vs. OR

E 0 1 0 1 0 1 0 1

0C 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

F 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0 1

A 0 1

AOR

0AND 1

BOR B

0AND 1 0 1

EOR C E C E C E C

OR D F D F D F D F D F D F D F D F

AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

AND 0 10 1 0 10 1 0 10 1 0 10 1

E 0 1 0 1 0 1 0 1

0C 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

F 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0 1

A 0 1

E 0 1 0 1 0 1 0 1

0C 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

F 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0 1

A 0 1

AND/OR

OR

A

D

B C

E

F

A

D

B

CE

F

Page 123: Combinatorial Optimization for Graphical Models

125

AND/OR vs. OR

F

AND/OR

A

D

B C

E

F

A

D

B

CE

F

E 0 1 0 1 0 1

C 1 1 0 1 0 1 1 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0

A 0 1

AOR

0AND 1

BOR B

0AND 1 0

EOR C E C E C

OR D F D F D F D F

AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

AND 10 1 0 10 1 10 1

E 0 1 0 1 0 1

C 1 1 0 1 0 1 1 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0

A 0 1

E 0 1 0 1 0 1

C 1 1 0 1 0 1 1 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0

A 0 1

OR

(A=1,B=1)(B=0,C=0)

Page 124: Combinatorial Optimization for Graphical Models

126

AND/OR vs. OR

F

AND/OR

A

D

B C

E

F

A

D

B

CE

F

E 0 1 0 1 0 1

C 1 1 0 1 0 1 1 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0

A 0 1

AOR

0AND 1

BOR B

0AND 1 0

EOR C E C E C

OR D F D F D F D F

AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

AND 10 1 0 10 1 10 1

E 0 1 0 1 0 1

C 1 1 0 1 0 1 1 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0

A 0 1

E 0 1 0 1 0 1

C 1 1 0 1 0 1 1 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0B 1 0

A 0 1

OR

(A=1,B=1)(B=0,C=0)

Space: linearTime:O(exp(m))O(w* log n)

Linear space,Time:O(exp(n))

Page 125: Combinatorial Optimization for Graphical Models

127

The Effect of Constraint Propagation

1 2

A

C

3 4

B CB

2 3 4

ED

3 4 3 4

HG

4 4

G I

4

I

D

4

G

ED

2 3 4

FF

4

K

F

4

K

3

K

4

3 4 3 4

4

G

D D

4

K

F F

B

4

D

B

A

D

B C

E F

G H I K

>

>

>

>

>

>> >

>

Domains are {1,2,3,4}

1

A

CB

2

ED

3 3

H

4 4

I

4

2

F

3

K

4

G

CONSTRAINTS ONLY

FORWARD CHECKING

MAINTAINING ARC CONSISTENCY

1 2

A

C

3

B CB

2 3

ED

3 3

HG

4 4

I

4

D

2 3

FF

3

K

4

3 3

D F

B

A

D

B C

E F

G H I K

Page 126: Combinatorial Optimization for Graphical Models

ISCAS’89 Circuits

Impact of constraint propagation. Min-fill pseudo trees. Time limit 30 minutes.128

Page 127: Combinatorial Optimization for Graphical Models

129

Outline Introduction Inference Search (OR) Lower-bounds and relaxations

Exploiting problem structure in search AND/OR search spaces (tree, graph) Searching the AND/OR tree (linear space) Searching the AND/OR graph (caching)

AND/OR Branch-and-Bound search Best-First AND/OR search

Other hybrids of search and inference Software & Applications

Page 128: Combinatorial Optimization for Graphical Models

130

Best-First Principle

Best-first search expands first the node with the best heuristic evaluation function among all node encountered so far

It never expands nodes whose cost is beyond the optimal one, unlike depth-first search algorithms (Dechter & Pearl, 1985)

Superior among memory intensive algorithms employing the same heuristic function

Page 129: Combinatorial Optimization for Graphical Models

131

Best-First AND/OR Search (AOBF)(Marinescu & Dechter, CPAIOR’07, AAAI’07, UAI’07)

(specializes Nilsson’s AO* to solving COP) (Nilsson, 1984)

Maintains the set of best partial solution trees

Top-down Step (EXPAND) Traces down marked connectors from root

i.e., best partial solution tree Expands a tip node n by generating its successors n’ Associate each successor with heuristic estimate h(n’)

Initialize v(n’) = h(n’)

Bottom-up Step (REVISE) Updates node values v(n)

OR nodes: minimization AND nodes: summation

Marks the most promising solution tree from the root Label the nodes as SOLVED:

OR is SOLVED if marked child is SOLVED AND is SOLVED if all children are SOLVED

Terminate when root node is SOLVED

Page 130: Combinatorial Optimization for Graphical Models

132

Cost Revision

10

X

A B

0

C v(C)=1v(A)=2

h(B,0)=3

v(X,0)=8

v(B)=1

1 h(B,1)=1

2. Expand node B: generate (B,0) and (B,1)

1. Best Partial Solution Tree: X, (X,1), A, B, C

v(X,1)=4

v(B) = min(w(B,0) + h(B,0), w(B,1) + h(B,1))

= min(3,2) = 2

-> mark (B,1) best successor of B

v(X,1) = v(A) + v(B) + h(C) = 2+2+1=5

v(X) = min(w(X,0) + v(x,0), w(X,1) + v(X,1)) = min(8,6) = 6

-> mark (X,1) best successor of X

10

v(5)=5

1

v(B)=2

v(X,1)=5

v(5)=6

0

Page 131: Combinatorial Optimization for Graphical Models

133

AOBF versus AOBB

AOBF with the same heuristic as AOBB is likely to expand the smallest search space

AOBB improves its heuristic function dynamically, whereas AOBF uses only h(n)

AOBB can use far less memory by avoiding for example dead-caches, whereas AOBF keeps in memory the explicated search graph

AOBB is any-time, whereas AOBF is not

Page 132: Combinatorial Optimization for Graphical Models

134

Heuristics

AOBF can be guided by:

Static Mini-Bucket heuristics(Kask & Dechter, AIJ’01), (Marinescu & Dechter, IJCAI’05)

Dynamic Mini-Bucket heuristics(Marinescu & Dechter, IJCAI’05)

LP Relaxations(Nemhauser & Wosley, 1988)

Page 133: Combinatorial Optimization for Graphical Models

Experiments

Benchmarks Belief Networks (BN) Weighted CSPs (WCSP)

Algorithms AOBB-C – AND/OR Branch-and-Bound AOBF-C – Best-first AND/OR Search SamIam (BN) Superlink (linkage) Toolbar, Toolbar-BTD (WCSP)

Heuristics Mini-Bucket heuristics

Page 134: Combinatorial Optimization for Graphical Models

Grid Networks (BN)

Min-fill pseudo tree. Time limit 1 hour.

(Sang et al.05)

Page 135: Combinatorial Optimization for Graphical Models

Impact of the Pseudo Trees

Runtime distribution for hypergraph pseudo trees over 20 independent runs.90-24-1 grid instance.

Page 136: Combinatorial Optimization for Graphical Models

138

Naïve versus Adaptive Caching

Page 137: Combinatorial Optimization for Graphical Models

Genetic Linkage Analysis (BN)

Min-fill pseudo tree. Time limit 3 hours.

(Fishelson & Geiger02)

Page 138: Combinatorial Optimization for Graphical Models

Impact of the Pseudo Trees

Runtime distribution for hypergraph pseudo trees over 20 independent runs.ped30 linkage instance.

Page 139: Combinatorial Optimization for Graphical Models

ISCAS’89 Benchmark (WCSP)

Min-fill pseudo tree. Time limit 1 hour.

Page 140: Combinatorial Optimization for Graphical Models

Mastermind Games (WCSP)

Min-fill pseudo trees. Time limit 1 hour.toolbar, toolbar-BTD were not able to solve any instance.

Page 141: Combinatorial Optimization for Graphical Models

Summary

New memory intensive AND/OR search algorithms for optimization in graphical models

Depth-first and best-first control strategies Mini-bucket heuristics effective at relatively

large i-bounds Pseudo tree quality impacts search

performance dramatically Superior to state-of-the-art OR and AND/OR

Branch-and-Bound tree search algorithms

Page 142: Combinatorial Optimization for Graphical Models

0-1 Integer Linear Programming

1021

2211

222

221

21

112

121

11

2211

,,,,

n

mn

mn

mm

nn

nn

nn

xxx

bxaxaxa

bxaxaxa

bxaxaxa

xcxcxcz

:tosubject

:minimize

1,0,,,,,

13

242

2352

3123

:subject to

865237 :minimize

FEDCBA

FEA

EBA

DCB

CBA

FEDCBAz

AC

B E

F

D

primal graph

Applications: VLSI circuit design Scheduling Routing Combinatorial auctions Facility location …

Page 143: Combinatorial Optimization for Graphical Models

AND/OR Search Tree

1,0,,,,,

13

242

2352

3123

:subject to

865237 :minimize

FEDCBA

FEA

EBA

DCB

CBA

FEDCBAz

OR

AND

OR

AND

OR

OR

AND

AND

A

0

B

0

E

F F

0 1 0 1

0 1

C

D

1

0 1

1

E

F F

0 1 0 1

0 1

C

D

0 1

0 1

1

B

0

E

F F

0 0 1

0 1

C

D

1

0 1

1

E

F

0 1

0 1

C

D

0 1

0 1

Primal graph

Pseudo tree

Page 144: Combinatorial Optimization for Graphical Models

Weighted AND/OR Search Tree

AOR

0AND

BOR

0AND

OR

OR

AND

AND

1

C E

D F

1 0 1

0 10 1

1

FEDCBAzA 865237

5

5

5

0 = min(0,8)

-60-6 = min(0,-6)

-1 = (5-6)

w(A,0) = 0 w(A,1) = 7

0 8

0

05 = min(5,)

Node Value(bottom up)

OR – minimization

AND – summation

1,0,,,,,

13

242

2352

3123

:subject to

865237 :minimize

FEDCBA

FEA

EBA

DCB

CBA

FEDCBAz

Page 145: Combinatorial Optimization for Graphical Models

AND/OR Search Graph

AOR

0AND

BOR

0AND

OR E

OR F F

AND 0 1

AND 0 1

C

D

0 1

0

1

EC

D

0

1

B

0

E

F F

0 1

C

1

EC

1,0,,,,,

13

242

2352

3123

:subject to

865237 :minimize

FEDCBA

FEA

EBA

DCB

CBA

FEDCBAz

[A]

[BA]

[EA]

[F]

[CB]

[D]16 nodes (graph) vs. 54 nodes (tree)

Page 146: Combinatorial Optimization for Graphical Models

Experiments

Algorithms AOBB, AOBF – tree search AOBB+PVO, AOBF+PVO – tree search AOBB-C, AOBF-C – graph search lp_solve 5.5 CPLEX 11.0

Benchmarks Combinatorial auctions Uncapacitated warehouse location problems MAX-SAT instances

Implementation LP relaxation solved by lp_solve 5.5 library BB (lp_solve) baseline solver

Page 147: Combinatorial Optimization for Graphical Models

Combinatorial Auctions

Combinatorial auctions from regions-upv distribution with100 goods and increasing number of bids. Time limit 1 hour.

Very large treewidth [68, 184]

Page 148: Combinatorial Optimization for Graphical Models

Combinatorial Auctions

Combinatorial auctions from regions-upv distribution with100 goods and increasing number of bids. Time limit 1 hour.

Very large treewidth [68, 184]

Page 149: Combinatorial Optimization for Graphical Models

UWLP Instances

Tree search Tree searchGraph search

UWLP instances with 50 warehouses, 200 and 400 locations. Time limit 10 hours.

Page 150: Combinatorial Optimization for Graphical Models

MAX-SAT Instances (pret)

Tree search Tree searchGraph search

pret MAX-SAT instances. Time limit 10 hours.

BB solver could not solve any instance.

Page 151: Combinatorial Optimization for Graphical Models

MAX-SAT Instances (dubois)

dubois MAX-SAT instances. Time limit 3 hours. w*=6, h=20.

CPLEX, BB solvers could not solve any instance.

Page 152: Combinatorial Optimization for Graphical Models

Summary

New AND/OR search algorithms for 0-1 Integer Programming

Dynamic variable orderings Superior to baseline OR Branch-and-

Bound from the lp_solve library Competitive with state-of-the-art CPLEX

in terms of search space explored Outperform CPLEX on selected MAX-SAT

instances (e.g., pret, dubois)

Page 153: Combinatorial Optimization for Graphical Models

156

Outline Introduction Inference Search (OR) Lower-bounds and relaxations Exploiting problem structure in search

Other hybrids of search and inference Cutset decomposition Boosting search with VE Super-Bucket scheme

Software & Applications

Page 154: Combinatorial Optimization for Graphical Models

157

Solution Techniques

Search: Conditioning

Inference: Elimination

Complete

IncompleteSimulated Annealing

Gradient Descent

Complete

Incomplete

Adaptive ConsistencyTree Clustering

Dynamic ProgrammingResolution

Local Consistency

Unit Resolution mini-bucket(i)

Time: exp(w*)Space: exp(w*)

Time: exp(n)Space: linear

Hybrids:

Depth-first searchBranch-and-BoundA* search

Page 155: Combinatorial Optimization for Graphical Models

158

Search: Conditioning

Inference: EliminationAND/OR Graph search

Complete

IncompleteSimulated Annealing

Gradient Descent

Complete

Incomplete

Adaptive ConsistencyTree Clustering

Dynamic ProgrammingResolution

Local Consistency

Unit Resolution mini-bucket(i)

Time: exp(w*)Space:exp(w*)

AND/OR tree searchTime: exp(w* log n)Space: linear

Hybrids:

Solution Techniques

Depth-first searchBranch-and-BoundA* search

Page 156: Combinatorial Optimization for Graphical Models

159

Search: Conditioning

Inference: EliminationAND/OR Graph search

Complete

IncompleteSimulated Annealing

Gradient Descent

Complete

Incomplete

Adaptive ConsistencyTree Clustering

Dynamic ProgrammingResolution

Local Consistency

Unit Resolution mini-bucket(i)

Time: exp(w*)Space:exp(w*)

AND/OR tree searchTime: exp(w* log n)Space: linear

Hybrids:AND-OR(j)

Space: exp(j)Time: exp(mj)

Solution Techniques

Depth-first searchBranch-and-BoundA* search

Page 157: Combinatorial Optimization for Graphical Models

160

X1

X3

X5X4

X2

Search Basic Step: Conditioning

Page 158: Combinatorial Optimization for Graphical Models

161

X1

X3

X5X4

X2

• Select a variable

Search Basic Step: Conditioning

Page 159: Combinatorial Optimization for Graphical Models

162

X1

X3

X5X4

X2

X3

X5X4

X2

X3

X5X4

X2

X3

X5X4

X2

…...

…...

X1 aX1 b

X1 c

Search Basic Step: Conditioning

Page 160: Combinatorial Optimization for Graphical Models

163

X1

X3

X5X4

X2

X3

X5X4

X2

X3

X5X4

X2

X3

X5X4

X2

…...

…...

X1 aX1 b

X1 c

General principle:Condition until tractableThen solve sub-problemsefficiently

Search Basic Step: Variable Branching by Conditioning

Page 161: Combinatorial Optimization for Graphical Models

164

X1

X3

X5X4

X2

X3

X5X4

X2

X3

X5X4

X2

X3

X5X4

X2

…...

…...

X1 aX1 b

X1 c

Example: solve subproblem by inference, BE(i=2)

Search Basic Step: Variable Branching by Conditioning

Page 162: Combinatorial Optimization for Graphical Models

165

The Cycle-Cutset Scheme:Condition Until Treeness

• Cycle-cutset• i-cutset• C(i)-size of i-cutset

Space: exp(i), Time: O(exp(i+c(i))

Page 163: Combinatorial Optimization for Graphical Models

166

Eliminate First

Page 164: Combinatorial Optimization for Graphical Models

167

Eliminate First

Page 165: Combinatorial Optimization for Graphical Models

168

Eliminate First

Solve the rest of the problemby any means

Page 166: Combinatorial Optimization for Graphical Models

169

Hybrids Variants

Condition, condition, condition … and then only eliminate (w-cutset, cycle-cutset)

Eliminate, eliminate, eliminate … and then only search

Interleave conditioning and elimination (elim-cond(i), VE+C)

Page 167: Combinatorial Optimization for Graphical Models

170

Interleaving Conditioning and Elimination(Larrosa & Dechter, CP’02)

Page 168: Combinatorial Optimization for Graphical Models

171

Interleaving Conditioning and Elimination

Page 169: Combinatorial Optimization for Graphical Models

172

Interleaving Conditioning and Elimination

Page 170: Combinatorial Optimization for Graphical Models

173

Interleaving Conditioning and Elimination

Page 171: Combinatorial Optimization for Graphical Models

174

Interleaving Conditioning and Elimination

Page 172: Combinatorial Optimization for Graphical Models

175

Interleaving Conditioning and Elimination

Page 173: Combinatorial Optimization for Graphical Models

176

Interleaving Conditioning and Elimination

...

...

Page 174: Combinatorial Optimization for Graphical Models

177

Time-space Tradeoffs AO(j): DFS search of AO, caches j-context

j = max number of variables in a context AO j-cutset Elimination-conditioning(j)

j=0

j=w*

Space: O(n)

Time: O(exp(w* log n))

Space: O(exp w*)

Time: O(exp w*)Space: O(exp(j) )

Time: O(exp(m(j)+j )

m(j) - AO depth of w-cutset

j

Page 175: Combinatorial Optimization for Graphical Models

178

Random Graphs (50 nodes, 200 edges, average degree 8, w*23)

Branch and bound

Bucket elimination

0

10

20

30

40

50

60

-1 2 5 8 11 14 17 20 23 26 29 32

w

W+

c(w

)

space

tim

eTime vs. Space for w-cutset

Page 176: Combinatorial Optimization for Graphical Models

179

AND/OR i-cutset

A

C

B K

G L

D F

H

M

J

E

AC

B K

G

L

D

FH

M

J

E

A

C

B K

G L

D F

H

M

J

E

C

B K

G

L

D

FH

M

J

E

3-cutset

A

C

B K

G L

D F

H

M

J

E

C

K

G

L

D

FH

M

J

E

2-cutset

A

C

B K

G L

D F

H

M

J

E

L

D

FH

M

J

E

1-cutset

Page 177: Combinatorial Optimization for Graphical Models

180

Summary: Hybrid Time/Space in Variable-models

Cutset schemes i-cutset Condition-elim(i) AO(i)

Super-bucket(i) AO(i) avoids some dead-caches

Combine: i-cutset in an i super-bucket…

Page 178: Combinatorial Optimization for Graphical Models

181

Algorithms for AND/OR Space Back-jumping for CSPs

(Gaschnig 1977), (Dechter 1990), (Prosser, Bayardo & Mirankar, 1995)

Pseudo-search re-arrangement, for any CSP task (Freuder & Quinn 1985)

Recursive Conditioning (Darwiche, 2001), explores the AND/OR tree or graph for any query

BTD: Searching tree-decompositions for optimization(Jeagou & Terrioux, 2000)

Pseudo-tree search for soft constraints (Larrosa, Meseguer & Sanchez, 2002)

Valued-elimination (Bacchus, Dalmao & Pittasi, 2003)

Arc-consistency for soft constraints (Larrosa & Schiex, 2003)

Page 179: Combinatorial Optimization for Graphical Models

182

Conclusions

Only a few principles:

1. Inference and search should be combined time-space

2. AND/OR search should be used3. Heuristics using approximation of

inference (mini-bucket, GBP)4. Caching in search should be used

Page 180: Combinatorial Optimization for Graphical Models

183

Outline Introduction Inference Search (OR) Lower-bounds and relaxations Exploiting problem structure in search Other hybrids of search and inference

Software & Applications aolib, toulbar2 and other related software packages Pedigree analysis, CELAR, SPOT5 Results from UAI-06, CP-06 and UAI-08 solver

competitions

Page 181: Combinatorial Optimization for Graphical Models

184

Software

Reports on competitions UAI’06 Inference Evaluation

57 MPE instances CP’06 Competition

686 2-ary MAX-CSP instances 135 n-ary MAX-CSP instances

How to use the software http://csp.ics.uci.edu/group/Software

Page 182: Combinatorial Optimization for Graphical Models

185

UAI’06 Inference Evaluation

MPE solver – AOMB(i, j) Node value v(n): most probable

explanation of the sub-problem rooted by n Caching: identical sub-problems rooted at

AND nodes (identified by their contexts) are solved once and the results cached

j-bound (context size) controls the memory used for caching

Heuristics: pruning is based on heuristics estimates which are pre-computed by bounded inference (i.e. mini-bucket approximation)

i-bound (mini-bucket size) controls the accuracy of the heuristic

No constraint propagation

Page 183: Combinatorial Optimization for Graphical Models

186

UAI’06 Competitors

Team 1 UCLA

David Allen, Mark Chavira, Arthur Choi, Adnan Darwiche

Team 2 IET

Masami Takikawa, Hans Dettmar, Francis Fung, Rick Kissh

Team 5 (ours) UCI

Radu Marinescu, Robert Mateescu, Rina Dechter

Page 184: Combinatorial Optimization for Graphical Models

187

UAI’06 Results

0

38.6

7.01

0

5

10

15

20

25

30

35

40

Fai

lure

Rat

e (p

erce

nt)

Team 1Team 2

Team 5

MPE Failure Rate Results

Page 185: Combinatorial Optimization for Graphical Models

188

UAI’06 Results

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

Ran

k P

rop

ort

ion

s

Team 1Team 2

Team 5

Rank 1 Rank 2 Rank 3 Fail

Rank Proportions (how often was each team a particular rank, rank 1 is best)

Page 186: Combinatorial Optimization for Graphical Models

189

CP’06 Competition

MAX-CSP solver AND/OR Branch-and-Bound tree search with

EDAC heuristics and dynamic variable orderings

aolibdvo v. 0.5 AOBB + EDAC + DVO (dynamic variable ordering)

aolibpvo v. 0.5 AOBB + EDAC + PVO (partial variable ordering)

No constraint propagation

Page 187: Combinatorial Optimization for Graphical Models

190

CP’06 Competitors

Solvers AbsconMax aolibdvo (ours) aolibpvo (ours) CSP4J-MaxCSP Toolbar Toolbar_BTD Toolbar_MaxSAT Toulbar2

Page 188: Combinatorial Optimization for Graphical Models

191

CP’06 ResultsOverall ranking on all selected competition benchmarks

1

2

3

4

5

The longest dark green bar wins

Page 189: Combinatorial Optimization for Graphical Models

192

Outline/Summary Introduction

Graphical models Optimization tasks for graphical models Fundamental operations on cost functions

Inference Bucket Elimination, Bucket-Tree and Cluster-Tree Elimination Polynomial classes based on structure

Search (OR) Branch-and-Bound and Best-First Search Local search and Partial search

Lower-bounds and relaxations Bounded inference, local consistency and continuous

relaxations Exploiting problem structure in search

AND/OR search spaces (trees, graphs) Other hybrids of search and inference

Cutset decomposition, boosting search with VE, super-bucket scheme

Software & Applications