Subproblem ordering heuristics for AND/OR best-first search
Abstract
Best-first search can be regarded as anytime scheme for producing lower bounds on the optimal solution, a characteristic that is mostly overlooked. We explore this topic in the context of AND/OR best-first search, guided by the MBE heuristic, when solving graphical models. In that context, the impact of the secondary heuristic for subproblem ordering may be significant, especially in the anytime context. Indeed, our paper illustrates this, showing that a new concept of bucket errors can advise in providing effective subproblem orderings in AND/OR search for both exact and anytime solutions.
Full text
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.1 (1-22) Journal of Computer and System Sciences ••• (••••)•••–••• Contents lists available at ScienceDirect Journal of Computer and System Sciences www.elsevier.com/locate/jcss 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Subproblem ordering heuristics for AND/OR best-first search William Lam a,∗,1, Kalev Kask a, Javier Larrosa b, Rina Dechter a aBren School of Information and Computer Sciences, University of California, Irvine, Irvine, CA 92697, USA bComputer Science Department, UPC Barcelona Tech, Campus Nord, Calle Jordi Girona, 1-3, 08034 Barcelona, Spain a r t i c l e i n f o a b s t r a c t Article history: Received 15 May 2017 Received in revised form 17 October 2017 Accepted 27 October 2017 Available online xxxx Keywords: Graphical models Heuristic search Combinatorial optimization Artificial intelligence Best-first search can be regarded as anytime scheme for producing lower bounds on the optimal solution, a characteristic that is mostly overlooked. We explore this topic in the context of AND/OR best-first search, guided by the MBE heuristic, when solving graphical models. In that context, the impact of the secondary heuristic for subproblem ordering may be significant, especially in the anytime context. Indeed, our paper illustrates this, showing that a new concept of bucket errors can advise in providing effective subproblem orderings in AND/OR search for both exact and anytime solutions. 2017 Elsevier Inc. All rights reserved. 1. Introduction An important problem in the field of artificial intelligence is the min-sum problem over graphical models, which includes the most probable explanation, or maximum a posterior query over probabilistic graphical models [1]. This problem has numerous applications including scheduling,genetic linkage analysis, and protein side chain prediction [2–4]. It is often solved by search schemes such as depth-first branch-and-bound or best-first search such as A*. However, since it is too complex to be solved exactly, research often settles on anytime schemes. Indeed, AND/OR Branch-and-Bound (AOBB) is one such anytime algorithm that generates upper bounds through a sequence of improved suboptimal solutions over time [5,6]. However, there has been little work on the symmetrical problem of generating lower bounds by search in an anytime manner, which is the focus of this paper. We turn to best-first search for this task, which explores the search space in frontiers of non-decreasing lower bounds and is thus inherently anytime for producing lower bounds. Specifically, we will explore AND/OR Best-First (AOBF) search, guided by the mini-bucket heuristic, which is known to be a state-of-the-art algorithm for the min-sum task, but which has been evaluated mostly on its performance for finding an optimal solution [7]. The scheme can be easily adapted to yield a sequence of lower bounds by simply reporting the best heuristic evaluation it has seen so far. Indeed, this idea was used in recent work to produce algorithms that give both upper and lower bounds on the optimal solution [8,9]. The focus of our paper is on the specific aspect of the impact of AND child node ordering on AOBF’s ability to generate lower bounds in an anytime manner. AOBF is guided by two heuristic evaluation functions. In the AND/OR search space, the “best” is a partial solution graph with the best potential solution according to a heuristic evaluation function f1amongst all partial solution graphs of the currently explored search space. A second heuristic f2prioritizes which leaf (known as *Corresponding author. E-mail addresses: [email protected] (W. Lam), [email protected]du (K. Kask), [email protected] (J. Larrosa), [email protected] (R. Dechter). 1Currently at Google Inc. https://doi.org/10.1016/j.jcss.2017.10.003 0022-0000/2017 Elsevier Inc. All rights reserved. © 2017 Elsevier . This manuscript version is made available under the CC-BY-NC-ND 4.0 license http://creativecommons.org/licenses/by-nc-nd/4.0/
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.2 (1-22) 2W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Table 1 Notation on graphical models. Xk,xkvariable, assigned variable fj,Sfjfunction, scope M=(X,D,F)graphical model G=(V,E)primal graph G∗(d)induced graph relative to order d w∗(d)induced width relative to order d tip nodes) of the current best partial solution graph should be expanded next. We call this the AND subproblem ordering. Quoting Pearl (page 50) [10], “These two functions, serving in two different roles, provide two different types of estimates: f1estimates some properties of the set of solution graphs that may emanate from a given candidate base, whereas f2estimates the amount of information that a given node expansion may provide regarding the alleged superiority of its hosting graph. Most works in search theory focus on the computation of f1, whereas f2is usually chosen in an ad-hoc manner.” Indeed, in most current implementations of AOBF, f2is simply chosen to be equal to f1. We show in this paper that the choice of f2has a significant impact on the anytime performance of AOBF for finding lower bounds. In our analysis, we show that a concept known as the residual, which captures a local accuracy of the heuristic evaluation function, is a natural choice for f2. In [11], it was shown that the residual of the mini-bucket heuristic can be approximated by its local errors. We illustrate empirically that the local bucket errors can provide relevant information on the increase of the lower bound due to a given node expansion. While we work in the AND/OR search framework in this paper, the connection to similar search frameworks such as recursive conditioning [12] and backtracking with tree decomposition (BTD) [13,14] is clear. Furthermore, [15] investigates subproblem ordering in the context of BTD, but for depth-first search only. To our knowledge, this is a first investigation of subproblem ordering for best-first search in the AND/OR search space and among the first investigations of anytime best-first search for generating lower bounds. The rest of this paper is organized as follows: Section 2 presents the background on graphical models, the AOBF algorithm, and mini-bucket heuristics. Section 3 analyzes the impact of subproblem ordering and illustrates it with an example. Section 4 introduces the subproblem ordering heuristic based on residuals and local bucket errors and suggests a way to approximate them. Section 5 presents the experiments and section 6 concludes. 2. Background 2.1. Graphical models We will use Xkto denote a variable and Dkits domain. A generic domain value will be noted xk. A variable assignment will be denoted (Xk,xk)or, when the context is clear, just xk. We will use fjto denote a function and Sfjits scope, which is the set of variables for which the function is defined (i.e., fj:QXk∈Sfj Dk→R). Table 1 provides a summary of the notation. A graphical model is a collection of functions over subsets of variables, Definition 1 (graphical model M). Agraphical model Mis a tuple (X,D,F), where 1. X= {X1, . . . , Xn}is a finite set of variables 2. D= {D1, . . . , Dn}is a set of finite domains associated with each variable. 3. F= { f1, . . . , fm}is a set of local functions with scope Sfj⊆Xfor all fj. A graphical model represents a global function which is the sum of all the local functions, denoted Pfj∈Ffj(·). Graphical models are used to model complex systems and their main virtue is allowing compact representation and their structure can often allow efficient query processing. Our focus is on the min-sum problem, defined as follows: Definition 2 (min-sum problem). Given a graphical model M=(X,D,F), the min-sum problem seeks an optimal assignment of its variables that minimizes the global function. Namely, finding x∗, satisfying, x∗=argmin xX fj∈F fj(·) Definition 3 (primal graph G). The primal graph G=(V,E)of a graphical model M=(X,D,F)has one node associated with each variable (i.e., V=X) and edges (Xk,Xk′)∈Efor each pair of variables that appear in the same scope Sfjof some local function fj∈F.
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.3 (1-22) W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 3 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Fig. 1. A primal graph of a graphical model with 7 variables. Table 2 Notation on AND/OR search for graphical models. Tpseudo-tree (nodes correspond to variables) ¯ Xkpseudo-tree path from root to Xk Tksub-tree rooted by Xk Tk,dsub-tree rooted by Xkwith depth d c(Xk,xk)cost of arc from OR node Xkto AND node xk ¯ xkpath from root to AND node xk Fig. 2. A pseudo tree for the running example. Solid arcs form the main tree structure and dotted arcs the back-arcs. Consider a graphical model with 7 variables indexed from Ato Gwith binary functions F= { f(A), f(A,B), f(A,D), f(A,G), f(B,C), f(B,D), f(B,E), f(B,F), f(C,D), f(C,E), f(F,G)}. The primal graph appears in Fig. 1 which has a node for each variable and edges connecting variables which appear in the same function scope. Definition 4 (induced width [1]). Given a primal graph G=(V,E), an ordered graph is a pair (G,d), where d=(X1, ..., Xn)is an ordering of the nodes. The nodes adjacent to Xkthat precede it in the ordering are called its parents. The width of a node in an ordered graph is its number of parents. The width of an ordered graph (G,d), denoted w(d), is the maximum width over all nodes. The width of a graph is the minimum width over all orderings of the graph. The induced graph of an ordered graph (G,d)is an ordered graph (G∗,d), where G∗is obtained from Gas follows: the nodes of Gare processed from last to first along d. When a node Xkis processed, all of its parents are connected. The induced width of an ordered graph (G,d), denoted w∗(d), is the maximum number of parents a node has in the induced ordered graph (G∗,d). The induced width of a graph w∗, is the minimum induced width over all its orderings. The complexity of the min-sum problem for a given graphical model can be bounded by the induced width w∗of its associated primal graph [5,1]. 2.2. AND/OR search for graphical models In the context of graphical models, the conditional independencies in the model can be exploited via the AND structures in AND/OR search spaces. AND/OR search spaces for graphical models are defined relative to a pseudo tree of the primal graph [16]. Definition 5 (pseudo tree [16–18]). Given an undirected graph G=(V,E), a directed rooted tree T=(V,E′)defined on all its nodes is a pseudo tree if any arc of Gwhich is not included in E′is a back-arc in T, namely it connects a node in Tto an ancestor in T. The arcs in E′may not all be included in E. Fig. 2 shows a pseudo tree for our running example. In general, an AND/OR search tree [19,10] has two types of nodes. OR nodes representing branching points where a decision has to be made (i.e. choosing a value for a variable), and AND nodes representing sets of conditionally independent subproblems that need to be solved. In mapping graphical models to AND/OR search, the children of OR nodes are AND
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.4 (1-22) 4W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Fig. 3. The same pseudo-tree as Fig. 2, annotated with contexts. nodes, and the children of AND nodes are OR nodes. There is a cost associated with each edge between an OR node and its child AND node extracted from the functions of the model. Definition 6 (AND/OR search tree [16]). Given a graphical model M=(X,D,F)and a pseudo tree T, its AND/OR search tree consists of alternating levels of OR and AND nodes. OR nodes are labeled with a variable Xk∈X. Its children are AND nodes, each labeled with an instantiation xkof Xk. Children of AND nodes are OR nodes, labeled with the children of Xkin T. Each child represents a conditionally independent subproblem given assignments to their ancestors. The root of the AND/OR search tree is an OR node labeled by the variable at the root of T. The path from the root to an AND node xkrepresents a unique assignment to the variables in ¯ Xk, that will be denoted ¯ xk(see Table 2). In the AND/OR search tree, the costs of the OR-to-AND arcs denoted c(Xk,xk)(abusing notation, since they are dependent on the path to xk) are defined as follows: Definition 7 (arc cost c(Xk,xk)). The cost c(Xk,xk)of the arc (Xk,xk)along a path ¯ xkis the sum of all the functions whose scope includes Xkthat are fully assigned by the values specified along the path ¯ xkfrom the root to node xk. For completeness, we define the costs of edges from AND nodes to OR nodes to be 0. A more compact search space can be obtained if identical subproblems in the AND/OR tree are merged, producing an AND/OR graph [16]. A class of identical subproblems can be identified in terms of their OR context, Definition 8 (OR context). The OR context of a variable Xkin a pseudo tree T=(V,E′)is the set of ancestor variables connected to Xkor its descendants by arcs in E′. Fig. 3 shows the same pseudo-tree in the running example with OR contexts. Definition 9 (context-minimal AND/OR search graph [16]). Identical subproblems can be merged based on the OR context. We can merge two nodes if they have the same assignment to the context variables. This yields a context-minimal AND/OR search graph CTwhose size can be shown to be bounded exponentially in the induced width of Galong the pseudo-tree T. A solution tree Tof the AND/OR search tree or graph corresponds to complete assignments of the variables in the graphical model, defined next. Definition 10 (solution tree). A solution tree Tis a subtree of the AND/OR search graph CTsuch that: 1. It contains the root node of CT; 2. If it contains an internal AND node n, then all children of nare also in T; 3. If it contains an internal OR node n, then exactly one AND node child is in CT; 4. Every tip node in T(nodes with no children) is a terminal node of CT. The cost of a solution tree is the sum of its arc weights associated with the arcs of CT. The cost of a solution tree corresponds to the cost of the assignment it represents as given by the global function of the model. Thus, for the min-sum problem, the optimal solution tree corresponds to the optimal solution. Fig. 4 shows the corresponding context-minimal AND/OR search graph guided by the pseudo tree in Fig. 3. Since the context of variable Eis only over B,C, the corresponding OR nodes have been merged with respect to A, which is an ancestor not in the context. Similarly, the OR nodes of Gare merged with respect to B. The solution tree corresponding to the assignment (A=0,B=1,C=1,D=0,E=0,F=0,G=0)is highlighted in red.
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.5 (1-22) W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 5 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Fig. 4. Example AND/OR search graph. A solution tree is highlighted in red. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.) Table 3 Notation on AND/OR Best-First search. Gcurrently explicated search graph Tcurrent best solution tree to G rroot of the search graph (initial node in G) nnode in G l(n)current best lower bound on below n succ(n)set of successors (children) of n 2.2.1. AND/OR best-first search The AO* algorithm is a best-first search algorithm for AND/OR search spaces [19]. Our AOBF (AND/OR Best First) algorithm is a variant of AO* specialized for graphical models [7]. In the following, we use the notation in Table 3. The algorithm works by gradually expanding a portion (denoted G) of the context-minimal AND/OR search graph CT, always identifying the best partial solution tree Tin G. After node expansion, every node n∈Gneeds to be updated with its best lower bound based on the current state of G, denoted l(n), which corresponds to the f1evaluation function. As usual in AO* search, AOBF [7], which explores the context-minimal AND/OR search graph, presented in Algorithm 1, interleaves a top-down expansion step and a bottom-up revision step. The top-down expansion step generates the children of the next node to expand n (initially the root r), which are appended to G(lines 4–13). Note that if an OR child of an AND node already exists, we do not generate it again to ensure we are searching the search graph CT(line 9). A bottom-up revision step then updates the internal nodes values that represent the current best lower bounds below them (lines 15–26). In this step, the values of newly expanded children are propagated to their parents, and recursively up to the root (stored in l(n)). During these value updates, the algorithm marks the best child of each OR node, which serves as a bookkeeping step to keep track of the assignment corresponding to propagated values. In addition, OR nodes are marked solved if their current best child is marked solved and AND nodes are marked solved if all of their children are marked solved. Subsequently, a new best partial solution tree Tw.r.t. f1is identified by following the marked best children from the root. If the root ris not solved, then the next node nto expand from Tis determined by f2. Otherwise, Tis necessarily a full solution tree that corresponds to the optimal solution, with a cost equal to value of the root node l(r). and AOBF terminates. In earlier literature the algorithm is provided as a purely exact algorithm [19,7]. However, since lower bound values are constantly updated as the algorithm searches, l(r)provides a anytime lower bound on the optimal solution (lines 22–23). On the f2function for selecting the next node to expand, it is common to choose an f2which orders the non-terminal tips using the f1heuristic in ascending order. The focus of our work is in proposing a more informed f2.
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.6 (1-22) 6W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Algorithm 1: AND/OR Best-First (AOBF) [7] Input: A graphical model M=(X,D,F), pseudo-tree T, heuristic function h, ordering function f2. ( f1is defined by l(n), which depends on h) Output: Lower-bound to solution of M 1Create the root OR node rlabeled by X1and let G= {r} 2Initialize value l(r)=h(r)and best partial solution tree Tto G 3n→r// Initial node nto expand 4while r is not marked SOLVED and memory is available do // Expand 5if n is an OR node (labeled Xk)then 6Create AND node n′for each xk∈Dk 7if n′is TERMINAL then mark n′as SOLVED; 8else if n is an AND node (labeled xk)then 9Create OR node n′for each child Xjof Xk∈Tif n′/∈G 10 foreach generated n′do 11 succ(n)←succ(n)∪n′ 12 l(n′)←h(n′)// Initial lower bound is the heuristic 13 G←G∪ {succ(n)} // Revise 14 S← {n}// Set to keep track of nodes needing revision 15 while S6= ∅ do 16 Select pfrom Ss.t. phas no descendants in G∩S 17 S←S− {p} 18 if p is an OR node then 19 l(p)←minm∈succ(p)(c(p,m)+l(m)) 20 Mark k=argminmas the best successor of p 21 if k is SOLVED then mark pas SOLVED; 22 if l(p)changed and p =rthen 23 Output l(p)// Report new lower bound 24 else if p is an AND node then 25 l(p)←Pm∈succ(p)l(m) 26 if ∀m∈succ(p)are SOLVED then mark pas SOLVED; 27 if l(p)changed or p is SOLVED then 28 S←S∪ {parent(p)} 29 Update Tto new best partial solution tree w.r.t. f1by including all nodes visited by DFS on Gthat only includes the best marked AND nodes. 30 if r is not solved then // Choose best tip based on f2for next expansion 31 n←argmaxn∈tips(T)f2(n) 32 return hl(r), Ti Table 4 Notation on bucket elimination for graphical models. Bk,SBkbucket associated to pseudo-tree node Xk, scope Br kmini-bucket associated to pseudo-tree node Xk λk→pmessage computed at Bkand sent to Bp h(¯ xp)heuristic value of node ¯ xp 2.3. Mini-bucket elimination heuristics A commonly used heuristic guiding AND/OR search is based on the MBE (mini-bucket elimination) algorithm [20], which generates a lower bound on the optimal cost. It has a parameter known as the i-bound which allows trading off preprocessing time and space for heuristic accuracy with actual search. MBE works relative to the same pseudo-tree Twhich defines the AND/OR search graph. See Table 4 for a summary of the notation to follow. Each variable Xk∈Tis associated with a bucket Bkthat includes a subset of functions from F. A function fjis placed into a bucket Bkif Xkis the deepest variable in Tsuch that Xk∈Sfj. The scope of a bucket Bk(denoted SBk) is the union of the scopes of its functions. The overall idea is that each bucket Bkgenerates a message λk→p=minxkBk, where pis the parent of kin the pseudo tree T. Processing a bucket may require partitioning the bucket’s functions into mini-buckets Bk= ∪rBr k, where each Br kincludes no more than ivariables. In this case, each mini-bucket is processed separately as if they were associated with different variables. If no partitioning is necessary, then the message computed by the root variable is the optimal cost. (The algorithm reduces to the exact bucket elimination algorithm [1] in this case.) Otherwise, it is a lower bound.
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.7 (1-22) W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 7 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Algorithm 2: Mini-Bucket Elimination [20] Input: Graphical model M=(X,D,F), pseudo tree T, bounding parameter i-bound Output: Lower bound to min-sum on Mand messages λs q→k 1foreach Xk∈Xin bottom up order according to Tdo 2Bk← { fj∈F|Xk∈Sj} 3F←F−Fk 4Put all generated messages λs q→kin Bk 5Partition the Bkinto mini-buckets B1 k, . . . , Br kwith scope bounded by the i-bound 6foreach Bs k∈B1 k, . . . , Br kdo 7Let Xabe closest ancestor variable of Xkin the mini-bucket 8Generate message: λs k→a←minXkPfj∈Bs kfj 9return All λ-messages generated (root message is the min-sum lower bound) Fig. 5. Example of mini-bucket elimination on the running example using an i-bound of 3. We provide details in Algorithm 2. The main loop (lines 1–9) partitions and generates the λmessages which are propagated upward. The time and space complexity is O(nrki), where ris the maximum number of mini-buckets for any variable [1]. We provide an example in Fig. 5 for our example problem. Here, we use an i-bound of 3. In this case, starting with variable D, we have its bucket which contains the functions f(A,D), f(B,D), f(C,D)that all contain variable D. However, the total scope size here is 4, which exceeds the i-bound of 3. Therefore, we partition it into two mini-buckets and each generates a separate λmessage, as if they were separate variables. For the rest of the variables, the i-bound is satisfied, so there is no need to partition them. MBE messages can be used to construct a heuristic for search [21]. These heuristics are referred to as static heuristics since they are pre-compiled before search starts. During search, they can be extracted efficiently by table lookups. Definition 11 (MBE heuristic). Let ¯ xpbe a partial assignment and ¯ Xpbe the set of corresponding instantiated variables. λs k→q(¯ xp)denotes the message sent from Bkto Bq. (We abuse notation here by stating its argument as ¯ xp, though it may only contain a subset of ¯ xp.) The heuristic value for ¯ xpis given by: h(¯ xp)=X Xk∈Tp X s∈1,...,rk|Xq∈¯ Xp λs k→q(¯ xp)(1) where Xk∈Tpdenotes the set of variables in the pseudo subtree rooted by Xp, excluding Xpand rkdenotes the number of mini-buckets for variable Xk. Example In the example, (see Fig. 5), the heuristic function of the partial assignment (A=0, B=1) is h(A=0,B=1)= λD→A(A=0)+λC→B(B=1)+λF→B(A=0,B=1). 2.3.1. Residuals and local bucket error Look-ahead is a method of improving accuracy of the heuristic value for a given node nby expanding the search tree below a node to a certain depth dand backing up the heuristic values of descendant nodes in the search space. This improved heuristic is denoted hd(n). The residual is the gain produced by look-ahead: Definition 12 (residual). The depth dresidual of a node nis resd(n)=hd(n)−h(n)(2)
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.8 (1-22) 8W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 The notion of local bucket error was introduced as a function that captures the local error induced by mini-bucket elimination [11]. It was introduced to capture the heuristic error and was shown to be identical to the depth 1 look-ahead residual. The bucket error is the difference between the message that would have been computed in a bucket without partitioning (called an exact bucket message µ∗ k) and the message computed by the mini-buckets (called a combined mini-bucket message µk). We define these notions below. Definition 13 (combined bucket and mini-bucket messages). Given a mini-bucket partition Bk= ∪rBr k, we define the combined mini-bucket message at Bk, µk(·)=X r min xkX f∈Br k f(·) (3) In contrast, the exact bucket message without partitioning at Bkis µ∗ k(·)=min xkX f∈Bk f(·)(4) Note that although we say that µ∗ kis exact, it is exact only locally to Bksince it may contain partitioning errors introduced by messages computed in earlier processed buckets. We now define the local error for MBE, Definition 14 (local bucket error of MBE [11]). Given a completed run of MBE, the local bucket error function at Bkdenoted Ekis Ek(·)=µ∗ k(·)−µk(·)(5) The scope of Ekis the set of variables in Bkexcluding Xk. An alternative measure is the relative local bucket error, computed by dividing each Ek(·)term by the exact bucket message µ∗ k(·). This serves as a way to normalize the error with respect to the function values, which can vary in scale amongst the bucket errors in practice. Algorithm 3: Local Bucket Error Evaluation (LBEE). Input: A Graphical model M=(X,D,F), a pseudo tree T,i-bound Output: Error function Ekfor each bucket Bk Initialization: Run MBE(i)w.r.t. T. foreach Bk,Xk∈X do Let Bk= ∪rBr kbe the partition used by M BE(i) µk=Pr(minxkPf∈Bkf) µ∗ k=minxkPf∈Bkf Ek=µ∗ k−µk return Ekfunctions Algorithm Local Bucket Error Evaluation (LBEE) 3 (LBEE) computes the local bucket error for each bucket. Following the execution of MB E(i), a second pass is performed from leaves to root along the pseudo tree. When processing a bucket Bk, LBEE computes the combined mini-bucket message µk, the exact bucket message µ∗ k, and the error function Ek. The complexity of processing each bucket is exponential in the scope of the bucket after the execution of MB E(i). The total complexity is therefore dominated by the largest scope of the output buckets. This number is called the pseudo-width, defined next. Definition 15 (pseudo-width(i)). Given a run of M BE(i)along pseudo tree T, the pseudo-width of Bk,psw(i) kis the number of variables in Bkafter all messages have been received. The pseudo-width of Trelative to MBE(i)is psw(i)= maxXk{psw(i) k}. Theorem 1 (complexity of LBEE). The time and space complexity of L BE E is O(nkpsw(i)), where nis the number of variables, kbounds the domain size, and psw(i)is the pseudo-width along Trelative to MBE(i).
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.9 (1-22) W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 9 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Fig. 6. A simple graphical model over 3 variables with two functions. Shown above are the primal graph (also a valid pseudo-tree in this case), the function tables, and the associated AND/OR search space with weights labeled. The optimal solution tree is highlighted and has a cost of 11. 3. Illustrating the impact of subproblem ordering We will now show that the f2heuristic can have a potentially large impact on AOBF performance, starting with an example. In order to reason about the sequence of expansions that occur during AOBF, we define the notion of a profile of f2relative to f1. In the following, Tirefers to the best partial solution tree after the i-th node expansion of AOBF. Definition 16 (profile). Given a primary and secondary heuristic function f1and f2respectively, the sequence pf2= {f1(Ti)|i=1... j}produced with a particular f2when f1is kept fixed, is the profile of f2, under f1. The sequence of f1values seen at each step yields lower bounds on C∗, the optimal cost, whose quality increases with steps (for a monotone heuristic function). At termination, we get the cost C∗. Yet, one sequence may be superior to another. Proposition 1. Given AOBF using an evaluation function f1, there exist two tip node evaluation function f2and f′ 2such that the profiles pf2and pf′ 2under f1differ. Proof of Proposition 1. We prove this by construction. Fig. 6 depicts a graphical model defined over variables A,B,C having two functions f(A,B)and f(A,C). The full AND/OR search space is shown explicitly and the optimal solution (A=1,B=1,C=0)is marked in red. Assume that our heuristic evaluation function is a constant 0. Assume two f2eval- uation functions: f2which orders the subproblems by from left to right (B≺C), while f′ 2reverses the orderings from right to left. The profile of f2under f1is: (0,1,5,11), while the profile of f′ 2is: (0,6,11). In particular, with f2the algorithm explores all solution subtrees while with f′ 2, it will never expand node Bunder A=0, since expanding Cproves that the A=0 branch has a cost of at least 20. We would never return to the A=0 branch since the A=1 branch never exceeds a cost of 20 at any point. In fact, it yields the optimal solution. Clearly, profile pf′ 2dominates that of pf2in this case. ✷ In the following we show further that the choice of f2can, in the worst case, make an exponential impact on the number of expansions needed in order to cross a given lower bound threshold L. Theorem 2. Given a weighted AND/OR search graph, a heuristic evaluation function f1, and two secondary f2and f′ 2functions, there exists an AND/OR search graph and a threshold Lwhere the profile until reaching Lfor pf2is exponentially longer than for pf′ 2. Proof. Let Tbe a partial solution tree of an AND/OR search tree that is currently selected for extension. Let C=f1(T) where C<C∗. Assume that Tcannot be extended to an optimal solution, namely f∗ 1(T) > C∗. Let Aand Bbe two variables labeling OR tip nodes of Twhich are direct child nodes of an AND parent X=0. Let a subtree below a variable Xbe denoted as tXand the d-depth truncated subtree be denoted as td X. Assume that the best extension of Tinto tBhas f1smaller than C∗. Furthermore, we want to force all of the nodes in tBto be explored by AOBF in order to establish the optimal cost in tB. This can be accomplished if the arc costs in tBare monotonically increasing along a breadth-first ordering of the arcs in tB. In contrast, assume that t1 A(tAtruncated to depth 1), provides an extension to Thaving f1>C∗, namely f(T∪t1 A)≥C∗. Under these assumptions, an f′ 2that prefers expanding all of tBbefore any of tA(and such exists) will yield a profile with more nodes than that of an f2that expands tAfirst. Since f(T∪t1 A)≥C∗, it will never expand any of tB. Therefore, pf′ 2would be exponentially longer than pf2for the threshold of C∗.✷ 4. Local bucket errors for AOBF The overall target for an effective subproblem ordering heuristic should be to select the subproblem which increases the lower bound the most. Assume a greedy scheme where given a frontier of tip nodes, we choose the node which would lead
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.16 (1-22) 16 W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Table 9 Summary for exact solutions on promedas instances: win counts of instances that the ordering heuristic had a lower time or lower number of nodes than the baseline. The number of instances solved by any heuristic (including the baseline) is shown under each i-bound label. Each number in parentheses is the percentage of solved instances that performed better for that particular i-bound. Win counts for promedas instances heuristic i=12 i=14 i=16 i=18 wins by (solved =14) time (%)/nodes (%) wins by (solved =17) time (%)/nodes (%) wins by (solved =19) time (%)/nodes (%) wins by (solved =20) time (%)/nodes (%) C-A 10 (71.4)/10 (71.4) 11 (64.7)/12 (70.6) 11 (57.9)/14 (73.7) 12 (60.0)/16 (80.0) C-R 8 (57.1)/8 (57.1) 10 (58.8)/12 (70.6) 10 (52.6)/13 (68.4) 10 (50.0)/14 (70.0) SB-A 2 (14.3)/4 (28.6) 2 (11.8)/3 (17.6) 3 (15.8)/4 (21.1) 2 (10.0)/2 (10.0) SB-R 7 (50.0)/7 (50.0) 10 (58.8)/11 (64.7) 9 (47.4)/15 (78.9) 10 (50.0)/14 (70.0) Table 10 Exact evaluation for type4 instances. The best times and node counts are bolded per i-bound and the best times and node count overall for a given instance are also underlined. If the optimal solution was not found, then we report ‘oom’ to denote that the experiment ran out of memory. We also report the pre-processing time to the left of each total time. n– number of variables, k– maximum domain size, w∗– induced width, h– pseudo-tree height. instance (n,k,w∗,h) heur i=14 pre / time / nodes i=16 pre / time / nodes i=18 pre / time / nodes i=20 pre / time / nodes type4-haplo_100_19 H 4 / oom / – 9 / oom / – 23 / 2436 / 11898 61 / 208 / 1415 (3927,5,28,362) C-A 16 / oom / – 24 / oom / – 36 / 1965 /10036 70 / 176 / 1231 C-R 16 / oom / – 25 / oom / – 35 / 2024 / 10036 70 / 177 / 1231 SB-A 14 / oom / – 21 / oom / – 33 / 2953 / 13625 68 / 222 / 1654 SB-R 14 / oom / – 21 / oom / – 33 / 2039 / 10343 68 / 175 / 1231 type4-haplo_120_17 H 3 / oom / – 7 / 568 / 1846 17 / 32 / 162 32 / 34 / 10 (4302,5,23,300) C-A 12 / oom / – 16 / 325 / 1823 21 / 29 / 155 34 / 34 / 8 C-R 12 / oom / – 14 / 311 / 1825 21 / 29 / 155 34 / 34 / 8 SB-A 10 / oom / – 14 / 211 / 1880 20 / 25 / 155 33 / 34 /8 SB-R 10 / oom / – 14 / 338 / 1828 20 / 28 / 155 33 / 34 / 8 type4-haplo_170_23 H 2 / 1390 /5299 3 / 41 / 300 8 / 12 / 21 13 / 16 / 6 (6933,5,21,396) C-A 9 / 3239 / 5820 11 / 31 / 359 11 / 12 / 16 14 / 14 / 6 C-R 9 / 3323 / 5821 11 / 32 / 385 11 / 12 / 16 14 / 14 / 6 SB-A 7 / 2046 / 6675 9 / 22 / 398 10 / 11 / 22 14 / 14 / 6 SB-R 8 / 2067 / 6484 10 / 31 / 383 10 / 11 /16 14 / 14 / 6 type4b_100_19 H 5 / oom / – 11 / oom / – 30 / oom / – 101 / 880 / 7757 (3938,5,29,354) C-A 18 / oom / – 26 / oom / – 43 / oom / – 111 / 832 / 7664 C-R 18 / oom / – 26 / oom / – 43 / oom / – 111 / 678 / 7588 SB-A 16 / oom / – 22 / oom / – 35 / oom / – 109 / 973 / 7891 SB-R 16 / oom / – 22 / oom / – 40 / oom / – 109 / 634 / 7598 type4b_120_17 H 3 / oom / – 8 / 508 / 1956 22 / 24 / 119 38 / 39 / 48 (4072,5,24,319) C-A 11 / oom / – 16 / 336 / 1922 27 / 31 / 104 41 / 42 / 35 C-R 11 / oom / – 14 / 307 / 1919 27 / 31 / 104 41 / 42 / 35 SB-A 10 / oom / – 14 / 364 / 1937 26 / 29 / 103 40 / 41 / 38 SB-R 10 / oom / – 14 / 329 / 1919 26 / 30 / 105 40 / 41 / 37 type4b_170_23 H 3 / 382 / 2968 4 / 5/ 37 7 / 7/ 20 9 / 9/ 5 (5590,5,21,427) C-A 8 / 287 / 2879 9 / 10 / 36 8 / 9 / 6 9 / 10 / 5 C-R 8 / 333 / 2809 9 / 10 / 35 8 / 8 / 6 9 / 9 / 5 SB-A 7 / 176 /2630 8 / 9 / 53 8 / 8 / 69 / 10 / 5 SB-R 7 / 281 / 2736 8 / 9 / 34 8 / 8 / 6 9 / 10 / 5 i-bound of 18, where the savings in nodes on a few harder instances translated well to savings in the runtime. For example, on or_chain_25.fg, both the runtime and number of nodes expanded using any of the error-guided orderings were about half of those of the baseline ordering. Still, the error-guided orderings may still be worse than the baseline (e.g. or_chain_140.fg, but this is usually the exception. Table 9 provides the win counts for each error-guided ordering heuristic. The ScpBnd-Abs heuristic is the worst performer, as we saw before. Both relative error base orderings (Const-Rel and ScpBnd-Rel) have similar positive performance, demonstrating positive impact of the orderings on at least 50% of the instances across all i-bounds. Overall, Const-Abs was best, yielding improvements on at least 70% of the instances. The time savings in nodes carries over to most cases using lower i-bounds and slightly fewer at higher i-bounds. For example, at an i-bound of 12 using Const-Abs, 9 out of the 10 instances (90%) had a positive impact of ordering also had better runtime than the baseline. In contrast, at an i-bound of 18, only 12 out of the 16 instances (75%) had improved times.
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.17 (1-22) W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 17 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Table 11 Summary for exact solutions on type4 instances: win counts of instances that the ordering heuristic had a lower time or lower number of nodes than the baseline. The number of instances solved by any heuristic (including the baseline) is shown under each i-bound label. Each number in parentheses is the percentage of solved instances that performed better for that particular i-bound. Win counts for type4 instances heuristic i=14 (solved =2) i=16 (solved =4) i=18 (solved =5) i=20 (solved =6) wins by time (%)/nodes (%) wins by time (%)/nodes (%) wins by time (%)/nodes (%) wins by time (%)/nodes (%) C-A 1 (50.0)/1 (50.0) 3 (75.0)/3 (75.0) 3 (60.0)/5 (100.0) 3 (50.0)/4 (66.7) C-R 1 (50.0)/1 (50.0) 3 (75.0)/3 (75.0) 3 (60.0)/5 (100.0) 3 (50.0)/4 (66.7) SB-A 1 (50.0)/1 (50.0) 3 (75.0)/1 (25.0) 2 (40.0)/3 (60.0) 2 (33.3)/2 (33.3) SB-R 1 (50.0)/1 (50.0) 3 (75.0)/3 (75.0) 3 (60.0)/5 (100.0) 3 (50.0)/4 (66.7) Type4. Table 10 shows all the instances of the type4 benchmark that could be solved by AOBF with the given i-bounds. This benchmark is the hardest of the 3 benchmarks and thus we used even higher i-bounds compared to the promedas benchmark. Even then, only with an i-bound of 20 are we able to solve all 6 of the instances. Like with the previous two benchmarks, we see that the error-guided orderings yield better performance on many instances. However, the variation is smaller. For example, on type4-haplo_100_19 using an i-bound of 20, the number of nodes expanded using the Const-Abs ordering is still about 87% of what the baseline ordering yields, compared with the lower 50% rates seen on some instances in the other two benchmarks. On two of the instances here (type4-haplo_170_23 and type4b_170_23), there is no difference in the number of nodes expanded, indicating that most of the errors likely evaluated to zero, thus falling back on the baseline ordering. Still, we see improved runtime on the hardest of the instances here (type4-haplo_100_19 and type4b_100_19), where any savings in the number of nodes expanded did carry over to overall savings in runtime. Table 11 aggregates the results by win counts as before. Across the i-bounds, every error-guided ordering was better on at 50–100% of the instances except for ScpBnd-Abs. Notably, improvement was achieved on all instances by these 3 orderings at an i-bound of 18 and a majority at the highest i-bound of 20. In terms of overall runtime improvement, most instances also had better runtimes when their orderings were better in terms of node expansions. 5.1.1. Discussion on finding exact solutions Our experiments, show that the error-guided orderings can benefit AOBF. For most combinations of benchmark and i-bound, at least 60–70% of the solved instances had positive impact when using the error-guided orderings in terms of nodes expanded, despite the multiple levels of approximation performed (summing 1-level residuals to approximate the exact residual, bounding the scopes of the error functions, and sampling). Furthermore on the harder benchmarks (promedas and type4), the superior orderings node-wise usually also carried over to improved overall runtime. Specifically, when considering time on the same benchmarks, the percentage of instances that exhibited positive impact around 50–60%, though in some cases, the error-guided orderings were only a bit slower, since the difference in pre-processing time is usually in the order of a few seconds. For easy instances, the impact was negative in terms of the number of nodes (and obviously time-wise). This is partly because on easy instances, the MBE-MM heuristic is strong and thus there are no errors, thus making the error-guided orderings not cost-effective. Overall, all of the error-guided orderings (except ScpBnd-Abs) have similar performance to each other. 5.2. Anytime lower bounding Next, we will evaluate AOBF for generating lower bounds in an anytime fashion and the impact of the f2ordering heuristic on this anytime performance. Figs. 7, 9, and 11 report the lower bound obtained as a function of time for each subproblem ordering f2. A profile that is higher earlier in time is superior. The first point of each line is always the bound returned by the MBE-MM heuristic itself, recorded whenever search starts following all pre-processing. If known, the exact solution is also plotted as a dashed gray line. For each benchmark, we select 2 representative instances, one of which was exactly solved and another which was not. For each instance, we show 4 different i-bounds. For pedigrees both instances are exactly solved (Fig. 7). Each ordering is labeled with abbreviated names for clarity. We also aggregated the results per benchmark in Figs. 8, 10, and 12. We normalized the time scale for each instance to that of the baseline, ranked the bounds yielded by each variant across time, and aggregated across the instances by averaging. The number of instances varies with the different i-bounds since for some large instances, compiling the MBE heuristics at the highest i-bounds exceeds our memory limit of 24 GB. Pedigrees. Fig. 7 shows the lower bounds as a function of time on 2 selected instances from the pedigree benchmark. First, on pedigree9 (which is solved exactly). For the lower i-bounds of 6 and 10, all of the methods except ScpBnd-Abs perform better early on. Since the problem is easy at higher i-bounds, AOBF quickly finds the optimal solution after the initial bound generated by MBE-MM. Still, at an i-bound of 14, everything except ScpBnd-Abs improves over the baseline. At the highest i-bound of 18, the pre-processing overhead makes the error-guided orderings not cost-effective. In pedigree51, where AOBF ran out of memory before finding the exact solution, the lowest i-bounds of 6 and 10 also benefited from
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.18 (1-22) 18 W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Fig. 7. Lower bounds as a function of time for two instances from the pedigree benchmark. Higher is better. Fig. 8. Average rank of each ordering as a function of normalized time across all of the instances in the pedigree benchmark. Lower is better.
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.19 (1-22) W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 19 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Fig. 9. Lower bounds as a function of time for two instances from the promedas benchmark. Higher is better. error-guided orderings. Increasing to the i-bound 14 yields marginally better performance compared with the baseline (except for ScpBnd-Abs). Finally, at the highest i-bound the baseline performs best. Fig. 8 presents the average ranks for each ordering heuristic based on normalizing the time across the instances and averaging as explained earlier. As seen in the instance-by-instance results, all error-guided orderings except ScpBnd-Abs outperform the baseline. As the i-bound increases the average rank of the baseline improves. For an i-bound of 18, only ScpBnd-Rel ranks similarly to the baseline, but the baseline is better overall. Promedas. Fig. 9 shows results on 2 selected instances from the promedas benchmark. For the first instance (or-chain- 178.fg), the error-guided orderings improve significantly over the baseline, except for ScpBnd-Abs across all i-bounds. Next, on or-chain-108.fg, most of the error-guided orderings improve over the baseline at an i-bound of 12. Once we increase the i-bound to 14, the baseline manages to get a profile that is more similar to the 3 dominating methods, but still falls short. At i-bounds of 16 and 18, all methods that were performing well before show a better profile, generating a higher lower bound early, as expected Fig. 10 presents the ranking summary over this benchmark. For all i-bounds the baseline seems superior early on due to the pre-processing overhead of the error-guided orderings. However, it is overtaken by the other methods eventually at different points on the normalized time scale. At an i-bound of 12, the Const methods outrank the baseline early on. Moving to i-bounds of 14 and 16, everything but ScpBnd-Abs approaches the baseline eventually and outrank it with time. Finally, at the highest i-bound of 18, the ScpBnd-Rel method performs better early around 0.1 on the time scale, with the Const methods overtaking the baseline at around 0.6 on the time scale. Type4. Fig. 11 shows lower bounds over time for 2 instances of our last benchmark. The first instance (t4-haplo-100-19) could not be solved at i-bounds of 14 and 16, but were solved with higher i-bounds. Once again, all of the error-guided heuristics except ScpBnd-Abs improve performance over all i-bounds of 16 and up. At the lowest i-bound of 14, the per-
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.20 (1-22) 20 W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Fig. 10. Average rank of each ordering as a function of normalized time across all of the instances in the promedas benchmark. Lower is better. Fig. 11. Lower bounds as a function of time for two instances from the type4 benchmark. Higher is better.
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.21 (1-22) W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 21 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Fig. 12. Average rank of each ordering as a function of normalized time across all of the instances in the type4 benchmark. Lower is better. formance is close to the baseline. Moving to t4-haplo-190-20 which was not solved, we have similar behavior. Specifically, ScpBnd-Abs is slightly better than the rest at i-bounds up to 18, but performs significantly worse than both Rel methods at the highest i-bound of 20. Fig. 12 provides summary rankings of the orderings over normalized time for all of the instances that did not run out of memory for each i-bound. Notably, the number of instances reported decreases significantly as we increase the i-bound because we were unable to compile the MBE heuristics given our memory bound for many instances. At an i-bound of 14, the baseline performs best. Many of the instances had a large number of variables, which substantially increased the time and memory needed to compile the MBE heuristics. In turn, this extra cost carried over to increasing the pre-processing time for the error-guided ordering heuristics, leading to a negative impact. For higher i-bounds, we observe the same behavior as in the previous benchmark, where the baseline ordering is best initially. However, the error-guided orderings other than ScpBnd-Abs dominate with more time. Notably, with the highest i-bound, the ScpBnd-Rel ordering outperforms the baseline early and maintains its continuously. 5.2.1. Discussion on anytime performance In contrast with the performance for finding exact solutions, we see that ScpBnd-Rel was overall the winning ordering heuristic. This is illustrated by its ranking at the highest i-bound on the two harder benchmarks we evaluated (promedas and type4). However, it was still outperformed by the baseline on the pedigree benchmark, though not significantly. Overall, from the instance-by-instance lower bound plots ScpBnd-Rel was most consistent in producing superior lower bounds. 6. Conclusion This paper focuses on the potential of using AND/OR best-first search for generating lower bounds in an anytime fashion. Within this context, it explores the impact of subproblem ordering heuristics (the so-called secondary evaluation function [10]) for both exact and anytime performance. We present new heuristics for subproblem ordering which are based on pre-compiled information regarding the error associated with the primary heuristic, guided by a recently defined notion of bucket error. In an extensive empirical evaluation, we showed that in the context of evaluating the exact solution, most of our proposed error-based variants, were equally good, improving the runtime on 50–60% of the instances. This accounted for most of the hard instances which had enough error to impact subproblem ordering. In the anytime evaluation, we found that ScpBnd-Rel (the scope-bounded relative error functions) was the best scheme overall, illustrating the advantage of having more informed functional error information over the constant-based ones. Various issues remain to be explored. First, all averages are taken by enumeration or sampling and using a simple average. However this assumes that each assignment has equal impact. Exploration into a weighted average estimate (i.e. importance sampling) could potentially improve the estimates. Also, the method of truncating the scopes for the ScpBnd methods is quite arbitrary. A more informed truncation procedure may reduce the loss of information. Lastly, we saw that ScpBnd-Abs tended to be much inferior to all ordering heuristics in nearly all cases, which suggests that the truncation and message passing process is sensitive to the scale of values. The relative error variant which expresses errors in terms of percentages on the other hand, was informative. As far as we know, there has been little focus on subproblem ordering in AND/OR Best-First search, our work illustrates that there is potential to be realized by ordering the subproblems in an informed manner. The ideas presented here gen-
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.22 (1-22) 22 W. Lam et al. / Journal of Computer and System Sciences ••• (••••)•••–••• 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 eralize to any type of AND/OR search. In particular, various memory-efficient A* variants (e.g. IDA*, RBFS) [26,27] use the idea of repeatedly deleting and re-expanding nodes, which would potentially also benefit from the savings yielded by better subproblem orderings. Acknowledgments This work was supported in part by NSF grants IIS-1526842 and IIS-1254071, by the US Air Force under Contract No. FA8750-14-C-0011 under the DARPA PPAML program, and MINECO/FEDER under project TIN2015-69175-C4-3-R. References [1] R. Dechter, Reasoning with Probabilistic and Deterministic Graphical Models: Exact Algorithms, Synthesis Lectures on Artificial Intelligence and Machine Learning, Morgan & Claypool Publishers, 2013. [2] E. Bensana, M. Lemaitre, G. Verfaillie, Earth observation satellite management, Constraints 4 (3) (1999) 293–299. [3] M. Fishelson, D. Geiger, Optimizing exact genetic linkage computations, J. Comput. Biol. 11 (2–3) (2004) 263–275. [4] C. Yanover, O. Schueler-Furman, Y. Weiss, Minimizing and learning energy functions for side-chain prediction, J. Comput. Biol. 15 (7) (2008) 899–911. [5] R. Marinescu, R. Dechter, AND/OR Branch-and-Bound search for combinatorial optimization in graphical models, Artif. Intell. 173 (16–17) (2009) 1457–1491. [6] L. Otten, R. Dechter, Anytime and/or depth-first search for combinatorial optimization, AI Commun. 25 (3) (2012) 211–227. [7] R. Marinescu, R. Dechter, Memory intensive and/or search for combinatorial optimization in graphical models, Artif. Intell. 173 (16–17) (2009) 1492–1524. [8] D. Allouche, S. De Givry, G. Katsirelos, T. Schiex, M. Zytnicki, Anytime hybrid best-first search with tree decomposition for weighted CSP, in: International Conference on Principles and Practice of Constraint Programming, Springer, 2015, pp. 12–29. [9] R. Marinescu, J. Lee, A. Ihler, R. Dechter, Anytime best+depth-first search for bounding marginal map, in: AAAI, 2017. [10] J. Pearl, Heuristics: Intelligent Search Strategies, Addison-Wesley, 1984. [11] W. Lam, K. Kask, J. Larrosa, R. Dechter, Residual-guided look-ahead in and/or search for graphical models, J. Artif. Intell. Res. 60 (2017) 287–346. [12] A. Darwiche, Recursive conditioning, Artif. Intell. 126 (1–2) (2001) 5–41. [13] C. Terrioux, P. Jegou, Hybrid backtracking bounded by tree-decomposition of constraint networks, Artif. Intell. 146 (1) (2003) 43–75. [14] J. Philippe, T. Cyril, Decomposition and good recording for solving Max-CSPs, in: Proceedings of the 16th European Conference on Artificial Intelligence, IOS Press, 2004, pp. 196–200. [15] P. Jégou, S. Ndiaye, C. Terrioux, Dynamic heuristics for backtrack search on tree-decomposition of CSPs, in: International Joint Conference on Artificial Intelligence, 2007, pp. 112–117. [16] R. Dechter, R. Mateescu, And/or search spaces for graphical models, Artif. Intell. 171 (2–3) (2007) 73–106. [17] J.R. Bayardo, D.P. Miranker, On the space-time trade-off in solving constraint satisfaction problems, in: Fourteenth International Joint Conference on Artificial Intelligence (I95), 1995, pp. 558–562. [18] E.C. Freuder, M.J. Quinn, Taking advantage of stable sets of variables in constraint satisfaction problems, in: Joint International Conference of Artificial Intelligence, 1985. [19] N.J. Nilsson, Principles of Artificial Intelligence, 1980, Tioga, Palo Alto, CA. [20] R. Dechter, I. Rish, Mini-buckets: a general scheme for approximating inference, J. ACM 50 (2) (2002) 107–153. [21] K. Kask, R. Dechter, Branch and bound with mini-bucket heuristics, in: Proc. IJCAI-99, 1999. [22] A.T. Ihler, N. Flerova, R. Dechter, L. Otten, Join-graph based cost-shifting schemes, in: Proceedings of the 28th Conference on Uncertainty of Artificial Intelligence, UAI 2012, 2012. [23] K. Kask, A. Gelfand, L. Otten, R. Dechter, Pushing the power of stochastic greedy ordering schemes for inference in graphical models, in: AAAI, 2011. [24] M. Fishelson, D, Geiger, Exact genetic linkage computations for general pedigrees, Bioinformatics 18 (suppl_1) (2002) S189–S198. [25] B. Wemmenhove, J.M. Mooij, W. Wiegerinck, M. Leisink, H.J. Kappen, J.P. Neijt, Inference in the promedas medical expert system, in: Artificial Intelligence in Medicine, in: Lecture Notes in Computer Science, vol. 4594, Springer, Berlin, Heidelberg, 2007, pp. 456–460. [26] R.E. Korf, Depth-first iterative-deepening: an optimal admissible tree search, Artif. Intell. 27 (1) (1985) 97–109. [27] R. Korf, Linear-space best-first search, Artif. Intell. 62 (1) (1993) 41–78.
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.23 (1-22) 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Sponsor names Do not correct this page. Please mark corrections to sponsor names and grant numbers in the main text. NSF,country=United States, grants=IIS-1526842, IIS-1254071
ARTICLE IN PRESS UNCORRECTED PROOF Please cite this article in press as: W. Lam et al., Subproblem ordering heuristics for AND/OR best-first search, J. Comput. Syst. Sci. (2018), https://doi.org/10.1016/j.jcss.2017.10.003 JID:YJCSS AID:3142 /FLA [m3G; v1.224; Prn:13/11/2017; 23:46] P.24 (1-22) 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 Highlights •Subproblem ordering impacts the performance of AND/OR Best-First search. •Look-ahead (and thus MBE bucket errors) can be used to guide subproblem ordering. •Several schemes to approximate bucket errors are proposed to deal with overhead.