foundations of constraint processing csce421/821, spring 2008:

26
Foundations of Constraint Processing, Spring 2008 April 16, 2008 Tree-Structured CSPs 1 Foundations of Constraint Processing CSCE421/821, Spring 2008: www.cse.unl.edu/~choueiry/S08-421-821/ Berthe Y. Choueiry (Shu-we-ri) Avery Hall, Room 123B [email protected] Tel: +1(402)472-5444 Tree-Based Methods

Upload: bethan

Post on 06-Jan-2016

21 views

Category:

Documents


0 download

DESCRIPTION

Tree-Based Methods. Foundations of Constraint Processing CSCE421/821, Spring 2008: www.cse.unl.edu/~choueiry/S08-421-821/ Berthe Y. Choueiry (Shu-we-ri) Avery Hall, Room 123B [email protected] Tel: +1(402)472-5444. Outline. Backtrack-Free Search Principle Applications - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008 Tree-Structured CSPs 1

Foundations of Constraint Processing

CSCE421/821, Spring 2008:

www.cse.unl.edu/~choueiry/S08-421-821/

Berthe Y. Choueiry (Shu-we-ri)

Avery Hall, Room 123B

[email protected]

Tel: +1(402)472-5444

Tree-Based Methods

Page 2: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Outline

• Backtrack-Free Search- Principle- Applications

- Backtrack-Bounded Search- Principle- Applications, extensions

Tree-Structured CSPs 2

Page 3: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Backtrack-Free Search [Freuder, 1982]

• A CSP can be solved in a backtrack-free manner when it is strong w+1-consistent, where w is the width of the constraint network– Compute w the width of the graph– Reinforce strong w-consistency– May add arcs to the graph, increasing width and

requiring higher-level of strong consistency, etc.

• Approach is of little practical use• Except for trees, width = 1

Tree-Structured CSPs 3

Page 4: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Tree-structured CSPs

• Trees have w = 1

• Enforcing 2-consistency does not alter the width

• Tree-structured CSPs can be solved in polynomial time– Apply Revise(Vi,Vj) for all nodes from leaves

to root– Instantiate variables from root to leaves

Tree-Structured CSPs 4

Page 5: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Exploiting tree structures

• Cycle-Cutset Method – Dechter and Pearl 1997– Dechter Section 10.1.1 pages 273—276

• Independent Set Decomposition– Gompert, FLAIRS 2005

• Graph Reduction (GRED) – Unpublished work by Yaling Zheng 2007

Tree-Structured CSPs 5

Page 6: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Cycle-Cutset Method (1)• Identify a cycle cutset S in the CSP (nodes when

removed yield a tree)• Decompose the CSP into 2 partitions

– The nodes in S– The nodes in T, forming a tree

• Idea– Solve the nodes in S– Try to extend the solution to nodes in T– Iterate

Tree-Structured CSPs 6

Page 7: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Cycle-Cutset Method (2)

• Find a solution to nodes in S (S is smaller than initial problem)

• Repeat until you find a solution – For every solution to S

• Apply DAC from S to T• If no domain is wiped-out, solve T (quick)

• If |S|=c, time is O(dc.(n-c)d2)=O(ndc+2)

• Finding the smallest cutset is NP-hard

Tree-Structured CSPs 7

Page 8: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

GRED [Yaling Zheng]

• After each assignment and FC/MAC step– Check the connectivity of the remaining CSP– Identify “dangling trees” using Graham’s graph

reduction operator

• For each dangling tree, – Do DAC from leaf to root – Domain wipe-out indicates unsolvability

• Restrict search to nodes outside the identified dangling trees

Tree-Structured CSPs 8

Page 9: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Outline

• Backtrack-Free Search- Principle- Applications

- Backtrack-Bounded Search- Principle- Applications, extensions

Tree-Structured CSPs 9

Page 10: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

j-width [Freuder, 1985]

• Given an ordering– The width of a group of j consecutive nodes is

• the number of nodes

• preceding the j nodes in the group and

• connected to any of them

– The j-width of a node is the minimum, for k=1 to j, of the width of the k consecutive nodes up to and including the node.

– The j-width of an ordering is the maximum j-width of all nodes in the ordering

• The j-width of a graph is the minimum of all j-width of all orderings

Tree-Structured CSPs 10

Page 11: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Separable Graphs (graphs with articulation points)

• Consider a CSP whose graph has articulation nodes

• Assume that the largest biconnected component has size b

• Build a tree whose nodes are the biconnected components, considering that the articulation node belong to the parent

• Build an ordering using a preorder traversal of the tree– The (b-1)-width of the ordering is 1

Tree-Structured CSPs 11

Page 12: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

b-Bounded Search

• If for any level h in the search, – We can instantiate variable at level h+1– Considering its possible values, and– Reconsidering at most b-1 previous variables

• In a graph with articulation nodes, – let b be the size of the largest biconnected

component– Ordering the graph ‘along’ its biconnected

components guarantees b-bounded search

Tree-Structured CSPs 12

Page 13: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

j-bounded search and j-width• There is an ordering

– That guarantees k-bounded backtrack search – If the graph strongly (i,k)-consistent, where i = j-width

• Problem: enforcing strong (i,k)-consistency may increase the j-width..

• Idea: Consider (1,k)-consistency– (Strong) (1,k)-consistency can be enforced without

altering the structure of the graph – Cost: time exponential in k+1

Tree-Structured CSPs 13

Page 14: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Achieving (1,k)-consistency

• Achieving (strong) k-consistency via the constraint synthesis algorithm– Freuder shows that it also achieves (strong)

(i,j)-consistency for i+j=k, time exponential in k

• Consider the original CSP– Remove the filtered values from the domains,

updating the binary constraints– The resulting network is (1,k)-consistent w/o

altering the graph

Tree-Structured CSPs 14

Page 15: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Graphs with articulation points

• Graphs whose largest biconnected component if b have (b-1)-width = 1

• Enforcing (1,b-1)-consistency • Can be enforced in time exponential in b• While guaranteeing (b-1)-bounded search

Result• A CSP can be solved in time exponential in b where b

is the size of its largest biconnected component

Tree-Structured CSPs 15

Page 16: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Exploiting Separable Graphs

• Tree-Clustering Method– Dechter & Pearl, AIJ 1989– Dechter Section 9.2.1 (Join Tree Clustering)

• Generalization: Tree decompositions– Hinge,Hypertree, etc.

Tree-Structured CSPs 16

Page 17: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Tree-Clustering Method

• Sketch of algorithm – Triangulate the graph (MinFill, Fig 4.4, page 89)

– Find maximal cliques (Max-Cardinality, Fig 4.5, page 90)

– Create a tree structure over the cliques– Repeat

• Solve a clique (all solutions), at each node in tree• Apply DAC from leaves to root• Generate solutions in a BT-free manner

Tree-Structured CSPs 17

Page 18: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Tree-Clustering Method: Complexity

• n: number of variables• Triangulation: O(n2)

– MinFill and MaxCardinality: O(n+e)

• Finding cliques: linear in n• Solving clusters: O(kr), k is domain size, r is size of

largest clique• Generating a solution O(n t log t)

– t is #tuples in each cluster, (sorted) domain of a ‘super’ variable – in best case, we have n cliques

• Complexity bounded by size of largest clique:– O(n2)+O(kr)+O(n t log t)=O(n kr log kr)=O(n r kr)

Tree-Structured CSPs 18

Page 19: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Tree Decompositions• Tree must obey specific properties• Inspired from Database Theory (acyclic queries)• Studied for non-binary CSPs• Complexity of solving the CSP is bounded by a ‘width’

parameter – Max number of nodes in cluster– Max number of constraints in cluster

• Used to characterize tractable classes of CSPs• Little use beyond theoretical characterization, except

BTD/BTD+ by Jégou et al.

Tree-Structured CSPs 19

Page 20: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Tree decomposition Def 9.4, p. 257

• A tree decomposition (T, ,) of a CSP P=(X,D,C) where

• T=(V,E), = chi, =psi: labeling functions (v) X, (v) C

1. Each constraint appears in at least on node in the tree, and all its variables are in that node

2. Nodes where any variable appears induce a single connected subtree (connectedness property)

Tree-Structured CSPs 20

Page 21: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Parameters of a tree decomposition

• Treewidth (tw)– Maximum number of variables in any node in

tree - 1

• Hyperwidth (hw)– Maximum number of constraints in any node

in tree

• Separator of two nodes– Number of common variables

Tree-Structured CSPs 21

Page 22: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008 Tree-Structured CSPs 22

HINGETCLUSTER

Gyssens et al., 1994HYPERCUTSETGottlob et al., 2000

TCLUSTERDechter & Pearl,

1989

BICOMPFreuder, 1985

HYPERTREEGottlob et al., 2002

HINGEGyssens et al.,

1994

CaT

CUT

HINGE+ TRAVERSE

CUTSETDechter, 1987

Structural decomposition methods

The techniques in blue were proposed by Yaling Zheng in 2005.

Page 23: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Constraint hypergraph

Tree-Structured CSPs 23

S1 S2

S4

S3 S5 S7S6

S15

S8

S12 S13 S14S11

S10

S9

S16S17

• A vertex represents a variable• A hyperedge represents a constraint (delimits

its scope)• Cut is a set of hyperedges whose removal

disconnects the graph• Cut size is the number of hyperedges in the cut

Page 24: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

HINGE [Gyssens et al., 94]

Tree-Structured CSPs 24

S2

S4

S3 S5 S7S6 S8

S12 S13 S14S11

S9

hw = 12

S1 S2

S4

S3 S5 S7S6

S15

S8

S12 S13 S14S11

S10

S9

S16S17

S10S9

S16S9

S15S9

S17S11

S1 S2

In HINGE, the cut size is limited to 1

Page 25: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

HINGE+: maximum cut size is a parameter

Tree-Structured CSPs 25

S2

S4

S3

S5

S7

S6

S12

S13

S11S9

S16

S17

S9

S11

S5

S4S6

S12

S8

S14

hw = 5

S1 S2

S4

S3 S5 S7S6

S15

S8

S12 S13 S14S11

S10

S9

S16S17

S8

S14

S7

S13

S10S9

S15S9

S1 S2

HINGE+ with maximum cut size of 2:

Page 26: Foundations of Constraint Processing CSCE421/821, Spring 2008:

Foundations of Constraint Processing, Spring 2008

April 16, 2008

Bibliography• [Freuder, 1982] A Sufficient Condition for Backtrack Free Search,

JACM 29 (1), pages 24—32.• [Freuder, 1985] A Sufficient Condition for Backtrack Bounded

Search, JACM.• [Dechter & Pearl, 1987] The Cycle-Cutset Method for improving

Search Performance in AI Applications. In Third IEEE Conference on AI Applications, pages 224–230.

• [Dechter and Pearl, 1989] R. Dechter and J. Pearl. Tree Clustering for Constraint Networks. Artificial Intelligence, 38:353–366.

Tree-Structured CSPs 26