Title: Foundations of Constraint Processing
1Tree-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_at_cse.unl.edu
- Tel 1(402)472-5444
2Outline
- Backtrack-Free Search
- Principle
- Applications
- Backtrack-Bounded Search
- Principle
- Applications, extensions
3Backtrack-Free Search Freuder, 1982
- A CSP can be solved in a backtrack-free manner
when it is strong w1-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
4Tree-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
5Exploiting tree structures
- Cycle-Cutset Method
- Dechter and Pearl 1997
- Dechter Section 10.1.1 pages 273276
- Independent Set Decomposition
- Gompert, FLAIRS 2005
- Graph Reduction (GRED)
- Unpublished work by Yaling Zheng 2007
6Cycle-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
7Cycle-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 Sc, time is O(dc.(n-c)d2)O(ndc2)
- Finding the smallest cutset is NP-hard ?
8GRED Yaling Zheng
- After each assignment and FC/MAC step
- Check the connectivity of the remaining CSP
- Identify dangling trees using Grahams 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
9Outline
- Backtrack-Free Search
- Principle
- Applications
- Backtrack-Bounded Search
- Principle
- Applications, extensions
10j-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 k1 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
11Separable 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
12b-Bounded Search
- If for any level h in the search,
- We can instantiate variable at level h1
- 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
13j-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 k1
14Achieving (1,k)-consistency
- Achieving (strong) k-consistency via the
constraint synthesis algorithm - Freuder shows that it also achieves (strong)
(i,j)-consistency for ijk, 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
15Graphs 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
16Exploiting Separable Graphs
- Tree-Clustering Method
- Dechter Pearl, AIJ 1989
- Dechter Section 9.2.1 (Join Tree Clustering)
- Generalization Tree decompositions
- Hinge,Hypertree, etc.
17Tree-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
18Tree-Clustering Method Complexity
- n number of variables
- Triangulation O(n2)
- MinFill and MaxCardinality O(ne)
- 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)
19Tree 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.
20Tree 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)
21Parameters 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
22Structural decomposition methods
HYPERTREE Gottlob et al., 2002
HINGETCLUSTER Gyssens et al., 1994
HYPERCUTSET Gottlob et al., 2000
CaT
HINGE
TRAVERSE
TCLUSTER Dechter Pearl, 1989
HINGE Gyssens et al., 1994
CUT
BICOMP Freuder, 1985
CUTSET Dechter, 1987
The techniques in blue were proposed by Yaling
Zheng in 2005.
23Constraint hypergraph
S3
S5
S9
S7
S6
S8
S10
S17
S1
S16
S2
S15
S4
S12
S13
S14
S11
- 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
24HINGE Gyssens et al., 94
S9
S3
S5
S7
S6
S8
S10
S17
S1
S16
S2
S15
S4
S12
S13
S14
S11
In HINGE, the cut size is limited to 1
S10
S9
S3
S5
S7
S6
S8
S2
S9
S1
S2
S16
S9
S4
S12
S13
S14
S11
hw 12
S15
S9
S17
S11
25HINGE maximum cut size is a parameter
S9
S3
S5
S7
S6
S8
S10
S17
S1
S16
S2
S15
S4
S12
S13
S14
S11
HINGE with maximum cut size of 2
S10
S9
S3
S8
S8
S6
S6
S4
S2
S14
S14
S12
S1
S2
S16
S9
S12
S5
S4
S7
S7
S9
S11
S5
S13
hw 5
S13
S15
S9
S17
S11
26Bibliography
- Freuder, 1982 A Sufficient Condition for
Backtrack Free Search, JACM 29 (1), pages 2432. - 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 224230. - Dechter and Pearl, 1989 R. Dechter and J.
Pearl. Tree Clustering for Constraint Networks.
Artificial Intelligence, 38353366.