260 likes | 371 Views
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 choueiry@cse.unl.edu Tel: +1(402)472-5444. Outline. Backtrack-Free Search Principle Applications
E N D
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 choueiry@cse.unl.edu Tel: +1(402)472-5444 Tree-Structured CSPs
Outline • Backtrack-Free Search • Principle • Applications • Backtrack-Bounded Search • Principle • Applications, extensions Tree-Structured CSPs
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
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
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 YalingZheng 2007 Tree-Structured CSPs
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
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
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
Outline • Backtrack-Free Search • Principle • Applications • Backtrack-Bounded Search • Principle • Applications, extensions Tree-Structured CSPs
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
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
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
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
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
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
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
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
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(nt 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
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
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 • Each constraint appears in at least on node in the tree, and all its variables are in that node • Nodes where any variable appears induce a single connected subtree (connectedness property) Tree-Structured CSPs
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
Structural decomposition methods HYPERTREE Gottlob et al., 2002 HYPERCUTSET Gottlob et al., 2000 HINGETCLUSTER Gyssens et al., 1994 HINGE+ CaT TRAVERSE TCLUSTER Dechter & Pearl, 1989 HINGE Gyssens et al., 1994 CUT CUTSET Dechter, 1987 BICOMP Freuder, 1985 The techniques in blue were proposed by Yaling Zheng in 2005. Tree-Structured CSPs
Constraint hypergraph S3 S5 S9 S6 S7 S8 S10 S17 S1 S16 S2 S15 S4 S11 S12 S13 S14 • 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 Tree-Structured CSPs
HINGE [Gyssens et al., 94] S9 S3 S5 S6 S7 S8 S10 S17 S1 S16 S2 S15 S4 S11 S12 S13 S14 In HINGE, the cut size is limited to 1 S9 S10 S3 S5 S6 S7 S8 S2 S9 S1 S2 S9 S16 S4 S11 S12 S13 S14 hw = 12 S9 S15 S11 S17 Tree-Structured CSPs
HINGE+: maximum cut size is a parameter S9 S3 S5 S6 S7 S8 S10 S17 S1 S16 S2 S15 S4 S11 S12 S13 S14 HINGE+ with maximum cut size of 2: S9 S10 S3 S8 S8 S6 S4 S6 S2 S14 S14 S12 S1 S2 S9 S16 S5 S12 S4 S7 S7 S9 S11 S5 S13 hw = 5 S13 S9 S15 S11 S17 Tree-Structured CSPs
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