1 Hybrid of search and inference: time- space tradeoffs chapter 10 ICS-275 Spring 2007
ICS Reasoning Methods Our focus - search and elimination Search (“guessing” assignments, reasoning by assumptions) Branch-and-bound (optimization) Backtracking search (CSPs) Cycle-cutset (CSPs, belief nets) Variable elimination (inference, “propagation” of constraints, probabilities, cost functions) Dynamic programming (optimization) Adaptive consistency (CSPs) Joint-tree propagation (CSPs, belief nets)
Spring 2007 ICS Chapter 10: Hybrids of Search and Inference Interleaving conditioning and elimination Cutset decomposition AND/OR cutset decomposition Super-bucket and super-clusters Approximating conditioning in a hybrid
Spring 2007 ICS Satisfiability: Inference vs search Search = O(exp(n)) Search = exp(dfs-height)
Spring 2007 ICS DR versus DPLL: Complementary Properties Uniform random 3-CNFs (large induced width) (k,m)-tree 3-CNFs (bounded induced width )
Spring 2007 ICS Exact CSP techniques: complexity
Spring 2007 ICS Outline; Road Map Methods Tasks
Spring 2007 ICS The effect of Conditioning X1X1 X3X3 X5X5 X4X4 X2X2
Spring 2007 ICS The effect of Conditioning X1X1 X3X3 X5X5 X4X4 X2X2 Select a variable
Spring 2007 ICS The effect of Conditioning X1X1 X3X3 X5X5 X4X4 X2X2 X3X3 X5X5 X4X4 X2X2 X3X3 X5X5 X4X4 X2X2 X3X3 X5X5 X4X4 X2X2 …... X 1 a X 1 b X 1 c
Spring 2007 ICS The effect of Conditioning X1X1 X3X3 X5X5 X4X4 X2X2 X3X3 X5X5 X4X4 X2X2 X3X3 X5X5 X4X4 X2X2 X3X3 X5X5 X4X4 X2X2 …... X 1 a X 1 b X 1 c Condition on X 2, and BE or BE(w=2) now.
Spring 2007 ICS The effect of Conditioning X1X1 X3X3 X5X5 X4X4 X2X2 X3X3 X5X5 X4X4 X2X2 X3X3 X5X5 X4X4 X2X2 X3X3 X5X5 X4X4 X2X2 …... X 1 a X 1 b X 1 c General principle: Condition until tractable
Spring 2007 ICS Interleaving Cond and Elim (VE+C)
Spring 2007 ICS Interleaving Cond and Elim
Spring 2007 ICS Interleaving Cond and Elim
Spring 2007 ICS Interleaving Cond and Elim
Spring 2007 ICS Interleaving Cond and Elim
Spring 2007 ICS Interleaving Cond and Elim
Spring 2007 ICS Interleaving Cond and Elim...
Spring 2007 ICS Interleaving Cond and Elim...
Spring 2007 ICS Interleaving Cond and Elim...
Spring 2007 ICS Interleaving Cond and Elim...
Spring 2007 ICS Interleaving Cond and Elim...
Spring 2007 ICS Interleaving Cond and Elim...
Spring 2007 ICS Interleaving Cond and Elim...
Spring 2007 ICS Interleaving Cond and Elim...
Spring 2007 ICS Interleaving Cond and Elim...
Spring 2007 ICS
Spring 2007 ICS DCDR(b): empirical results
Spring 2007 ICS Road Map Interleaving conditioning and elimination Cutset decomposition W-cutset, cycle-cutset AND/OR w-cutset Super-bucket and super-clusters
Spring 2007 ICS Cycle cutset C P J A L B E D F M O H K G N C P J L B E D F M O H K G N A C P J L E D F M O H K G N B P J L E D F M O H K G N C Cycle cutset = {A,B,C} C P J A L B E D F M O H K G N C P J L B E D F M O H K G N C P J L E D F M O H K G N C P J A L B E D F M O H K G N
Spring 2007 ICS Conditioning and cycle-cutset A=yellow A=green Inference may require too much memory Condition (guessing) on some of the variables C B K G L D F H M J E C B K G L D F H M J E A C B K G L D F H M J E Graph Coloring problem
Spring 2007 ICS Conditioning A=yellow A=green B=redB=blueB=redB=blueB=greenB=yellow C K G L D F H M J E C K G L D F H M J E C K G L D F H M J E C K G L D F H M J E C K G L D F H M J E C K G L D F H M J E Inference may require too much memory Condition on some of the variables A C B K G L D F H M J E Graph Coloring problem
Spring 2007 ICS The cycle-cutset scheme: condition until a tree
Spring 2007 ICS Theorem: The w-cutset scheme yields space complexity exp(w) and time complexity exp(w+c_w), where c_w is the size of the w-cutset. As w decreases, c_w increases. The cycle-cutset decomposition is linear space and Has time complexity of Time-space tradeoff
Spring 2007 ICS Elim-cond(w) or w-cutset scheme Idea: runs backtracking search on the w-cutset variables and bucket-elimination on the remaining variables. Input: A constraint network R = (X,D,C), Y a w-cutset, d an ordering that starts with Y whose adjusted induced-width, along d, is bounded by w, Z = X-Y. Output: A consistent assignment, if there is one. 1. while {y} next partial solution of Y found by backtracking, do a) z solution found by adaptive-consistency(R_y). B) if z is not false, return solution (y,z). 2. endwhile. return: the problem has no solutions.
Spring 2007 ICS Finding a w-cutset Verifying a w-cutset can be done in polynomial time A simple greedy: use a good induced-width ordering and starting at the top add to the w- cutset any variable with more than w parents. Alternative: generate a tree-decomposition and select a w-cutset that reduce each cluster below w (Bidyuk and Dechter UAI2005).
Spring 2007 ICS Treewidth equals cycle cutset E K F H C B A L G J D M N K C A L G J D M N treewidth = cycle cutset = 4
Spring 2007 ICS Treewidth smaller than cycle cutset E K F H C B A L G J D F C B G D E treewidth = 2 cycle cutset = 5
Spring 2007 ICS Time-Space complexity of of w-cutset Space: O(exp(w)) W -cutset: a set that when removed the induced- width is w. c(w): size of w-cutset. Time: O(exp(w+c(w))) on OR space
Spring 2007 ICS Time vs space Random Graphs (50 nodes, 200 edges, average degree 8, w* 23) Branch and bound Bucket elimination w W+c(w)
Spring 2007 ICS BDR-DP(i): bounded resolution + backtracking Complete algorithm: run BDR(i) as preprocessing before the Davis-Putnam backtracking algorithm. Empirical results: random vs. structured (low-w*) problems:
Spring 2007 ICS DCDR(b): empirical results (Rish and Dechter 2000)
Spring 2007 ICS Empirical evaluation of w-cutset Cycle-cutset for CSPs (dechter 1990) Alternating w-cutset for cnfs (Rish and Dechter 2000) Alternating w-cutset for Constraint optimization (Larrosa and Dechter, 2002)
Spring 2007 ICS The idea of super-buckets Larger super-buckets (cliques) =>more time but less space Complexity: 1.Time: exponential in clique (super-bucket) size 2.Space: exponential in separator size
Spring 2007 ICS Example
Spring 2007 ICS Super-Bucket Elimination, SBE(k) Eliminate sets of variables such that: individual eliminations are too costly in space (namely, each variable in the set has degree larger than k) the join degree is lower than k
Spring 2007 ICS Sep-based time-space tradeoff Let T be a tree-decomposition of hypergraph H. Let s_0,s_1,...,s_n be the sizes of the separators in T, listed in strictly descending order. With each separator size s_i we associate a secondary tree decomposition T_i, generated by combining adjacent nodes whose separator sizes are strictly greater than s_i. We denote by r_i the largest set of variables in any cluster of T_i. Note that as s_i decreases, r_i increase. Theorem: The complexity of CTE when applied to each T_i is O( n exp(r_i)) time, and O( n exp(s_i)) space.
Spring 2007 ICS Complexity Theorem: If R = (X,D,C) is a constraint network whose constraint graph has non-separable components of at most size r, then the super-bucket elimination algorithm, whose buckets are the non- separable components, is time exponential O(n exp(r)) and is linear in space.
Spring 2007 ICS Hybrids of hybrids hybrid(b_1,b_2): First, a tree-decomposition having separators bounded by b_1 is created, followed by application of the CTE algorithm, but each clique is processed by elim-cond(b_2). If c^*_{b_2} is the size of the maximum b_2-cutset in each clique of the b_1-tree- decomposition, the algorithm is space exponential in b_1 but time exponential in c^*_{b_2}. Special cases: hybrid(b_1,1): Applies cycle-cutset in each clique. b_1 = b_2. For b=1, hybrid(1,1) is the non-separable components utilizing the cycle-cutset in each component. The space complexity of this algorithm is linear but its time complexity can be much better than the cycle-cutsets cheme or the non-separable component approach alone.
Spring 2007 ICS Case study: circuit diagnosis Problem: Given a circuit and its unexpected output, identify faulty components. The problem can be modeled as a constraint optimization problem and solved by bucket elimination.
Spring 2007 ICS Case study: combinatorial circuits: benchmark used for fault diagnosis and testing community Problem: Given a circuit and its unexpected output, identify faulty components. The problem can be modeled as a constraint optimization problem and solved by bucket elimination.
Spring 2007 ICS Case study: C432 A circuit’s primal graph For every gate we connect inputs and outputs Join-tree of c432 Seperator size is 23
Spring 2007 ICS Join-tree of C3540 (1719 vars) max sep size 89
Spring 2007 ICS Secondary trees for C432
Spring 2007 ICS Time-space tradeoffsTime/Space tradeoff Time is measured by the maximum of the separator size and the cutset size and space by the maximum separator size.
Spring 2007 ICS Constraint Optimization: Combinatorial Auction: Bucket-elimination vs Search b1 b2 b3 b4 b5 b6 Bucket-elimination = Dynamic programming Bucket-elimination: In a bucket sum costs and maximize over constrained assignments: b2b2 b1b1 b3b3 b4b4 b5b5 b6b6 Search: Branch and Bound or Best-first search.
Spring 2007 ICS Recursive-search: a linear space search guided by a tree-decomposition Given a tree network, we identify a node x_1 which, when removed, generates two subtrees of size n/2 (approximately). T_n is the time to solve a binary tree starting at x_1. T_n obeys recurrence T_n = k 2 T_n/2, T_1 = k We get: T_n = n k^{logn +1} Given a tree-decomposition having induced-width w* this generalize to recursive conditioning of tree-decompositions: T_n = n k^({w*+1} log n) because the number of values k is replaced by th enumber of tuples k^w*
Spring 2007 ICS Road Map Interleaving conditioning and elimination Cutset decomposition AND/OR cutset decomposition Super-bucket and super-clusters Time-space curves
Spring 2007 ICS OR Conditioning A=yellow A=green B=redB=blueB=redB=blueB=greenB=yellow C K G L D F H M J E C K G L D F H M J E C K G L D F H M J E C K G L D F H M J E C K G L D F H M J E C K G L D F H M J E Inference may require too much memory Condition on some of the variables A C B K G L D F H M J E Graph Coloring problem
Spring 2007 ICS AND/OR w-cutset A C BK G L DF H M J E A C B K G L D F H M J E A C BK G L DF H M J E C B K G L D F H M J E 3-cutset A C BK G L DF H M J E C K G L D F H M J E 2-cutset A C BK G L DF H M J E L D F H M J E 1-cutset
Spring 2007 ICS Selecting an AND/OR w-cutset A C B K G L D F H M J E A C B K G L D F H M J E A C B K G L D F H M J E pseudo tree1-cutset treegrahpical model
Spring 2007 ICS Searching AND/OR Graphs AO(j): searches depth-first, cache i-context j = the max size of a cache table (i.e. number of variables in a context) j=0j=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 j-cutset j
Spring 2007 ICS Conceptual difference Traditional (w) cutset: Minimize the number of nodes Improve by organizing in AND/OR tree AND/OR (w) cutset: Minimize depth of AND/OR cutset tree
Spring 2007 ICS AND/OR (w) cutset properties THEOREM: Given a graphical model, |Cutset | ≥ depth(Cutset) ≥ depth(AO-Cutset) The inequalities are often strict. Cutset = minimal cardinality (w) cutset depth(Cutset)= minimal depth over pseudo trees for Cutset AO-Cutset= minimal depth AND/OR (w) cutset
Spring 2007 ICS How to find the AND/OR (w) cutset Finding the minimal depth AND/OR (w) cutset is NP hard Heuristics for AND/OR w-cutset Min-Fill – (for large w) Min-Depth – (for small w)
Spring 2007 ICS Quality of start pseudo trees CPCS 422 network
Spring 2007 ICS Improved caching scheme context(X k ) = [X 1 X 2 …X k ] i-bound < k X1X1 A X K-i XkXk X K-i+1 context(X k ) = [X k-i+1 …X k ] in conditioned subproblem Cache for X k is purged for every new instantiation of X k-i X1X1 A X K-i XkXk X K-i+1
Spring 2007 ICS Experimental results Measures Time Networks Random, Genetic Linkage Algorithms AO(i) – AO with caching full contexts (No Caching on Cutset) + (AO Search) (Caching on Cutset) + (AO Search) (Caching on Cutset) + (BE)
Spring 2007 ICS Random networks (Time) N=40, K=3, P=2, 20 instances, w*=7 i-boundAlgorithmsdepthTime(sec) MinFillMinDepthMinFillMinDepth 1AO(i) (No Caching on Cutset) + (AO Search) (Caching on Cutset) + (AO Search) (Caching on Cutset) + (BE) AO(i) (No Caching on Cutset) + (AO Search) (Caching on Cutset) + (AO Search) (Caching on Cutset) + (BE) AO(i) (No Caching on Cutset) + (AO Search) (Caching on Cutset) + (AO Search) 0.55 (Caching on Cutset) + (BE)
Spring 2007 ICS Random networks (Time) N=60, K=3, P=2, 20 instances, w*=11 i-boundAlgorithmsdepthTime(sec) MinFillMinDepthMinFillMinDepth 6(No Caching on Cutset) + (AO Search) (Caching on Cutset) + (AO Search) (Caching on Cutset) + (BE) (No Caching on Cutset) + (AO Search) (Caching on Cutset) + (AO Search) (Caching on Cutset) + (BE) (No Caching on Cutset) + (AO Search) (Caching on Cutset) + (AO Search) (Caching on Cutset) + (BE)
Spring 2007 ICS Genetic Linkage Networks EA4 - N=1173, K=5, w*=15 i-boundAlgorithmsdepthTime(sec) MinFillMinDepthMinFillMinDepth 6AO(i) (No Caching on Cutset) + (AO Search) (Caching on Cutset) + (AO Search) (Caching on Cutset) + (BE) AO(i) (No Caching on Cutset) + (AO Search) (Caching on Cutset) + (AO Search) (Caching on Cutset) + (BE) AO(i) (No Caching on Cutset) + (AO Search) (Caching on Cutset) + (AO Search) (Caching on Cutset) + (BE)
Spring 2007 ICS Time-Space complexity of of w-cutset Space: O(exp(w)) W -cutset: a set that when removed the induced- width is w. c(w): size of w-cutset. m(w): depth of AO w-cutset Time: O(exp(w+c(w))) on OR space Time: O(exp(w+m(w))) on AND/OR space