1 Anytime AND/OR Depth-first Search for Combinatorial Optimization LarsOtten∗ andRinaDechter avoid redundant computation using caching schemes, DepartmentofComputerScience, and most significantly, because they take advantage UniversityofCalifornia,Irvine,U.S.A. of problem decomposition by exploring an AND/OR {lotten,dechter}@ics.uci.edu searchspace[19]oranequivalentrepresentation.The efficiency of these algorithms was established in sev- eral evaluations, including recent UAI competitions One popular and efficient scheme for solving combinato- [7],andtheirpropertieswhenusedforexactcomputa- rial optimization problems over graphical models exactly tionarewelldocumented[10,16,17]. is depth-first Branch and Bound. However, when the al- A principled alternative is presented by best-first gorithm exploits problem decomposition using AND/OR searchspaces,itsanytimebehaviorbreaksdown.Thisarticle schemes,butwhileprovablysuperiorintermsofnum- 1)analyzesanddemonstratesthisinherentconflictbetween ber of node expansions, these often fail when a prob- effective exploitation of problem decomposition (through lem has large induced width due to the generally ex- AND/ORsearchspaces)andtheanytimebehaviorofdepth- ponentialsizeofthealgorithm’sOPENlist;moreover, first search (DFS), 2) presents a new search scheme to ad- they can only provide a solution at termination [17]. dress this issue while maintaining desirable DFS memory Depth-firstsearchisthereforeoftenpreferredbecause properties, and 3) analyzes and demonstrates its effective- of its flexibility in working with bounded memory – nessthroughcomprehensiveempiricalevaluation.Ourwork theOPENlistofnodesgrowslinearly–andbecauseof isapplicabletoanyproblemthatcanbecastassearchover itsanytimebehavior.Namely,whenfindingafeasible anAND/ORsearchspace. solutioniseasybutanoptimaloneishard,depth-first Keywords: combinatorial optimization, graphical models, Branch and Bound generates solutions that get better Bayesian and constraint networks, anytime performance, and better over time, until it eventually discovers an AND/ORsearch,problemdecomposition. optimal one. Thus it can function also as an approx- imation scheme for otherwise infeasible problems or whentimeislimited[24]. 1. Introduction Indeed, in the 2010 UAI Approximate Inference ChallengeparticipatingBranchandBoundsolversper- Max-productproblemsovergraphicalmodels,gen- formed competitively with respect to approximation erally known as MPE (most probable explanation) or (placing 1st and 3rd in some categories). But we also MAP (maximum a posteriori) inference, have many observedaninabilitytoproduceevenasinglesolution applications with practical significance, ranging from on some instances, especially when the time bound computationalbiologyandgeneticstoschedulingtasks was small. Thus motivated, this article will demon- and coding networks. One established and efficient strate that the issue is rooted in the underlying AND/ classofalgorithmsforsolvingtheseproblemsexactly ORsearchspace. isdepth-firstBranchandBoundoverAND/ORsearch These search spaces were originally introduced to spaces.Developedinthepastdecadewithintheprob- graphical models to facilitate problem decomposi- abilistic reasoning and constraint communities, these tion during search (e.g. [5]) and can be explored by methods are effective because they use sophisticated any search strategy. When traversed depth-first, how- lower bound schemes such as soft arc-consistency ever,allbutonedecomposedsubproblemwillbefully [15] or the mini-bucket heuristic [6,16], because they solved before a single overall solution can be com- posed,voidingthealgorithm’sanytimecharacteristics. *Correspondingauthor:4099DonaldBrenHall,Dept.ofCom- Weobservethatundercertainconditions,namelyif puterScience,UniversityofCalifornia,Irvine,CA92697,U.S.A. E-mail:[email protected],Fax:+1-949-824-4056. only one of the decomposed subproblems is “hard”, AICommunications ISSN0921-7126,IOSPress.Allrightsreserved 2 L.OttenandR.Dechter/AnytimeAND/ORDepth-firstSearchforCombinatorialOptimization thisadverseeffectcanbemitigatedbyprocessingsub- specttosuccessorordering.However,itwasonlypre- problems in a suitable order, which we demonstrate sented in a general, non-optimization OR search con- empirically. textforconstraintsatisfactionproblems. This article’s main contribution is a new Branch Connections can also be made to recent contribu- and Bound scheme over AND/OR search spaces, tions in the area of distributed, multi-agent constraint called Breadth-Rotating AND/OR Branch and Bound optimization, where algorithms like NCBB [3] and (BRAOBB)thataddressestheanytimeissueinaprinci- BnB-ADOPT [23] organize agents along a pseudo pledway,whilemaintainingthefavorablecomplexity tree-likestructure,therebyobtainingsolutionstoinde- guarantees of depth-first search. The algorithm com- pendentsubproblemsinparallel. binesdepth-firstandbreadth-firstexplorationbyperi- Finally,mostdirectlyrelatedtotheobjectiveofthis odically rotating over the different subproblems, each workistheconceptoflocalsearch,whichcanbeseen ofwhichisprocesseddepth-first. as specifically targeting anytime performance. How- Experimental evaluation is conducted on a variety ever,itdiffersfromAOBBandtheproposedBRAOBB ofbenchmarkdomains,includinghaplotypecomputa- inthatitcannotproveoptimalityofthesolutionsitre- tion problems in genetic pedigrees, random grid net- turns. We include the state-of-the-art stochastic local works,andproteinside-chainpredictioninstances.We searchsolverGLS+inourempiricalevaluation[9]. compareBRAOBBagainstoneofthebestvariantsof PaperOutline AND/OR branch and Bound search, AOBB [16], and Theremainderofthisarticleisstructuredasfollows: againstan“adhoc”fixthatwesuggest–thelatteral- Section2introducestheunderlyingconceptsofAND/ gorithm relies on a heuristic to quickly find a solu- OR Branch and Bound. Section 3 identifies the cen- tiontoeachsubproblembeforerevertingtodepth-first tralconflictbetweenproblemdecompositionandany- search.Wefurthermorecompareagainstastate-of-the- artstochasticlocalsearchsolver,whichisspecifically timeperformanceandprovidesempiricalresultswhere targeted at anytime performance but cannot provide thelatteriscompromised.ThenewalgorithmBreadth- anyproofofoptimality[9]. RotatingAOBBisproposedinSection4anditstheo- Theempiricalresultsdemonstratesuperioranytime retical properties are analyzed. Section 5 presents ex- behavior of BRAOBB, especially over problematic haustiveexperimentalresultsandanalysisusingawide cases where standard AOBB and its ad hoc fix fail, rangeofexampleproblemsaswellassummarystatis- including several very hard instances from the 2010 tics across more than 500 instances. Section 6 con- UAIApproximateInferenceChallengethatweremade cludes. available and three weighted constraint satisfaction probleminstancesthatareknowntobeverycomplex. We also show how combining local search and ex- 2. Background haustive AND/OR search lets us enjoy the benefits of both approaches. Notably, a solver based on this con- We consider a MPE (most probable explanation, ceptrecentlywonallthreecategories(20seconds,20 sometimesalsocalledMAP,maximumaposteriorias- minutes, and 1 hour) in the MPE track of the PAS- signment)problemoveragraphicalmodel,definedby CAL 2011 Inference Challenge [8], the successor to the2010UAIChallenge. RelatedWork Theworkpresentedhereisfocusedonoptimization problems defined over graphical models. As such our resultsarealsorelevantforrelatedschemeslikerecur- sive conditioning [4] and value elimination [2] in the areaofprobabilisticreasoning,orBTD(Backtracking Tree Decomposition [10]) in constraint optimization. Infact,thepresentedconceptscarryovertocombina- torialAND/ORsearchspacesingeneral. (a) (b) (c) Second, we note Interleaved Depth-First Search Fig.1.(a)Exampleprimalgraphofagraphicalmodelwithsixvari- [18],whichusesasimilarideaofinterleavedprocess- ables,(b)itsinducedgraphalongorderingd=A,B,C,D,E,F, ingofdifferentbranchestomitigatemistakeswithre- and(c)acorrespondingpseudotree. L.OttenandR.Dechter/AnytimeAND/ORDepth-firstSearchforCombinatorialOptimization 3 (a) (b) Fig.2.(a)AND/ORsearchtreeand(b)context-minimalAND/ORsearchgraphcorrespondingtothepseudotreeinFigure1(c). thetuple(X,F,D,max,Q).F={f1,...,fr}isaset EXAMPLE 2. A pseudo tree for the example in Fig- of functions over variables X = {X1,...,Xn} with ure 1(a) is shown in Figure 1(c), corresponding to discretedomainsD={D1,...,Dn},weaimtocom- the induced graph in Figure 1(b) along ordering d = pute max Q f , the probability of the most likely A,B,C,D,E,F.NotehowB hastwochildren,cap- X i i assignment.Anothercloselyrelatedcombinatorialop- turingthefactthatthetwosubproblemsoverC,Dand timization problem is the weighted constraint prob- E,F,respectively,areindependentonceAandBhave lem, where we aim to minimize the sum of all costs, beeninstantiated. i.e.computemin P f [21].Thesetaskshavemany X i i practicalapplicationsbutareknowntobeNP-hard. 2.1. AND/ORSearchTrees The set of function scopes implies a primal graph and, given an ordering of the variables, an induced Given a graphical model instance with variables graph (where, from last to first, each node’s earlier X and functions F , its primal graph (X,E), and a neighborsareconnected)withacertaininducedwidth, pseudo tree T, the associated AND/OR search tree the maximum number of earlier neighbors over all consists of alternating levels of OR and AND nodes nodes[20,12]. [5].Itsstructureisbasedontheunderlyingpseudotree T :therootoftheAND/ORsearchtreeisanORnode EXAMPLE 1. Figure 1(a) depicts the (primal) graph of an example graphical model with six variables, A labeledwiththerootofT .ThechildrenofanORnode throughF.Theinducedgraphfortheexampleproblem hXiiareANDnodeslabeledwithassignmentshXi,xji thatareconsistentwiththeassignmentsalongthepath along ordering d = A,B,C,D,E,F is depicted in Figure 1(b), with two new induced edges, (B,C) and from the root; the children of an AND node hXi,xji (B,E).Itsinducedwidthis2. are OR nodes labeled with the children of Xi in T , representingconditionallyindependentsubproblems. Differentorderingswillvaryintheirinducedwidth; findinganorderingofminimalinducedwidthisknown EXAMPLE 3. Figure 2(a) shows the AND/OR search tobeequallyNP-hard.Inpracticeheuristicslikemin- tree resulting from the primal graph in Figure 1(a) fillormindegreehaveproventoproducereasonableap- when guided by the pseudo tree in Figure 1(c). Note proximations[14,13]. thattheANDnodesforBhavetwochildreneach,rep- TheconceptofAND/ORsearchspaceshasrecently resentingindependentsubtreesrootedatC andE,re- been introduced to graphical models to better capture spectively,therebycapturingproblemdecomposition. thestructureoftheunderlyinggraphduringsearch[5]. In general, given a pseudo tree T of height h, the Thesearchspaceisdefinedusingapseudotreeofthe size of the AND/OR search tree based on T is O(n· graph, which captures problem decomposition as fol- kh),wherekboundsthedomainsizeofvariables[5]. lows: DEFINITION 1. Apseudotreeofanundirectedgraph 2.2. AND/ORSearchGraphs G = (X,E) is a directed, rooted tree T = (X,E′), suchthateveryarcofGnotincludedinE′ isaback- Identical subproblems, identified by their context arcinT ,namelyitconnectsanodeinT toanancestor (thepartialinstantiationthatseparatesthesubproblem inT .ThearcsinE′maynotallbeincludedinE. from the rest of the network), can be merged, yield- 4 L.OttenandR.Dechter/AnytimeAND/ORDepth-firstSearchforCombinatorialOptimization inganAND/ORsearchgraph[5].Mergingallcontext- Algorithm1AND/ORBranchandBound(AOBB) mergeablenodesyieldsthecontext-minimalAND/OR Given: Graphical model (X,F,D,max,Q) and pseudo sAeNarDch/OgRraspeha.rcIht gwraasphshhoawssniztehaOt(tnh·ekwco∗)n,tewxht-emreinwim∗aisl Outptrueet:TcowsitthofrooopttiXmaolsolution theinducedwidthoftheproblemgraphalongadepth- 1: OPEN←{hX0i} firsttraversalofT [5]. 2: whileOPEN6=∅ 3: n←top(OPEN) //topnodefromstack,depth-first EXAMPLE4. Figure2(b)displaysthecontext-minimal 4: ifcheckpruning(n)=success AND/OR graph obtained when applying full caching 5: prune(n) //performpruning totheAND/ORsearchtreeinFigure2(a).Inparticu- 6: elseifcachelookup(n)=success lar,theORnodesforD (withcontext{B,C})andF 7: readcache(n) //retrievecachedvalue (context{B,E})havetwoedges converging fromthe 8: elseifn=hXiiisORnode ANDlevelabovethem,signifyingcaching(namely,the 9: forxj ∈Di assignmentofAdoesnotmatter). 10: createANDchildhXi,xji 11: addhXi,xjitotopofOPEN GivenanAND/ORsearchspaceST,asolutionsub- 12: elseifn=hXi,xjiisANDnode treeSolST isatreesuchthat(1)itcontainstherootof 13: forYr ∈childrenT(Xi) ST ;(2)ifanonterminalANDnoden∈ST isinSolST 14: generateORnodehYri thenallitschildrenareinSolST ;(3)ifanonterminal 15: addhYritotopofOPEN OR node n∈ST is in SolST then exactly one of its 16: ifchildren(n)=∅ //nisleaf childrenisinSol . 17: propagate(n) //upwardsinsearchspace ST 18: return value(hX0i) //rootnodehasoptimalsolution 2.3. WeightedAND/ORSearchSpaces rent best solution to the subproblem rooted at each GivenanAND/ORsearchgraph,eachedgefroman node),untilsearchterminatesandtheoptimalsolution OR node X to an AND node x can be annotated by hasbeenfound[16]. i i weightsderivedfromthesetofcostfunctionsF inthe Algorithm 1 shows pseudo code for AOBB: Start- graphicalmodel:theweightl(Xi,xi)isthecombina- ing with just the root node hX0i on the stack, the al- tionofallcostfunctionswhosescopeincludesX and gorithmiterativelytakesthetopnodenfromthestack i is fully assigned along the path from the root to x , (line3).Lines4–7trytoprunethesubproblembelow i evaluated at the values along this path. Furthermore, n (by comparing a heuristic estimate of n against the each node n in the AND/OR search graph can be as- currentlowerbound)andcheckthecachetoseeifthe sociatedwithavaluev(n),capturingtheoptimalsolu- subproblem below n has previously been solved (de- tioncosttothesubproblemrootedatn,subjecttothe tailsin[16]).Ifneitheroftheseissuccessful,thealgo- current variable instantiation along the path from the rithm generates the children of n (if any) and pushes rootton.v(n)canbecomputedrecursivelyusingthe thembackontothestack(8–15).Ifnisaterminalnode valuesofn’ssuccessors[5]. inthesearchspace(itwaspruned,itssolutionretrieved fromcache,orthecorrespondingX isaleafinT)its i 2.4. AND/ORBranchandBound value is propagated upwards in the search space, to- wards the root node (16–17). When the stack eventu- AND/OR Branch and Bound (AOBB) is a state- allybecomesempty,thevalueoftherootnodehX0iis of-the-artalgorithmforsolvingoptimizationproblems returnedasthesolutiontotheproblem(18). such as max-product over graphical models [16,17]. We will use AOBB to denote the algorithm above Assuming a maximization query, AOBB traverses the in its specific graphical models context as well as a weightedcontext-minimalAND/ORgraphinadepth- generic name for any depth-first Branch and Bound first manner while keeping track of the current lower schemeoveranAND/ORsearchspace. boundonthemaximalsolutioncost.Anodenwillbe pruned if this lower bound exceeds a heuristic upper 2.5. Mini-BucketHeuristics bound on the solution to the subproblem below n (cf. Section 2.5). The algorithm interleaves forward node The heuristic h(n) that we use in our experiments expansion with a backward cost revision or propaga- isthemini-bucketheuristic.Itisbasedonmini-bucket tion step that updates node values (capturing the cur- elimination, which is an approximate variant of vari- L.OttenandR.Dechter/AnytimeAND/ORDepth-firstSearchforCombinatorialOptimization 5 ableeliminationandcomputesapproximationstorea- pedigree30x1, i10 (n=1289 k=5 w=21 h=108) soningproblemsovergraphicalmodels[6].Acontrol −137.0 parameteriallowsatrade-offbetweenaccuracyofthe y)−137.5 heuristicanditstimeandspacerequirements–higher bilit−138.0 a values of i yield a more accurate heuristic but take ob−138.5 moretimeandspacetocompute.Itwasshownthatthe g(pr−139.0 Lo−139.5 intermediate functions generated by the mini-bucket increasing −140.0 decreasing algorithm MBE(i) can be used to derive a heuristic −140.5 functionthatisadmissible,namelyinamaximization 100 101 102 103 104 Search time in seconds context it overestimates the optimal cost solution to a pedigree41x1, i7 (n=1062 k=5 w=33 h=100) subproblemintheAND/ORsearchgraph[11]. −120 −122 y) bilit−124 3. AnytimeBehaviorversusProblem ba−126 o DecompositioninAND/ORSearch og(pr−−113208 L −132 increasing decreasing As a depth-first branch and bound scheme one −134 wouldexpectAOBBtoquicklyproduceanon-optimal 100 101 102 103 104 Search time in seconds solutionandthengraduallyimproveuponit,maintain- pedigree34x2, i15 (n=2320 k=5 w=31 h=102) ing the current best one throughout the search. How- −222 everthisabilityiscompromisedinthecontextofAND/ y)−224 ORsearch. bilit−226 Specifically, in AND/OR search spaces depth-first ba o−228 traversal of a set of independent subproblems will pr g(−230 solvetocompletionallbutonesubproblembeforethe Lo −232 increasing lastoneisevenconsidered.Asaconsequence,thefirst decreasing −234 generated overall non-optimal solution contains con- 100 101 102 103 104 ditionallyoptimalsolutionstoallsubproblemsbutthe Search time in seconds lastone.Furthermore,dependingontheproblemstruc- Fig.3.ImpactofsubproblemorderingonAOBB.Specifiedforeach ture and the complexity of the independent subprob- network:numberofvariablesn,max.domainsizek,inducedwidth lems, the time to return even this first non-optimal w along the chosen ordering, height of the corresponding pseudo overallsolutioncanbesignificant,practicallynegating treeh.Thedashedgraylineindicatestheoptimalsolutionvalue. theanytimebehaviorofdepth-firstsearch(DFS). (in the general description of AOBB the subproblem orderingisleftunspecified). 3.1. SubproblemOrdering Figure 3 contrasts the anytime behavior of AOBB using this “increasing” subproblem order against the In certain cases, the above suggests a simple rem- inverseone(“decreasing”)byplottingthesolutioncost edy: if decomposition yields only one large subprob- generatedasafunctionoftimeontwoexampleprob- lem and several smaller ones, the latter can be solved lems(thedashedhorizontallineistheoptimumcost); depth-first in relatively little time, to be then com- all other aspects of the algorithm remain constant. bined with the incrementally improving solutions of Pedigree30x1 inparticularfeaturesexactlyonesingle the larger subproblem. Thus for anytime behavior an complexsubproblemandanumberofrelativelysimple AOBB algorithm would need to process independent ones; in this case processing subproblems by increas- subproblemsfrom“easy”to“hard”. ing induced width right away produces a non-optimal To demonstrate the practical impact of subproblem solutionthatimprovesrapidly.Theinverseorderyields orderings, we use a simple heuristic that takes the the first solution only after about 90 minutes – the induced width as a measure of subproblem hardness one complex subproblem has been fully solved and (motivated by its exponential role in the asymptotic the overall solution is already optimal. Pedigree41x1 complexity),i.e.wemodifyAOBBsuchthatsubprob- hasasimilarlyadvantageousstructureandthusyields lemswithsmallerinducedwidthwillbeprocessedfirst similar results – with the distinction that the inverse 6 L.OttenandR.Dechter/AnytimeAND/ORDepth-firstSearchforCombinatorialOptimization subproblemorderdoesnotproduceanysolutionatall 4. Breadth-RotatingAOBB within24hours. In case of pedigree34x2, however, decomposition In the following we develop a new search scheme yields two complex subproblems: the increasing sub- called Breadth-Rotating AND/OR Branch and Bound problem order still outperforms its inverse, yet it re- (BRAOBB) that addresses the issue of anytime per- turns the initial solution only after about 1,000 sec- formance over AND/OR search spaces. It combines onds.Infact,nopossiblesubproblemorderingcanlead depth-first exploration with the notion of “rotating” toacceptable anytimebehavior inthiscaseduetothe through different subproblems in a breadth-first man- structureofsubproblems,clearlyhighlightingthelim- ner.Namely,nodeexpansionstilloccursdepth-firstas itsofthisapproach. instandardAOBB,butthealgorithmtakesturnsinpro- Independent ofanytime behavior,wepointoutthat cessingsubproblems,eachuptoagivennumberofop- incorporating different subproblem orderings impacts erationsatatime,round-robinstyle. thealgorithm’soverallefficiency(i.e.,thetimetofind Tomotivatethisapproach,consideragainthataso- and prove an optimal solution): knowing the solution lution is represented by a solution tree over an AND/ to one subproblem can aid the pruning of Branch and ORsearchspace,guidedbyapseudotree.ApureDFS Bound in the next one to varying degrees. However, scheme will construct the different branches of a so- this issue has not been treated systematically in the lution tree one by one, ensuring optimality for each literature for graphical models, with sporadic exper- branch before moving to the next. To restore anytime iments also suggesting an easy-to-hard order, using behavior,weinsteadaimtodevelopallbranchesofthe some heuristic to determine subproblem complexity solution tree “simultaneously”, which we achieve by [16].Thisgeneralproblemisoutsidethescopeofthe rotatingthroughthem. presentpaper,however. 4.1. SubproblemRotation 3.2. GreedySubproblemDive More systematically, the algorithm maintains a list Another relatively straightforward remedy that can ofcurrentlyopensubproblemsandrepeatsthefollow- inghigh-levelstepsuntilcompletion: be viewed as an “ad hoc” fix is the following: Every time decomposition is encountered within the search 1. Move to next open subproblem P in a breadth- space, we will try to greedily find a single initial so- firstfashion. lutiontoeachindependentsubproblembeforesucces- 2. ProcessP depth-first,untileither: sively solving each of them to completion depth-first, (a) P issolvedoptimally, through normal AOBB. To obtain this initial solution (b) P decomposesintochildsubproblems,or the algorithm can perform a greedy “dive” into each (c) apredefinedthresholdnumberofoperations subproblem by only considering one value for each isreached. variable along the path (in case of the mini-bucket heuristic, it is easy to see that this is equivalent to a The threshold in (c) is needed to ensure the algo- forwardpassoverthebucketstructure[11]). rithmdoesnotgetstuckinonelargesubproblemwhere Clearly,thechoiceofthedivepathiscrucialforthe theothertwoconditions,(a)and(b),donotoccurfor algorithm’s performance. Namely, if the chosen path a long time. Furthermore, in order to focus on a sin- leadstoadeadend(zeroprobability),thedivewillbe gle solution tree at a time, a subproblem is only con- futileandnotyieldasubproblemsolution.Thisagain sidered “open” if it does not currently have any child negates the desired anytime behavior, since the sub- subproblems,asillustratedbelow. problem for which the dive failed will not be recon- sidereduntilthenormaldepth-firstAOBBphase.And 4.2. AlgorithmPseudoCode infactexperiments inSection 5 willdemonstrate that theresultingperformancedependsheavilyonthequal- Algorithm2givesmoredetailedpseudocodeforthe ity of the heuristic, which often prevents satisfactory scheme(withsomedetailsfromstandardAOBBomit- anytimebehavior.Inthenextsectionwewilltherefore ted,cf.Algorithm1and[16]).Thekeyelementliesin propose a new search strategy that addresses the any- rotating over the different subproblems of the search timeissueoverAND/ORsearchspacesinaprincipled space; by organizing these in a global first-in-first- manner. outqueue(GLOBAL),weemulatebreadth-firstexplo- L.OttenandR.Dechter/AnytimeAND/ORDepth-firstSearchforCombinatorialOptimization 7 Algorithm2Breadth-RotatingAOBB Given: Graphical model (X,F,D,max,Q) and pseudo treeT withrootXo,rotationthresholdZ Output: costofoptimalsolution 1: ROOT←{hX0i} //generaterootsubproblem 2: pushROOTtoendofGLOBAL 3: whileGLOBAL6=∅ 4: LOCAL←front(GLOBAL) //nextsubproblem 5: forz←1toZoruntilLOCAL=∅ oruntilchildSubprob(LOCAL)6=∅ 6: n←top(LOCAL) //nextnodeinsubproblem (a)Expansionofnodes1–12 7: ... //cachingandpruningasinAOBB 8: ifn=hXiiisORnode 9: forxj ∈Di 10: createANDchildhXi,xji 11: addhXi,xjitotopofLOCAL 12: elseifn=hXi,xjiisANDnode 13: Y1,...,Ym ←childrenT(Xi) 14: generateORchildrenhY1i,...,hYri 15: ifm=1 //nodecomposition 16: pushhY1itotopofLOCAL 17: elseifm>1 //problemdecomposition 18: forr←1tom 19: NEW←{hYri} //newchildsubproblem 20: pushNEWtobackofGLOBAL (b)Expansionofnodes13–31 21: ifchildren(n)=∅ //nisleaf 22: propagate(n) //upwardsinsearchspace 23: ifLOCAL6=∅ //subproblemnotyetsolved 24: pushLOCALtoendofGLOBAL 25: return value(hX0i) //rootnodehasoptimalsolution rationacrossthedifferentbranchesofthesolutiontree. The input parameter Z gives the rotation threshold. Eachsubproblemisitselfexploreddepth-first(viaalo- callast-in-first-outstackofnodes,LOCAL);whenever a new level of decomposition is encountered, as cap- tured by the pseudo tree, the resulting child subprob- (c)Expansionofnodes32–44 lemsarepushedtotheendoftheglobalqueue.Finally, Fig.4.BRAOBBexploration(Z=2)atdifferentstages.Nodesare subproblemsareonlyconsideredintherotationifthey numberedinorderoftheirexpansion. don’tcurrentlyhaveanychildsubproblems. tothequeue.(3)RotatetosubproblemP1andexpand 4.3. ExampleExecution hCi and hC,0i. (4) Rotate to subproblem P2. Expand hEi and hE,0i. (5) Rotate to subproblem P0 but skip Figure 4 demonstrates the scheme’s application it at this point, since its child subproblems P1 and P2 (Z =2) to the AND/OR search graph in Figure 2(b) are still open. (6) Rotation moves to subproblem P1. (assuming no pruning). Part (a) shows the first 12 ExpandhDiandhD,0i,discoveraleafandpropagate. nodesexpandedduringthefirstseveniterationsofthe (7)RotatetosubproblemP2,expandhFiandhF,0i– outer while loop as follows: (1) Taking the overall which,asaleaf,ispropagatedtoyieldthefirstoverall problemassubproblemP0,expandhAiandhA,0ibe- solution. forereachingthethresholdZ=2.(2)Withnodecom- Figures 4(b) and (c) illustrate how the search then position so far rotation returns to subproblem P0. Ex- proceedstotaketurnssolvingsubproblemsP1andP2 pandhBiandhB,0i,yieldingsubproblemsP1andP2 to completion (nodes 13–22) before reopening sub- rooted at hCi and hEi, respectively, which are added problemP0.Expansion23yieldstwonewindependent 8 L.OttenandR.Dechter/AnytimeAND/ORDepth-firstSearchforCombinatorialOptimization subproblems P3 and P4; their solution is depicted by Itisworthpointingoutthattheseworst-casebounds nodes24–41.AfterthatsubproblemP0getsreopened, are often very loose, because the Branch and Bound where expanding nodes 42–44 again yields two new schemeistypicallyveryefficientandpruneslargeparts subproblemsP5andP6,andsoforth. of the search space. In particular, we observe that in practicethepruningkeepsthecachetablesfromreach- ingtheirworst-caseexponentialsize. 4.4. AnalysisofBreadth-RotatingAOBB 4.4.2. SignificanceofZ TherotationthresholdZ actsasasafeguardagainst In this Section we analyze the Breadth-Rotating overlylargesubproblems,thattakealongtimetosolve AOBBalgorithmanditspropertiesandcontrastitwith optimally (condition (a), Section 4.1) or where recur- standardAOBB. sive decomposition does not occur for a long time 4.4.1. Correctness,Completeness,andComplexity (condition(b)).Being“stuck”inthiswaycouldagain Recall that a heuristic function is said to be admis- impair anytime performance, which is why we limit sibleifitneverunderestimates(inamaximizationsce- thenumberofnodeexpansionsbeforeenforcingaro- nario) the cost of the optimal solution to a given sub- tation.AsweseeinSection5,however,practicalprob- problem. The mini-bucket heuristic satisfies this re- lemstypicallyexhibitfrequentsubproblembranching, quirement[11].Furtherrecallthatndenotesthenum- soarelativelylargethresholdofZ = 1000orsimilar berofproblemvariables,kthemaximumdomainsize, issufficient,ifrarelyreached. htheheightoftheguidingpseudotreeT withinduced 4.4.3. MaximumQueueSize widthandw∗. It is easy to see that the maximum number of en- THEOREM1. Breadth-RotatingAOBBiscompleteand triesintheGLOBALqueueisdependentonthenum- correct assuming an admissible heuristic. Further- ber of branchings in the solution tree, corresponding more, when searching an AND/OR search tree (i.e., to pseudo tree nodes with more than one successor, withoutcachingofredundantsubproblems),BRAOBB since that is where the algorithm generates new child has time complexity O(n · kh) and space complexity subproblems(lines17–20,Algorithm2).Inparticular, O(n). When searching the context-minimal AND/OR decomposition does not occur along the chains in the searchgraph(withfullcaching),timeandspacecom- pseudotree,i.e.,pathswherenonode(besidestheend plexityareO(n·kw∗). points) has outdegree greater than 1. The number of queue entries is thus bounded by the number of max- Proof. Because of the heuristic’s admissibility, a sub- imal chains in the pseudo tree. We can thus state the spaceisprunedonlyifitprovablycannotyieldabet- following: ter solution than what is already known at this point. THEOREM 2. When exploring an AND/OR search Just like standard AOBB the search also remains sys- space using a guiding pseudo tree P with l leaves, tematicandallsolutiontreesareconsidered;thealgo- the number of subproblems in the GLOBAL queue of rithmisguaranteedtoeventuallyterminateandreturn BRAOBBisboundedby2l−1. theoptimalsolutiontotheproblem. BRAOBB explores the same underlying AND/OR Proof. Since T is a tree with l leaves, there can be at search space as standard AOBB, hence its asymptotic most l −1 branchings (nodes with outdegree greater time complexity remains unchanged, i.e. exponential than1)inT toyieldtheseleaves.Eachsuchbranching in h for tree and exponential in w∗ for graph search. sits at the end of one maximal chain. Together with SpacecomplexityforAND/ORgraphsearchisdomi- the leaf chains, we obtain an upper bound of 2l − 1 natedbythecachingandthusalsoremainsunchanged maximalchains. exponentialinw∗. In case of tree search, recall that subproblems with 4.4.4. ComparisonwithStandardAOBB childsubproblemsarenotprocessedfurther.Therefore WeexpecttheanytimeperformanceofBRAOBBto every variable will appear in at most one subproblem be robust with respect to different subproblem order- at any given time. And since each subproblem is pro- ings,sincethealgorithmisnotforcedto“commit”to cesseddepth-first,i.e.inlinearspace,thespaceacross asinglesubproblem–whichweidentifiedasthemain allsubproblemsisalsolinearinn. reason for the poor anytime behavior of plain AOBB L.OttenandR.Dechter/AnytimeAND/ORDepth-firstSearchforCombinatorialOptimization 9 inSection3.1.Wewillconfirmthisexperimentallyin anytime performance and neither the dive extension Section5. nor BRAOBB can provide significant improvements. TheactualnumberofnodesexploredbyBRAOBB Hencewealsocreatedadditionalversionsofeachnet- might differ from plain AOBB (for both graph and work with two or three identical copies connected at tree search), since the pruning behavior of the algo- the root (thus ensuring the presence of more than one rithm can be impacted by the order in which nodes complex subproblem), signified by the “x2” and “x3” are explored and subproblem solutions produced: On suffix, respectively. This yields a total of 57 pedigree theonehand,solvingasubproblemtocompletionbe- (eachrunwiththreedifferentheuristicstrengths),150 fore processing the next (in AOBB) might allow the grid, 24 mastermind, and 198 protein prediction in- algorithm to calculate a tighter upper bound using stancesandresultinginover90,000CPUhoursworth this optimal solution, resulting in better pruning. On ofexperiments. theotherhand,exploringsubproblemsconcurrentlyin Wepresentdetailedperformanceresultsforarepre- BRAOBBmightleadtoatighteroveralllowerbound sentativesubsetoftheprobleminstancesinSection5.1 through combining solutions across subproblems as beforeSection5.2compilessummarystatisticsacross theyarediscovered(inananytimefashion). all 543 problem instances. Section 5.3 evaluates how our proposed exhaustive search method can benefit fromlimitedlocal search.Section 5.4 presents results 5. EmpiricalEvaluation on two additional very challenging problem domains, protein-protein interaction from the UAI 2010 Chal- Tovalidateandcomparetheperformanceofthevar- lenge and CELAR radio link frequency assignments. ious schemes we recorded their anytime behavior on Finally, Section 5.5 analyzes a number of algorithm a variety of problem instances using a common vari- parametersempirically. able ordering and mini-bucket heuristic for each in- stance (24 hour time limit); unless noted otherwise 5.1. DetailedPerformanceAnalysis subproblems were ordered by increasing width (cf. Section 3.1). We ran “plain” AOBB, AOBB with the Figure 5 shows anytime profiles for some of the diveextension(cf.Section3.2),andBreadth-Rotating more interesting initial problem instances (“x1” suf- AOBB as presented in Section 4; we also included fix),whileFigure6presentsresultsonasubsetofprob- OR Branch and Bound (without problem decomposi- leminstanceswithmorethanonecomplexsubproblem tion) as a baseline. In addition, we ran an advanced (“x2”and“x3”suffix).Foreveryprobleminstance,the stochasticlocalsearch(SLS)algorithm[9],bothonits plottitlespecifiesnumberofvariablesn,max.domain ownandasainitializationstepforourownexhaustive sizek,inducedwidthwalongthechosenordering,and search;inparticularweconsidertheGLS+implemen- height of the corresponding pseudo tree h. If known, tationfrom[9],forwhichsourcecodeispubliclyavail- theoptimalsolutionvalueisindicatedbyagraydashed able.Notethatasanincompletesearchscheme,itdoes horizontal line. The title of each plot also notes the not provide a proof of optimality and always runs for mini-bucket i-bound; this was typically chosen to fit thefull24hoursinourexperiments.Allalgorithmsare a 1GB memory limit, except for pedigree instances, implemented in C++ and were run on 2.67 GHz Intel wherethreedifferentheuristicstrengths(i=7,10,15) XeonCPUswith2GBofRAMpercore. wereappliedforeachinstance. Our initial test set (instance name suffix “x1”) is InFigure5aswellas6wenotethatORBranchand comprisedof19geneticlinkagepedigreeproblems,50 Bound finds an early lower bound in some cases, but randomlygeneratedgridnetworks,8mastermindgame generally provides little improvement over time and instances(allpartoftheUAI2008evaluation1)aswell never gets close to the optimum. The dive extension as 66 protein side-chain prediction problems (taken showsacceptableanytimebehavioronlyonhalfthein- from [22]). However, several of these instances are stances shown, confirming our conjecture that its per- relatively simple or have only one complex subprob- formance depends solely on the success of the initial lem, which renders them less interesting for the pur- dive – if misguided by the heuristic, the anytime be- poseofthiswork.Namely,plainAOBB(withsubprob- haviorispredictablyasbadas,orevenslightlyworse lemsorderedbyincreasingwidth)alreadyyieldsgood thantheplainscheme. TheproposedBRAOBB,ontheotherhand,exhibits 1http://graphmod.ics.uci.edu/uai08/ impressiveanytimeperformanceinbothFigures5and 10 L.OttenandR.Dechter/AnytimeAND/ORDepth-firstSearchforCombinatorialOptimization 75-25-1x1, i20 (n=624 k=2 w=38 h=111) pedigree19x1, i10 (n=793 k=5 w=26 h=95) −16.5 bility)−17.0 bility)−100 a a−105 b b pro−17.5 pro g( or g(−110 or Lo−18.0 pdliavein Lo−115 pdliavein rotate rotate 100 101 102 103 104 100 101 102 103 104 Search time in seconds Search time in seconds pedigree31x1, i7 (n=1183 k=5 w=30 h=85) pdb1bgfx1, i4 (n=112 k=81 w=14 h=44) −130 bability)−−115400 bability)−−5408 oprlain g(pro−160 or g(pro−52 droivtaete Lo plain Lo −170 dive −54 rotate −180 100 101 102 103 104 100 101 102 103 104 Search time in seconds Search time in seconds Fig.5.AnytimeprofilesofplainAOBB(“plain”),AOBBwithsubproblemdive(“dive”),Breadth-RotatingAOBB(“rotate”),andORBranch andBound(“or”)onselectedinstancesfromtheinitialsetofproblems(“x1”suffix;1grid,2pedigree,1side-chainprediction). 6,oftenbyalargemargin;inallbutonecasethefirst Furthermore, we see that plain AOBB sometimes solution is produced more or less instantly, even on has a slight edge in terms of proving optimality, pedigree51x3(Fig.6),where“plain”and“dive”donot e.g. 172 proved optimal at 10 seconds versus 153 returnanythingwithin24hours.Notethatmastermind forBRAOBB,confirmingthatexploringsubproblems instances arehighlydeterministicand theinitialsolu- concurrently can slightly impair the pruning (cf. Sec- tionisalreadyoptimal–butagainBRAOBBreturnsit tion 4.4). Again, as an incomplete solver local search first. provesnooptimalityatall. We observe that SLS does very well on the side- 5.2. SummaryStatistics chainpredictionnetworks–theseproblemshaveonly a few hundred variables but a large max. domain Table1summarizestheentiresetofexperimentsby size of 81. On the other problem classes, however, showing,atdifferentpointsoftime,thenumberofin- withthousandsofvariablesandsmallermax.domains, stances for which any solution was found, for which BRAOBBshowsbetterperformance,inparticularwith the optimal solution was found, and for which opti- respect to finding the optimal solution. The reason malitywasproven(i.e.thealgorithmterminated).The for this lies in the heuristic used by AOBB: mini- resultsconfirmthatBRAOBByieldssuperioranytime bucket space complexity is O(nki) – large domain performance:forexample,within1seconditprovides size bounds k thus necessitate a significantly lower i- aninitialsolutionon502instances(outof543),com- bound(i=3incaseoftheside-chainpredictionprob- paredtojust232forplainAOBB,339forthediveex- lems),whichleadstofarlessaccurateheuristics. tension,and424forlocalsearch;performanceremains superiortotheotherAOBBversionsandverycompet- 5.3. CombiningLocalandExhaustiveSearch itivewithlocalsearchforhighertimebounds. WealsonotethatBRAOBBfindstheoptimalsolu- Looking again at Table 1, we notice that SLS can tion quicker than the other schemes (with the excep- sometimes find solutions more quickly than any kind tion of local search on side-chain prediction), e.g. for ofexhaustivesearch–inparticularithasfoundasolu- overall266instancesafter10seconds(versus220for tionforall543problemsafter10seconds(versus514 plain).Similarly,inthefull24hours,BRAOBBfound instancesforBRAOBBandjust293forplainAOBB). the optimal solution to 495 instances, versus 486 for Asoutlinedabove,however,SLSisoftenquicklyout- plainandjust316forlocalsearch. performed by AOBB and BRAOBB in terms of find-
Description: