Computational Aspects of Reordering Plans
This article studies the problem of modifying the action ordering of a plan in order to optimise the plan according to various criteria. One of these criteria is to make a plan less constrained and the other is to minimize its parallel execution time…
Authors: C. Backstrom
Journal of Articial In telligence Researc h 9 (1998) 99{137 Submitted 10/97; published 9/98 Computational Asp ects of Reordering Plans Christer B ac kstr om cba@id a.liu.se Dep artment of Computer and Information Scienc e Link opings universitet, S-581 83 Link oping, Swe den Abstract This article studies the problem of mo difying the action ordering of a plan in order to optimise the plan according to v arious criteria. One of these criteria is to mak e a plan less constrained and the other is to minimize its parallel execution time. Three candidate denitions are prop osed for the rst of these criteria, constituting a sequence of increasing optimalit y guaran tees. Tw o of these are based on deordering plans, whic h means that or- dering relations ma y only b e remo v ed, not added, while the third one uses reordering, where arbitrary mo dications to the ordering are allo w ed. It is sho wn that only the w eak est one of the three criteria is tractable to ac hiev e, the other t w o b eing NP-hard and ev en dicult to appro ximate. Similarly , optimising the parallel execution time of a plan is studied b oth for deordering and reordering of plans. In the general case, b oth of these computations are NP-hard. Ho w ev er, it is sho wn that optimal deorderings can b e computed in p olynomial time for a class of planning languages based on the notions of pro ducers, consumers and threats, whic h includes most of the commonly used planning languages. Computing op- timal reorderings can p oten tially lead to ev en faster parallel executions, but this problem remains NP-hard and dicult to appro ximate ev en under quite sev ere restrictions. 1. In tro duction In man y applications where plans, made b y man or b y computer, are executed, it is imp or- tan t to nd plans that are optimal with resp ect to some cost measure, t ypically execution time. Examples of suc h applications are man ufacturing and error-reco v ery for industrial pro cesses, pro duction planning, logistics and rob otics. Man y dieren t kinds of computa- tions can b e made to impro v e the cost of a plan|only a few of whic h ha v e b een extensiv ely studied in the literature. The most w ell-kno wn and frequen tly used of these is sche dul- ing . A plan tells whic h actions (or tasks) to do and in whic h order to do them, while a sc hedule assigns exact release times to these actions. The sc hedule m ust ob ey the action order prescrib ed b y the plan and m ust often also satisfy further metric constrain ts suc h as deadlines and earliest release times for certain actions. A sc hedule is fe asible if it satises all suc h metric constrain ts. It is usually in teresting to nd a sc hedule that is optimal in some resp ect, e g the feasible sc hedule ha ving the shortest total execution time, or the sc hedule missing the deadlines for as few actions as p ossible. In principle, planning and sc heduling follo w in sequence suc h that sc heduling can b e view ed as a p ost-pro cessing step to planning|where planning is concerned with causal relations and qualitativ e temp oral relations b et w een actions, while sc heduling is concerned with metric constrain ts on actions. In some planning systems, e g O-Plan (Currie & T ate, 1991) and Sipe (Wilkins, 1988), b oth planning and sc heduling are in tegrated in to one single system. Similarly , temp oral planners, e g Deviser (V ere, 1983) and IxTeT (Ghallab & Laruelle, 1994), can often reason also ab out metric constrain ts. This do es not mak e it c 1998 AI Access F oundation and Morgan Kaufmann Publishers. All righ ts reserv ed. B ackstr om irrelev an t to study planning and sc heduling as separate problems, though, as can b e seen from the v ast literature on b oth topics. The t w o problems are of quite dieren t c haracter and studying them separately giv es imp ortan t insigh t also in to suc h in tegrated systems as w as just discussed. F or instance, Drabble 1 sa ys that it is often v ery dicult to see when O-Plan plans and when it sc hedules; it is easy to see that O-Plan w orks, but it is dicult to see wh y . A further complication in understanding the dierence b et w een planning and sc heduling, b oth for in tegrated systems and for systems with separated planning and sc heduling, is that certain t yp es of computations fall in to a grey zone b et w een planning and sc heduling. Planners are go o d at reasoning ab out eects of actions and causal relationships b et w een actions, but are usually v ery p o or at reasoning ab out time and temp oral relationships b et w een actions. Sc hedulers, on the other hand, are primarily designed to reason ab out time and resource conicts, but ha v e no capabilities for reasoning ab out causal dep endencies b et w een actions. The problems in the grey zone require reasoning of b oth kinds, so neither planners nor sc hedulers can handle these problems prop erly . If these problems are not solv ed, then the sc heduler do es not get sucien t information from the planner to do the b est of the situation|the planner and the sc heduler ma y fail in their co op eration to nd a plan with a feasible sc hedule, ev en when suc h a plan exists. This article fo cusses on one of these grey-zone problems, namely the problem of optimis- ing the action order of a plan to allo w for b etter sc hedules. Whenev er t w o actions conict with eac h other and cannot b e allo w ed to execute in parallel, a planner m ust order these actions. Ho w ev er, it usually do es not ha v e enough information and reasoning capabilities to decide whic h of the t w o p ossible orders is the b est one, so it mak es an arbitrary c hoice. One of the c hoices t ypically allo ws for a b etter sc hedule than the other one, so if the planner mak es the wrong c hoice it ma y prev en t the sc heduler from nding a go o d, or ev en feasible, sc hedule. This situation arises also when plans are made b y a h uman exp ert, since it is dif- cult to see whic h c hoice of ordering is the b est one in a large and complex plan. Planning systems of to da y usually cannot do an ything b etter than asking the planner for a new plan if the sc heduler fails to nd a feasible sc hedule. This is an exp ensiv e and unsatisfactory solution, esp ecially if there is no feedbac k from the sc heduler to help the planner making a more in telligen t c hoice next time. Another solution whic h app ears in the literature is to use a lter b et w een the planner and sc heduler whic h attempts to mo dify the plan order to put the sc heduler in a b etter p osition. Suc h lters could remo v e certain o v er-commitmen ts in the ordering, whic h will b e referred to as de or dering the plan, or ev en c hange the order b et w een certain actions, whic h will b e referred to as r e or dering the plan. This article is in tended to pro vide a rst formal foundation for studying this t yp e of problems. It denes a n um b er of dieren t optimalit y criteria for plan order mo dications, b oth with resp ect to the degree of o v er-committmen t in the ordering and with resp ect to the parallel execution time, and it also pro vides computational results for computing suc h mo dications. The article also analyses some ltering algorithms suggested in the literature for doing suc h order mo dications. The remainder of this article is structured as follo ws. Section 2 in tro duces the concepts and computations studied in this article b y means of an example. Then Section 3 starts the 1. Brian Drabble, p ersonal comm unication, Aug. 1997. 100 Comput a tional Aspects of Reordering Plans theoretical con ten t of the article, dening the t w o planning formalisms used in the follo wing sections. The problems of making a plan least-constrained are studied in Section 4 where some candidate denitions for this concept are in tro duced and their computational prop er- ties in v estigated. Section 5 denes the concepts of parallel plans and parallel executions of plans. This is follo w ed b y Section 6 where optimal deorderings and reorderings of parallel plans are in tro duced and the complexit y of ac hieving suc h optimalit y is analysed. Section 7 then studies ho w the complexit y of these problems is aected b y restricting the language. This includes the p ositiv e result that an algorithm from the literature nds optimal de- orderings for a class of plans for most common planning languages. Some other ltering algorithms from the literature as w ell as some planners incorp orating some ordering opti- misation are discussed in Section 8. Finally , Section 9 discusses some asp ects of this article and some related w ork, while Section 10 concludes b y a brief recapitulation of the results. 2. Example In order to illustrate the concepts and op erations studied in this article a simple example of assem bling a to y car will b e used. The example is a v ariation of the example used b y B ac kstr om and Klein (1991), whic h is a m uc h simplied v ersion of an existing assem bly line for to y cars used for undergraduate lab orations in digital con trol at Link oping Univ ersit y (for a description of this assem bly line, see e g. Klein, Jonsson, & B ac kstr om, 1995, 1998; Str om b erg, 1991). The problem is to assem ble a LEGO 2 car from pre-assem bled parts as sho wn in Figure 1. There is a c hassis, a top and a set of wheels, the t w o latter to b e moun ted on to the c hassis. T op Chassis Wheels Car Figure 1: Sc hematic assem bly pro cess for a to y car The w orkpiece o w of the factory is sho wn in Figure 2. There are three storages, one for eac h t yp e of preassem bled part, t w o w orkstations, n um b er 1 for moun ting the top and n um b er 2 for moun ting the wheels, and there is a car storage for assem bled cars. T ops can b e mo v ed from the top storage to w orkstation 1 and sets of wheels can b e mo v ed from the 2. LEGO is a trade mark of the LEGO compan y 101 B ackstr om wheels storage to w orkstation 2. Chassis can b e mo v ed from the c hassis storage to either w orkstation and also, p ossibly with other parts moun ted, b et w een the t w o w orkstations and from either w orkstation to the car storage. F urthermore, b efore moun ting the wheels on a c hassis, the t yres m ust b e inated, so w orkstation 2 incorp orates a compressed-air con tainer whic h m ust b e pressurized b efore inating the t yres (this is not sho wn in the gure). Storage Wheels Car Storage Chassis Storage T op Storage W orkstation 2 W orkstation 1 Figure 2: Sc hematic la y-out of the to y-car factory This article is concerned with mo difying the order b et w een the actions in a giv en plan, and do es not consider mo difying also the set of actions. Hence, the example will assume that a plan for assem bling a to y car is giv en|whether this plan w as pro duced b y hand or b y a planning algorithm is not imp ortan t. It will also b e assumed that this assem bly plan con tains exactly those actions listed in T able 1, in some order. Since most results in this article are indep enden t of the particular planning language used, no assumptions ab out the planning language will b e made in this example either. T o mak e things simple, the ob vious common-sense constrain ts on whic h plans are v alid will b e used. F or instance, a part m ust b e mo v ed to a w orkstation b efore it is moun ted there, the wheels m ust b e inated b efore b eing moun ted and the air con tainer m ust b e pressurized b efore inating the t yres. F urthermore, since a c hassis can only b e at one single place at a time, the top cannot b e moun ted in parallel with moun ting the wheels, and neither of the moun ting op erations can b e done in parallel with mo ving either the c hassis or the part to b e moun ted. The purp ose of mo difying the action order in a giv en plan is usually to optimize the plan in some asp ect, for instance, to mak e the plan le ast c onstr aine d . Consider the totally ordered plan in Figure 3a, for pro ducing a c hassis with wheels, whic h is a subplan of the plan for assem bling a car. Note that since the plan is totally ordered, all pairs of actions are ordered, but the implicit transitiv e arcs are not sho wn in the gure. This plan is clearly o v er-constrained. F or instance, it is not necessary to mo v e the set of wheels to w orkstation 2 b efore pressurizing the air con tainer, and remo ving this ordering constrain t results in the plan in Figure 3b. Note that orderings ha v e only b een remo v ed|the arc from MvW2 to IT existed already in the original plan, but w as implicit b y transitivit y . A plan where some orderings ha v e b een remo v ed will b e referred to as a de or dering of the original plan. 102 Comput a tional Aspects of Reordering Plans Action Description Duration MvT1 Mo v e top to w orkstation 1 1 MvW2 Mo v e wheels to w orkstation 2 1 MvC1 Mo v e c hassis to w orkstation 1 2 MvC2 Mo v e c hassis to w orkstation 2 2 MvS Mo v e c hassis to car storage 3 MtT Moun t top on c hassis 7 MtW Moun t wheels on c hassis 4 P A C Pressurize air con tainer 5 IT Inate t yres 4 T able 1: Actions of the assem bly plan This new plan is less constrained than the original plan, since it is no w p ossible to mo v e the wheels and pressurize the air con tainer in either order or, p erhaps, ev en in parallel. Ho w ev er, further orderings can b e remo v ed; it is not necessary to inate the wheels b efore mo ving the c hassis to the w orkstation. Remo ving also this ordering results in the plan in Figure 3c, whic h is a least constrained deordering of the original plan in the sense that it is not p ossible to remo v e an y further ordering constrain ts and still ha v e a v alid plan. That is, if remo ving an y further ordering constrain t, it will b e p ossible to sequence the actions in suc h a w a y that the plan will no longer ha v e its in tended result. In addition to deorderings, one ma y also consider arbitrary mo dications of the ordering relation, that is, b oth remo ving and adding relations. Suc h mo dications will b e referred to as r e or derings . Three dieren ts least-constrainmen t criteria for plans based on deorderings and reorderings will b e studied in Section 4, and the plan in Figure 3c happ ens to b e optimal according to all three of these criteria. - - P P P P q 1 - - - - P P P P q * P P P P q 1 c) A least constrained MvW2 MvC2 MtW v ersion of a b) A less constrained v ersion of a IT a) A total order plan MvW2 IT MvC2 MtW P A C P A C MvC2 MtW IT MvW2 P A C Figure 3: Three plans for moun ting the wheels 103 B ackstr om Making a plan least constrained is clearly useful if certain actions can b e executed in parallel. Ho w ev er, ev en in the case where no parallel execution is p ossible, it ma y still b e w orth making a plan least constrained. Although the partial order of this least constrained plan m ust again b e strengthened in to a total order for execution purp oses, this need not b e the same total order as in the original plan. Supp ose the actions ha v e temp oral constain ts lik e deadlines and earliest release times and that a sc heduler will p ost-pro cess the plan to try nding a feasible sc hedule. It ma y then b e the case that the original plan has no feasible sc hedule, but a less constrained v ersion of it can b e sequenced in to a feasible sc hedule. The idea of a least constrained plan is that the sc heduler will ha v e as man y alternativ e execution sequences as p ossible to c ho ose from. The most imp ortan t reason for mo difying the action ordering of a plan, ho w ev er, is to execute the plan faster b y executing actions in parallel whenev er p ossible. F or this purp ose it is b etter to use the length of the optimal sc hedule for a plan as a measure, rather than some measure on the ordering itself. Supp ose the follo wing car-assem bly plan is giv en h M v W 2 ; P AC ; I T ; M v C 2 ; M tW ; M v T 1 ; M v C 1 ; M tT ; M v S i : If the actions are executed sequen tially in the giv en order, the minim um execution time is the sum of the durations of the actions, that is 29 time units. Ho w ev er, just as in the previous example this plan is o v er-constrained, since sev eral of the actions could b e executed in either order, or in parallel. It is p ossible to remo v e orderings as far as sho wn in Figure 4a, but no further, and still ha v e a v alid plan (the implicit transitiv e orderings are not sho wn in the gure). This deordered v ersion of the original assem bly plan can b e sc heduled to execute in 25 time units b y exploiting parallelism whenev er p ossible. An example of suc h a sc hedule is sho wn in Figure 3b. Ho w ev er, no faster execution is p ossible, since the plan con tains a subsequence of actions whic h cannot b e parallelized and whic h has a total execution time of 25 time units. It is ob vious from the sc hedule in Figure 4b that not man y actions can b e executed in parallel, and that the gain of deordering the plan is quite small. A m uc h b etter p erformance is p ossible if arbitrary mo dications to the action ordering are allo w ed, that is, if also reorderings are considered. F or instance, in the assem bly plan there is no particular reason wh y the wheels should b e moun ted b efore the top is moun ted, and it will b e seen shortly that m uc h time can b e sa v ed b y rev ersing the order of these t w o op erations. A deordering cannot do this, ho w ev er, since remo ving the ordering b et w een the wheel-moun ting action (MtW) and the top-moun ting action (MtT) w ould mak e these unordered. This w ould b e in terpreted as if the t w o actions could b e executed in parallel, whic h is not p ossible. This is also the reason wh y these actions m ust b e ordered in the original plan. Ho w ev er, when allo wing arbitrary mo dications, the order b et w een these t w o actions can b e rev ersed, and Figure 5a sho ws suc h a reordering of the original plan. This plan can b e sc heduled to execute in only 16 time units, whic h is a considerable impro v emen t o v er b oth the original plan and the optimal deordered v ersion of it. An example of an optimal sc hedule is sho wn in Figure 5b. In fact, this plan is an optimal reordering in the sense that no other ordering of the actions results in a v alid plan that can b e sc heduled to execute faster. The problems of nding optimal deorderings and reorderings of plan with resp ect to parallel execution is the main topic of this article, and are studied in Sections 5 to 7. 104 Comput a tional Aspects of Reordering Plans MvC2 IT MtW MvC1 MtT MvT1 MvW2 MvS 0 5 10 15 20 25 a) A deordering of the assem bly plan admitting a shortest parallel execution time b) An optimal sc hedule for the plan ab o v e MvS MvW2 IT MvC2 MtW MvC1 MvT1 MtT P A C P A C Figure 4: An optimal deordering of the assem bly plan It is ob vious that reordering is a more p o w erful op eration than deordering, since the reordered plan in Figure 5a allo ws for a shorter sc hedule than the optimal deordering in Figure 4a. On the other hand, if the original plan had b een h M v T 1 ; M v C 1 ; M tT ; M v S; M v W 2 ; P AC ; I T ; M v C 2 ; M tW i ; then deordering w ould ha v e b een sucien t for arriving at the optimal plan in Figure 5a. 3. Planning F ormalisms This section denes actions, plans and related concepts, whic h basically app ear in t w o dieren t guises in this article. Denitions and tractabilit y results will mostly b e cast in a general, axiomatic framew ork in order to b e as general and indep enden t of formalism as p ossible. Hardness results, on the other hand, will mostly b e cast in a sp ecic formalism, Gr ound Tweak , and often sub ject to further restrictions, this in order to strengthen the results. Both these formalisms are dened b elo w. In addition to these, a third formalism will b e used, but its denition will b e deferred un til it is used, in Section 7. 105 B ackstr om a) parallel execution time b) An optimal sc hedule for the plan ab o v e A reordering of the assem bly plan admitting a shortest MvS MvW2 IT MvC2 MtW MvC1 MvT1 MtT P A C MvC1 MvW2 IT MvT1 MtT MtW MvC2 MvS 0 5 10 15 P A C Figure 5: An optimal reordering of the assem bly plan 3.1 The Axiomatic Planning F ramew ork The axiomatic framew ork mak es only a minim um of assumptions ab out the underlying for- malism. It ma y b e instan tiated to an y planning formalism that denes some concept of a planning pr oblem a domain of en tities called actions and a validity test. The planning problem is assumed to consist of planning pr oblem instanc es ( ppi s), 3 with no further as- sumptions ab out the inner structure of these. The v alidit y test is a truth-v alued function taking a ppi and a sequence of actions as argumen ts. If the v alidit y test is true for a ppi and an action sequence h a 1 ; : : : ; a n i , then the action sequence h a 1 ; : : : ; a n i is said to solve . While the inner structure of the ppi s and the exact denition of the v alidit y test are cru- cial for an y sp ecic planning formalism, man y results in this article can b e pro v en without making an y suc h further assumptions. Results on the computational complexit y of certain problems will mak e an assumption ab out the complexit y of the v alidit y test, though. Based on these concepts, the notion of plans can b e dened in the usual w a y . Denition 3.1 A total-order plan (t.o. plan) is a se quenc e P = h a 1 ; : : : ; a n i of actions, which c an alternatively b e denote d by the tuple hf a 1 ; : : : ; a n g ; i wher e for 1 k ; l n , a k a l i k < l . Given a ppi , P is said to b e -v alid i the validity test is true for and P . 3. This is the complexit y-theoretic terminology for problems. Planning problem instances in the sense of this article are sometimes referred to as planning problems in the planning literature. 106 Comput a tional Aspects of Reordering Plans A partial-order plan (p.o. plan) is a tuple P = h A; i wher e A is a set of actions and is a strict ( ie. irr eexive) p artial or der on A . The validity test is extende d to p.o. plans s.t. given a ppi , P is -valid i h A; 0 i is valid for every top olo gic al sorting 0 of . The actions of a t.o. plan m ust b e executed in the sp ecied order, while unordered actions in a p.o. plan ma y b e executed in either order. That is, a p.o. plan can b e view ed as a compact represen tation for a set of t.o. plans. There is no implicit assumption that unordered actions can b e executed in parallel; parallel plans will b e dened in Section 5. p.o. plans will b e view ed as dir e cte d acyclic gr aphs in gures with the transitiv e arcs often tacitly omitted to enhance readabilit y . F urthermore, all pro ofs and algorithms in this article are based on this denition, ie assuming the order of a plan is transitiv ely closed, while man y practical planners do not b other ab out transitiv e closures. This dierence do es not aect an y of the results presen ted here. 3.2 The Ground TWEAK F ormalism The Ground TWEAK (GT) formalism is the TWEAK language (Chapman, 1987) restricted to ground actions. This formalism is a v ariation on prop ositional STRIPS and it is kno wn to b e equiv alen t under p olynomial transformation to most other common v arian ts on prop o- sitional STRIPS (B ac kstr om, 1995). In brief, an action has a precondition and a p ostcon- dition, b oth b eing sets of ground literals. In order to dene the GT formalism, the follo wing t w o denitions are required. Giv en some set S , the notion Se qs ( S ) denotes the set of all sequences formed b y mem b ers of S , allo wing rep etition of elemen ts and including the empt y sequence. The sym b ol `;' will b e used to denote the sequence concatenation op erator. F urther, giv en a set P of prop ositional atoms, the set L P of literals o v er P is dened as L P = P [ f: p j p 2 P g . Since no other form ulae will b e allo w ed than atoms and negated atoms, a double negation :: p will b e treated as iden tical to the unnegated atom p . Finally , giv en a set of literals L , the negation Ne g ( L ) of L is dened as Ne g ( L ) = f: p j p 2 L g [ f p j : p 2 L g and L is said to b e c onsistent i there is no atom p s.t. b oth p 2 L and : p 2 L . Denition 3.2 A n instanc e of the GT planning problem is a quadruple = hP ; O ; I ; G i wher e P is a nite set of atoms ; O is a nite set of op erators of the form h pr e ; p ost i wher e pr e ; p ost L P ar e c onsistent and denote the pre and p ost condition r esp e ctively; I ; G L P ar e c onsistent and denote the initial and goal state r esp e ctively. F or o = h pr e ; p ost i O , w e write pr e ( o ) and p ost ( o ) to denote pr e and p ost resp ectiv ely . A sequence h o 1 ; : : : ; o n i 2 Se qs ( O ) of op erators is called a GT plan (or simply a plan) o v er . Denition 3.3 The ternary r elation valid Se qs ( O ) 2 L P 2 L P is dene d s.t. for arbi- tr ary h o 1 ; : : : ; o n i 2 Se qs ( O ) and S; T L P , valid ( h o 1 ; : : : ; o n i ; S; T ) holds i either 1. n = 0 and T S or 107 B ackstr om 2. n > 0 , pr e ( o 1 ) S and valid ( h o 2 ; : : : ; o n i ; ( S Ne g ( p ost ( o 1 )) [ p ost ( o 1 ) ; T ) . A t.o. plan h o 1 ; : : : ; o n i 2 Se qs ( O ) solves i valid ( h o 1 ; : : : ; o n i ; I ; G ) . An action is a unique instance of an op erator, ie a set of actions ma y con tain sev eral instances of the same op erator, and it inherits its pre- and p ost-conditions from the op erator it instan tiates. Since all problems in this article will consider some xed set of actions, the atom and op erator sets will frequen tly b e tacitly omitted from the GT ppi s. In gures, GT actions will b e sho wn as b o xes, with precondition literals to the left and p ostcondition literals to the righ t. 4. Least Constrained Plans It seems to ha v e b een generally assumed in the planning comm unit y that there is no dier- ence b et w een t.o. plans and p.o. plans in the sense that a t.o. plan can easily b e con v erted in to a p.o. plan and vic e versa . Ho w ev er, while a p.o. plan can b e trivially con v erted in to a t.o. plan in lo w-order p olynomial time b y top ological sorting, it is less ob vious that also the con v erse holds. A t least three algorithms for con v erting t.o. plans in to p.o. plans ha v e b een presen ted in the literature (P ednault, 1986; Regnier & F ade, 1991a; V eloso, P erez, & Carb onell, 1990) (all these algorithms will b e analyzed later in this article). The claim that a t.o. plan can easily b e con v erted in to a p.o. plan is v acuously true since an y t.o. plan is already a p.o. plan, b y denition. Hence, no computation at all needs to b e done. This is hardly what the algorithms w ere in tended to compute, ho w ev er. In order to b e useful, suc h an algorithm m ust output a p.o. plan satisfying some in teresting criterion, ideally some optimalit y criterion. In fact, t w o of the algorithms men tioned ab o v e are claimed to pro duce optimal plans according to certain criteria. F or instance, V eloso et al. (1990, p. 207) claim their algorithm to pro duce le ast c onstr aine d plans. They do not dene what they mean b y this term, ho w ev er, and theirs is hardly the only pap er in the literature using this term without further denition. Unfortunately , it is b y no means ob vious what constitutes an in tuitiv e or go o d criterion for when a p.o. plan is least constrained and, to some exten t, this also dep ends on the purp ose of ac hieving least-constrainmen t. The ma jor motiv ation for pro ducing p.o. plans instead of t.o. plans (see for instance T ate, 1975) is that a p.o. plan can b e p ost-pro cessed b y a sc heduler according to further criteria, suc h as release times and deadlines or resource limits. Either the actions are ordered in to an (ideally) optimal sequence or, giv en criteria for parallel execution, in to a parallel plan that can b e executed faster than if the actions w ere executed in sequence. In b oth cases, the less constrained the original plan is, the greater is the c hance of arriving at an optimal sc hedule or optimal parallel execution resp ectiv ely . Both of the algorithms men tioned ab o v e are motiv ated b y the goal of exploiting p ossible parallelism to decrease execution time. It is not only in teresting to mak e t.o. plans partially ordered, but also to mak e partially ordered plans more partially ordered, that is, to generalise the ordering. An algorithm for this task has b een presen ted in the literature in the con text of case-based planning (Kam bhampati & Kedar, 1994). Since t.o. plan are just a sp ecial case of p.o. plans, this section will study the general problem of making partially ordered plans less constrained. 108 Comput a tional Aspects of Reordering Plans 4.1 Least-constrainmen t Criteria There is, naturally , an innitude of p ossible denitions of least-constrainmen t. Some seem more reasonable than others, ho w ev er. Three in tuitiv ely reasonable candidates are dened and analyzed b elo w. Although other denitions are p ossible, it is questionable whether considerably b etter or more natural denitions, with resp ect to the purp oses men tioned ab o v e, can b e dened without using more information than is usually presen t in a t.o. or p.o. plan. Denition 4.1 L et P = h A; i and Q = h A; 0 i b e two p.o. plans and a ppi . Then, 1. Q is a reordering of P wrt. i b oth P and Q ar e -valid. 2. Q is a deordering of P wrt. i Q is a r e or dering of P and 0 3. Q is a prop er deordering of P wrt. i Q is a r e or dering of P and 0 Denition 4.2 Given a ppi and two p.o. plans P = h A; i and Q = h A; 0 i , 1. Q is a minimal-constrained deordering of P wrt. i (a) Q is a de or dering P wrt. and (b) ther e is no pr op er de or dering of Q wrt. ; 2. Q is a minim um-constrained deordering of P wrt. i (a) Q is a de or dering P wrt. and (b) ther e is no de or dering h A; 00 i of Q wrt. s.t. j 00 j < j j ; 3. Q is a minim um-constrained reordering of P wrt. i (a) Q is a r e or dering P wrt. and (b) ther e is no r e or dering h A; 00 i of Q wrt. s.t. j 00 j < j j ; Note that the previous publication (B ac kstr om, 1993) used the terms LC1-minimality for minimal-constrained deordering and LC2-minimality for minim um-constrained reordering. This c hange in terminology has b een done with the hop e that more will b e gained in clarit y than is lost b y confusion. It is easy to see that minim um-constrainmen t is a stronger criterion than minimal- constrainmen t|an y minim um-constrained deordering of a plan P is a minimal-constrained deordering of P , but the opp osite is not true. As an example, consider the plan in Figure 6a. If remo ving all ordering constrain ts from action C, the result is the plan in Figure 6b, whic h is still v alid. This plan has an order of size 3 (there is one implicit transitiv e order) and it is a minimal-constrained deordering since no further deordering can b e made. It is not a minim um-constrained deordering, ho w ev er, since if instead breaking the ordering constrain ts b et w een the subsequences AB and CB, the result is the plan in Figure 6c, whic h is also v alid. This plan has an ordering of size 2 and it can easily b e seen that it is a minim um-constrained deordering, and that it happ ens to coincide with the minim um-constrained reordering in this case. This coincidence is not alw a ys the case, ho w ev er, since a reordering is allo w ed to 109 B ackstr om do more mo dications than a deordering; a minim um deordering can ob viously nev er ha v e a smaller ordering relation than a minim um reordering. Examples of this dierence w as sho wn already in Section 2, where Figure 4a sho ws a minim um-constrained deordering and Figure 4b sho ws a minim um-constrained reordering. p A q p B q D q C q C q D p A q p B - - p A q p B q C q D - - - - - b) A minimal deordering b) A minim um deordering a) A total-order plan Figure 6: The dierence b et w een minimal and minim um constrained deorderings. Other alternativ e denitions of least-constrainmen t could b e, for instance, to maximize the unorderdness or to minimize the length of the longest c hain in the mo died plan. Ho w- ev er, to nd a de-/reordering whic h has as man y pairs of unordered actions as p ossible is the dual of computing a minim um de-/reordering and it is, th us, already co v ered. Minimizing the length of the longest c hain is a condition whic h ma y b e relev an t when actions can b e executed in parallel and the o v erall execution time is to b e minimized. Ho w ev er, since the n um b er of ordering constrain ts is quadratic in the length of a c hain (b ecause of transitiv e arcs), minimizing the size of the relation will often b e a reasonable appro ximation of min- imizing the c hain length. F urthermore, minimizing the longest c hain is still a rather w eak condition for this purp ose, so it is b etter to study directly the problem of nding shortest parallel executions of plans, whic h will b e done later in this article. Another issue is whether to minimize the size of the ordering relation as giv en, or to reduce the transitiv e or reductiv e closure of it. Since plans ma y ha v e sup eruous orderings with no particular purp ose, it is reasonable to standardize matters and either add all p ossible transitiv e arcs, getting the transitiv e closure, or to remo v e all transitiv e arcs, getting the reductiv e closure. The c hoice b et w een these t w o is not imp ortan t for the results to b e pro v en. Ho w ev er, minimizing the transitiv e closure will giv e a preference to plans with man y unordered short c hains of actions o v er plans with a few long c hains, and so seems to coincide b etter with the term 'least constrained'. 4.2 Computing Least-constrained Plans Minimal deordering is w eak er than the t w o other least-constrainmen t criteria considered, but it is the least costly to ac hiev e|it is the only one of the three criteria whic h can b e satised b y a p olynomial-time mo dication to a plan. 110 Comput a tional Aspects of Reordering Plans Denition 4.3 The se ar ch pr oblem Minimal-Constrained Deordering (MlCD) is dene d as fol lows: Given: A ppi and a -valid plan P . Output: A minimal-c onstr aine d de or dering of P wrt. . Theorem 4.4 MlCD c an b e solve d in p olynomial time if validity for p.o. plans c an b e teste d in p olynomial time. Pro of: Consider algorithm MLD in Figure 7 and let Q = h A; 0 i b e the plan output b y the algorithm on input P = h A; i . The plan Q is ob viously a v alid deordering of P wrt. . It is further ob vious from the termination condition in the while lo op that there is no other ordering 00 0 s.t. h A; 00 i is -v alid. It follo ws that Q is a minimal-constrained deordering. Since the algorithm ob viously runs in p olynomial time, the theorem follo ws. 2 F urthermore, if v alidit y testing is exp ensiv e, this will b e the dominating cost in the MLD algorithm. Corollary 4.5 If validity testing for p.o. plans c an b e solve d in time O ( f ( n )) for some function f ( n ) , then MlCD c an b e solve d in O (max f n 7 = 2 ; n 2 f ( n ) g ) time. 1 pro cedure MLD 2 Input: A v alid p.o. plan P = h A; i and a ppi 3 Output: A minimal deordering of P 4 while there is some e 2 s.t. h A; ( f e g ) + i is -v alid do 5 remo v e e from 6 return h A; + i ; Figure 7: The minimal-deordering algorithm MLD In particular, note that plan v alidation is p olynomial for the usual v arian t of prop o- sitional STRIPS without conditional actions (Neb el & B ac kstr om, 1994, Theorem 5.9). More precisely , this pro of p ertains to the Common Pr op ositional STRIPS formalism (CPS) and, th us, holds also for the other common v arian ts of prop ositional STRIPS, lik e Ground TWEAK (B ac kstr om, 1995). F urthermore, note that in practice it ma y not b e necessary to compute the transitiv e closure either for the output plan or for v alidating a plan in the algorithm. While minim um de-/reordering are stronger criteria than minimal deordering, they are also more costly to ac hiev e. Denition 4.6 The de cision pr oblem Minimum-Constrained Deordering (MmCD) is dene d as fol lows: Given: A ppi , a -valid plan P and an inte ger k 0 . Question: Is ther e a de or dering h A; i of P s.t. j j k ? 111 B ackstr om Denition 4.7 The de cision pr oblem Minimum-Constrained Reordering (MmCR) is dene d as fol lows: Given: A ppi , a -valid plan P and an inte ger k 0 . Question: Is ther e a r e or dering h A; i of P s.t. j j k ? Theorem 4.8 Minimum-Constrained Deordering is NP-har d. Pro of: Pro of b y reduction from Minimum Co ver (Garey & Johnson, 1979, p. 222), whic h is NP-complete. Let S = f p 1 ; : : : ; p n g b e a set of atoms, C = f C 1 ; : : : ; C m g a set of subsets of S and k j C j a p ositiv e in teger. A c over of size k for S is a subset C 0 C s.t. j C 0 j k and S [ T 2 C 0 T . Construct, in p olynomial time, the GT ppi = h; ; f r g i and the -v alid t.o. plan P = h a 1 ; : : : ; a m ; a S i where pr e ( a i ) = ; and p ost ( a i ) = C i for 1 i m , and further pr e ( a S ) = S and p ost ( a S ) = f r g . Ob viously , S has a minim um co v er of size k i there exists some -v alid p.o. plan Q = hf a 1 ; : : : ; a m ; a S g ; i s.t. j j k , since only those actions con tributing to the co v er need remain ordered wrt. to a S 2 Corollary 4.9 Minimum-Constrained Reordering is NP-har d. Corollary 4.10 Minimum-Constrained Deordering and Minimum-Constrained Reordering b oth r emain NP-har d even when r estricte d to GT plans wher e the actions have only p ositive pr e- and p ost-c onditions. Theorem 4.11 If validity for p.o. plans is in some c omplexity class C, then Minimum- Constrained Deordering and Minimum-Constrained Reordering ar e in N P C . Pro of: Guess a solution, v erify that it is a de-/reordering and then v alidate it using an oracle for C. 2 F or most common planning formalisms without conditional actions and con text-dep enden t eects, minimal de-/reordering is NP-complete. Theorem 4.12 If validity for p.o. plans c an b e teste d in p olynomial time, then Minimum- Constrained Deordering and Minimum-Constrained Reordering ar e NP-c omplete. Pro of: Immediate from Theorems 4.8 and 4.11 and from Corollary 4.9. 2 It follo ws immediately that the corresp onding searc h problems, that is, the problems of gener ating a minim um-constrained de-/reordering are also NP-hard (and ev en NP-equiv alen t if v alidit y testing is tractable). F urthermore, MmCD and MmCR are not only hard to solv e optimally , but ev en to appro ximate. Neither of these problems is in the appro ximation class APX (Crescenzi & P anconesi, 1991), ie neither problem can b e appro ximated within a constan t factor. (Both here and elsewhere in this article the term appro ximation is used in the constructiv e sense, that is the results refer to the existence/non-existence of algorithms pro ducing an appro ximate solution in p olynomial time). 112 Comput a tional Aspects of Reordering Plans Theorem 4.13 Minimum-Constrained Deordering and Minimum- Constrained Reordering c annot b e appr oximate d within a c onstant unless N P 2 DTIME ( n pol y l og n ) . Pro of: Supp ose there w ere a p olynomial-time algorithm A appro ximating MmCD within a constan t. Since the reduction in the pro of of Theorem 4.8 preserv es the solutions exactly , also appro ximations are preserv ed. Hence, Minimum Co ver could b e appro ximated within a constan t, but this is imp ossible unless N P 2 DTIME ( n pol y l og n ) (Lund & Y annak akis, 1994), whic h con tradicts the assumption. The case for MmCR is a trivial consequence. 2 If using the n um b er of prop ositional atoms in the plan as a measure of its size, this b ound can b e strengthened to (1 " ) ln jP j for arbitrary " unless N P 2 DTIME ( n log log n ) b y substituting suc h a result for Minimum Co ver (F eige, 1996) in the pro of ab o v e. 5. P arallel Plans In order to study the problem of nding a shortest parallel execution of a plan, the for- malisms used so far are not quite sucien t. Since they lac k a capabilit y of mo delling when actions can b e executed in parallel or not, it is imp ossible to sa y with an y reasonable pre- cision ho w a certain action ordering will aect the parallel execution time. P artial-order plans are sometimes referred to as parallel plans in literature. This is misleading, ho w ev er. That t w o actions are left unordered in suc h a plan means that they can b e executed in either order, without aecting the v alidit y of the plan, but in the general case there is no guaran tee that the plan will remain v alid also if the executions of the actions o v erlap temp orally . In some cases, unorderedness means that parallel or o v erlapping execution is allo w ed, while in other cases it do es not mean that, dep ending on the action mo delling and its underlying domain assumptions. In the rst case, the plan m ust ha v e a stronger ordering committmen t, an y t w o actions that m ust not ha v e o v erlapping executions m ust b e ordered, th us making the plan o v er-committed. In order to distinguish the t w o cases, a concept of parallel plans will b e in tro duced b elo w. A parallel plan is a partial-order plan with an extra relation, a non-c oncurr ency r elation , whic h tells whic h actions m ust not b e executed in parallel. In this article t w o actions are considered parallel if their executions ha v e an y temp oral o v erlap at all. Plans where all unordered actions can b e executed in parallel constitute the sp ecial case of denite parallel plans. Denition 5.1 A parallel plan is a triple P = h A; ; # i , wher e h A; i is a p.o. plan and # is an irr eexive, symmetric r elation on A . A denite p ar al lel p.o plan is a p ar al lel plan P = h A; ; # i s.t. # ( [ 1 ) . In tuitiv ely , a parallel plan is a p.o. plan extended with an extra relation, # (a non- c oncurr ency relation), expressing whic h of the actions m ust not b e executed in parallel. This relation is primarily in tended to con v ey information ab out actions that are unordered under the relation, although it is allo w ed to relate also suc h actions. That is, the # relation is in tended to capture information ab out whether t w o actions can b e executed in parallel or not, in general. That t w o actions are ordered in a plan forbids executing them in parallel in this particular plan, but do es not necessarily mean that the actions could not 113 B ackstr om b e executed in parallel under dieren t circumstances. Planning algorithms frequen tly pro- duce o v ercommitted orderings on plans, and the whole purp ose of this article is to study the problem of optimizing plans b y nding and remo ving suc h o v ercommitted orderings. Hence, there are no restrictions in general on the relation # in addition to those in Denition 5.1. F or instance, a b do es not imply that a # b . Ho w ev er, the non-concurrency relation will frequen tly b e constrained to satisfy the p ost-exclusion principle. Denition 5.2 A p ar al lel GT plan P = h A; ; # i satises the p ost-exclusion principle i for al l actions a; b 2 A , a # b whenever ther e is some atom p s.t. p 2 p ost ( a ) and : p 2 p ost ( b ) . The denition of plan v alidit y is directly inherited from p.o. plans. Denition 5.3 Given a ppi , a p ar al lel plan h A; ; # i is -valid i the p.o. plan h A; i is -valid. The non-concurrency relation is, th us, not relev an t for deciding whether a plan is v alid or not. Instead, it is used for constraining ho w parallel plans ma y b e executed and it is the core concept b ehind the denition of parallel executions. Consider, for instance, the GT plan hf A; B ; C g ; fh A; B i g ; fh B ; C ig i whic h is sho wn in Figure 8 (arro ws denote ordering relations and dashed lines denote nonconcurrency rela- tions). This plan is v alid wrt. the ppi = h; ; f r ; s g i , that is the nal v alue of the atom q do es not matter. Since B # C holds the actions B and C are constrained not to b e executed in parallel, but ma y b e executed in either order, that is, the plan is not denite. This could b e b ecause the p ost-exclusion principle is emplo y ed, or for some other reason. Although A # B do es not hold the actions A and B clearly cannot b e executed in parallel, since A B holds. There are four w a ys to execute this plan, in either of the three sequences A,B,C; A,C,B and C,A,B, or b y executing A and C in parallel, follo w ed b y B (unit length is as- sumed). Also note that this plan w ould no longer b e v alid if the goal con tained either q or : q , since the nal truth v alue of q dep ends on the actual execution order. F urthermore, an y reordering of the plan w ould ha v e to k eep the ordering constrain t A B to satisfy the v alidit y criterion, wh y it is not necessary to ha v e the constrain t A # B . It w ould do no harm here to include this restriction, but in more complex plans it ma y b e an o v er-constrainmen t, if there are sev eral pro ducers for the atom p to c ho ose b et w een, for instance. T o sum up, the non-concurrency relation should primarily b e used to mark whic h actions m ust not b e in parallel in addition to those already forbidden to b e in parallel b ecause of v alidit y . This framew ork for parallel plans admits expressing p ossible parallelism only; necessary parallelism is out of the scop e of this article and requires a planner ha ving access to and b eing able to mak e use of further additional information, p erhaps a temp oral algebra. F urthermore, a set of non-concurren t actions can easily b e expressed b y making all actions in the set pairwise non-concurren t, but the formalism is not sucien t to sa y that k of the actions, but not more, in suc h a set ma y b e executed in parallel. Similarly , it is not p ossible to express that an action m ust executed b efore or after an in terv al, or that t w o sets of actions m ust ha v e non-o v erlapping executions. Denition 5.4 L et P = h A; ; # i b e a p ar al lel plan and let the function d : A 7! N denote the dur ation of e ach action. A parallel execution of P is a function r : A 7! N , denoting r ele ase times for the actions in A , satisfying that for al l a; b 2 A , 114 Comput a tional Aspects of Reordering Plans A B C s : q # q p r Figure 8: A parallel plan 1. if a b , then r ( a ) + d ( a ) r ( b ) and 2. if a # b , then either (a) r ( a ) + d ( a ) r ( b ) or (b) r ( b ) + d ( b ) r ( a ) . The length of the p ar al lel exe cution is dene d as max a 2 A f r ( a ) + d ( a ) g , ie, the latest nish- ing time of any action. A minim um parallel execution of plan is a p ar al lel exe cution with minimum length among al l p ar al lel exe cutions of the plan. The length of a p ar al lel plan P , denote d length ( P ) , is the length of the minimum p ar al lel exe cution(s) for P . Ob viously , ev ery parallel plan has a parallel execution of length P a 2 A d ( a ) (whic h is the trivial case of sequen tial execution). F urthermore, in certain cases, hardness results will b e strengthened b y restricting the duration function. Denition 5.5 The sp e cial c ase wher e d ( a ) = 1 for al l a 2 A is r eferr e d to as the unit time assumption. Deciding whether a release-time function is a parallel execution is tractable. Theorem 5.6 Given a p ar al lel plan P = h A; ; # i , a dur ation function d : A 7! N and a r ele ase-time function r : A 7! N , it c an b e de cide d in p olynomial time whether r is a p ar al lel exe cution for P and, in the c ase it is, what the length of this exe cution is. Pro of: T rivial. 2 Consider the plan in Figure 8 and three release-time functions r 1 , r 2 and r 3 , dened as follo ws r 1 ( A ) = 1 r 1 ( B ) = 2 r 1 ( C ) = 3 r 2 ( A ) = 1 r 2 ( B ) = 2 r 2 ( C ) = 1 r 3 ( A ) = 1 r 3 ( B ) = 2 r 3 ( C ) = 2 : Both r 1 and r 2 are parallel executions of the plan, while r 3 is not. F urthermore, r 2 is a minim um parallel execution for the plan, ha ving length 2. Ho w ev er, computing the minim um parallel execution of a parallel plan is dicult in the general case. 115 B ackstr om Denition 5.7 The de cision pr oblem P arallel Plan Length (PPL) is dene d as fol- lows: Given: A p ar al lel plan P = h A; ; # i , a dur ation function d and an inte ger k . Question: Do es P have a p ar al lel exe cution of length k or shorter? Theorem 5.8 P arallel Plan Length is NP-har d. Pro of: Hardness is pro v en b y transformation from Graph K-Colourability (Garey & Johnson, 1979, p. 191), whic h is NP-complete. Let G = h V ; E i b e an arbitrary undi- rected graph, where V = f v 1 ; : : : ; v n g . Construct, in p olynomial time, a GT ppi as fol- lo ws. Dene the ppi = h; ; f p 1 ; : : : ; p n g i . Also dene the parallel plan P = h A; ; ; # i , where A con tains one action a i for eac h v ertex v i 2 V , s.t. pr e ( a i ) = ; and p ost ( a i ) = f p i ; q i g [ f: q j j f v i ; v j g 2 E g . Finally , let a i # a j i f v i ; v j g 2 E , whic h satises the p ost- exclusion principle. The plan P just constructed is ob viously -v alid. It is easy to see that G is k -colourable i P has a parallel execution of length k wrt. since eac h colour of G will corresp ond to a unique release time in the parallel execution of P . 2 Corollary 5.9 P arallel Plan Length r emains NP-har d even when r estricte d to GT ac- tions with empty pr e c onditions and under the assumption of unit time and the p ost-exclusion principle. Theorem 5.10 P arallel Plan Length is in NP. Pro of: Guess a parallel execution. Then v erify it, whic h can b e done in p olynomial time according to Theorem 5.6. 2 Computing a minim um parallel execution of a plan is tractable for the sp ecial case of denite plans, ho w ev er. Theorem 5.11 P arallel Plan Length c an b e solve d in p olynomial time for denite p ar al lel plans. Pro of: Use the algorithm DPPL (Figure 9), whic h is a straigh tforw ard stratication algorithm for directed D A Gs. 2 6. Reordering P arallel Plans Ha ving dened the concept of parallel plan, it is p ossible to dene concepts similar to the previous least-constrainmen t criteria whic h are more appropriate for minimizing the execution time of parallel plans. Denition 6.1 L et P = h A; ; # i and Q = h A; 0 ; # i b e two p ar al lel plans and a ppi . Then, 1. Q is a parallel reordering of P wrt. i b oth P and Q ar e -valid; 116 Comput a tional Aspects of Reordering Plans 1 pro cedure DPPL 2 Input: A denite parallel plan P = h A; ; # i 3 Output: A minim um parallel execution r for P 4 Construct the directed graph G = h A; i 5 for all a 2 A do 6 r ( a ) 0 7 while A 6 = ; do 8 Select some no de a 2 A without predecessors in A 9 for all b 2 A s.t. a b do 10 r ( b ) max ( r ( b ) ; r ( a ) + d ( a )) 11 A A f a g 12 return r Figure 9: Algorithm for computing a minim um parallel execution for denite parallel plans. 2. Q is a parallel deordering of P wrt. i Q is a p ar al lel r e or dering of P and 0 ; 3. Q is a minim um parallel reordering of P wrt. i (a) Q is a p ar al lel r e or dering of P wrt. and (b) no other p ar al lel r e or dering of P wrt. is of shorter length than Q ; 4. Q is a minim um parallel deordering of P wrt. i (a) Q is a p ar al lel de or dering of P wrt. and (b) no other p ar al lel de or dering of P wrt. is of shorter length than Q . Mo difying plans to satisfy either of the latter t w o criteria is dicult in the general case, ho w ev er. Denition 6.2 The de cision pr oblem Minimum P arallel Deordering (MmPD) is de- ne d as fol lows. Given: a ppi , a p ar al lel plan P , a dur ation function d and an inte ger k . Question: Do es P have a de or dering with a p ar al lel exe cution of length k wrt. ? Denition 6.3 The de cision pr oblem Minimum P arallel Reordering (MmPR) is de- ne d as fol lows. Given: a ppi , a p ar al lel plan P , a dur ation function d and an inte ger k . Question: Do es P have a r e or dering with a p ar al lel exe cution of length k wrt. ? Theorem 6.4 Minimum P arallel Deordering is NP-har d. Pro of: Similar to the pro of of Theorem 6.4. Giv en a graph G and an in teger k , construct a ppi and a plan P = h A; ; # i in the same w a y as in the pro of of Theorem 5.8, but let b e an arbitrary total order on A . Ob viously , P is -v alid and Q = h A; ; ; # i is a deordering of P s.t. no other deordering of P is shorter than Q . Hence, Q , and th us P , has a deordering with a parallel execution of length k i G is k -colourable. 2 117 B ackstr om Corollary 6.5 Minimum P arallel Reordering is NP-har d. Corollary 6.6 Minimum P arallel Deordering and Minimum P arallel Reorder- ing r emain NP-har d even when r estricte d to total ly or der e d GT plans and under the as- sumptions of unit time and simple c oncurr ency. Note that the restriction to denite input plans is co v ered b y this corollary . If output plans are also required to b e denite, then the reordering case remains NP-hard. Theorem 6.7 Minimum P arallel Reordering r emains NP-har d also when the output plan is r estricte d to b e denite. Pro of: Reuse the pro of for Theorem 6.4 as follo ws. Let r b e a shortest parallel execution for the plan Q and assume this execution is of length n . Construct an order 0 on A s.t. for all actions a; b 2 A , a 0 b i r ( a ) < r ( b ). Ob viously the plan h A; 0 ; # i is a denite minim um parallel reordering of P . It follo ws that P has a denite parallel reordering of length k i G is k -colourable. 2 It is an op en question whether minim um deordering remains NP-hard when also output plans m ust b e denite, but an imp ortan t sp ecial case is p olynomial, as will b e pro v en in the next section. Theorem 6.8 Minimum P arallel Deordering and Minimum P arallel Reorder- ing ar e in N P C if validation of p.o. plans is in some c omplexity class C . Pro of: Giv en a plan h A; ; # i , a duration function d and a parameter k , guess a de/reordering 0 and a release-time function r . Then v erify , using an oracle for C , that h A; 0 ; # i is v alid. Finally , v erify that r is a parallel execution of length k , whic h is p olynomial according to Theorem 5.6. 2 Theorem 6.9 Minimum p ar al lel de-/r e or dering is NP-c omplete if p.o. plans c an b e vali- date d in p olynomial time. Pro of: Immediate from Theorems 6.4 and 6.8 and Corollary 6.5. 2 The problems MmPD and MmPR are not only hard to solv e optimally , but also to appro ximate. Theorem 6.10 Minimum P arallel Deordering and Minimum P arallel Reorder- ing c annot b e appr oximate d within j A j 1 = 7 " for any " > 0 , unless P=NP. Pro of: Supp ose there w ere a p olynomial-time algorithm A appro ximating MmCD within j A j 1 = 7 " for some " > 0. Then it is immediate from the pro of of Theorem 6.4 that also Graph K-Colourability could b e appro ximated within j A j 1 = 7 " , whic h is imp ossible unless P=NP (Bellare, Goldreic h, & Sudan, 1995). 2 With the same reasoning, this b ound can b e strengthened to j A j 1 " , under the assumption that co-RP 6 =NP (F eige & Kilian, 1996). 118 Comput a tional Aspects of Reordering Plans 7. Restricted Cases Since the problems of computing minim um de-/reorderings are v ery dicult, and are ev en dicult to appro ximate, an alternativ e w a y of tac kling them could b e to study restricted cases. One sp ecial case already considered is the restriction to denite plans only . While the problem MmPR is still NP-complete under this restriction, it is an op en question whether also MmPD is NP-complete. A p ositiv e result can b e pro v en, though, to the eect that MmPD is p olynomial for denite plans for a large class of planning languages, including most of the commonly used ones. This result will b e pro v en b y generalising an algorithm from the literature for deordering total-order plans. Based on the (not necessarily true) argumen t that it is easier to generate a t.o. plan than a p.o. plan when using complex action represen tations, Regnier and F ade (1991a, 1991b) ha v e presen ted an algorithm for con v erting a t.o. plan in to a p.o. plan. The resulting plan has the prop ert y that all its unordered actions can b e executed in parallel, that is, the plan is denite. The authors of the algorithm further claim that the algorithm nds all pairs of actions that can b e executed in parallel and, hence, the plan can b e p ost-pro cessed to nd an optimal parallel execution. They do not dene what they mean b y this criterion, ho w ev er. Inciden tally , the algorithm prop osed b y Regnier and F ade is a sp ecial case of an algo- rithm earlier prop osed for the same problem b y P ednault (1986), who did not mak e an y claims ab out optimalit y . If remo ving from Regnier and F ade's algorithm all details relev an t only for their particular implemen tation and planning language, the t w o algorithms coincide and they are th us presen ted here as one single algorithm, the PRF algorithm 4 (Figure 10). PRF is sligh tly mo died from the original algorithms. First, it do es not assume that the in- put plan is totally ordered, since it turns out to b e sucien t that it is a denite partial-order plan. Second, PRF returns a parallel plan, rather than a p.o. plan|a harmless mo dica- tion since the only additional piece of information is the non-concurrency relation, whic h is already giv en as input, either explicitly or implicitly . Third, PRF returns the transitiv e closure of its ordering relation. This is b y no means necessary , and is motiv ated, as usual, b y conforming to the denitions of this article. 1 pro cedure PRF; 2 Input: A ppi , a -v alid denite p.o. plan h A; i and a non-concurrency relation # 3 Output: A -v alid parallel plan 4 for all a; b 2 A s.t. a b do 5 if a # b then 6 Order a 0 b ; 7 return h A; 0 + ; # i ; Figure 10: The PRF algorithm Ob viously , PRF computes a deordering of its input, and it is unclear whether it is p os- sible to compute a minimal denite deordering in p olynomial time. Ho w ev er, the algorithm 4. Here and afterw ards, the algorithms from the literature will b e referred to b y acron yms consisting of the initials of its authors, in this case P ednault, Regnier and F ade. 119 B ackstr om has b een abstracted here to a v ery general formalism, and an analysis for restricted for- malisms rev eals more ab out its p erformance. The language used b y Regnier and F ade is unnecessarily restricted so the algorithm will b e sho wn to w ork for a considerably more general formalism, based on generalising and abstracting the concepts of pro ducers, con- sumers and threats used in most common planners and planning languages, e g STRIPS and TWEAK. This formalism will b e referred to as the Pr o duc er-Consumer-Thr e at formalism (PCT) . Let pr od ( a; ) denote that a pro duces the condition , cons ( a; ) that a consumes and thr eat ( a; ) that a is a threat to . T o simplify the denitions, the standard transformation will b e used of sim ulating the initial and goal states with actions. That is, ev ery PCT plan con tains an action ordered b efore all other actions whic h consumes nothing and pro duces the initial state. Similarly , there is an action ordered after all other actions whic h consumes the goal state and pro duces nothing. This means that the ppi is con tained within the plan itself, so all references to ppi s can b e omitted in the follo wing. V alidit y of plans can then b e dened as follo ws. Denition 7.1 A t.o. PCT plan h a 1 ; : : : ; a n i is valid i for al l i , 1 i n and al l c onditions s.t. cons ( a i ; ) , ther e is some j , 1 j < i s.t. pr od ( a j ; ) and ther e is no k , j k i s.t. thr eat ( a k ; ) . A p.o. PCT plan is valid i al l top olo gic al sortings of it ar e valid. Chapman's Mo dal-truth Criterion (MTC) (Chapman, 1987) can b e abstracted to the PCT formalism and b e analogously used for v alidating p.o. plans. Denition 7.2 The mo dal truth criterion (MTC) for a PCT plan h A; i is: 8 a C 8 ( cons ( a C ; ) ! 9 a P ( pr od ( a P ; ) ^ a P a C ^ 8 a T ( thr eat ( a T ; ) ! a C a T _ 9 a W ( pr od ( a W ; ) ^ a T a W ^ a W a C )))) Theorem 7.3 The MTC holds for a PCT plan P i it is valid. Pro of: T rivial generalization of the pro ofs leading to Theorem 5.9 in Neb el and B ac kstr om (1994). 2 Only a minim um of constrain ts for when t w o actions ma y not b e executed in parallel will b e required. These constrain ts are ob ey ed b y most planners in the AI literature. Denition 7.4 Simple concurrency holds if for al l actions a , b s.t. a 6 = b , the non- c oncurr ency r elation satises the fol lowing thr e e c onditions 1. pr od ( a; ) ^ cons ( b; ) ! a # b 2. pr od ( a; ) ^ thr eat ( b; ) ! a # b 3. cons ( a; ) ^ thr eat ( b; ) ! a # b 120 Comput a tional Aspects of Reordering Plans Note that it is not required that t w o pro ducers, t w o consumers or t w o threats of the same condition are non-concurren t, th us allo wing, for instance, plans with m ultiple pro ducers, e g Neb el and B ac kstr om (1994, Fig. 4) and Kam bhampati (1994). The axioms do not prev en t adding suc h restrictions, though. F urthermore, note that the denition only states a nec- essary condition for non-concurrency|it is p erfectly legal to add further non-concurrency constrain ts on the actions in a plan. It ma y also b e w orth noting that the MTC requires pro ducers and threats to b e ordered only if there is a correpsonding consumer, while a denite plan satisfying the simple concurrency criterion alw a ys require them to b e ordered. The follo wing observ ation ab out PRF is immediate from the algorithm and will b e used in the pro ofs b elo w. Observ ation 7.5 If h A; ; # i is the input to PRF and h A; 0 ; # i is the c orr esp onding output, then it holds that a 0 b i a b and a # b . Based on this lemma, it can b e pro v en that PRF preserv es v alidit y . Lemma 7.6 If the plan input to PRF is a valid PCT plan and # satises the simple c oncurr ency criterion, then the output plan is valid. Pro of: Let P = h A; ; # i b e the input plan and Q = h A; 0 ; # i the output plan. Since P is v alid, it follo ws from Theorem 7.3 that the MTC holds for P . Adding the implied simple-concurrency constrain ts to the MTC yields the follo wing condition: 8 a C 8 ( cons ( a C ; ) ! 9 a P ( pr od ( a P ; ) ^ a P a C ^ a P # a C ^ 8 a T ( thr eat ( a T ; ) ! ( a C a T ^ a C # a T ) _ 9 a W ( pr od ( a W ; ) ^ a T a W ^ a T # a W ^ a W a C ^ a W # a C )))). By applying Observ ation 7.5 this can b e simplied to: 8 a C 8 ( cons ( a C ; ) ! 9 a P ( pr od ( a P ; ) ^ a P 0 a C ^ 8 a T ( thr eat ( a T ; ) ! a C 0 a T _ 9 a W ( pr od ( a W ; ) ^ a T 0 a W ^ a W 0 a C )))), whic h is the MTC for the plan Q . Once again using Theorem 7.3, it follo ws that Q is v alid. 2 This allo ws for pro ving that PRF pro duces denite minim um deorderings of denite PCT plans under simple concurrency . Theorem 7.7 If using the PCT formalism and simple c oncurr ency, then PRF pr o duc es a minimum-de or der e d denite version of its input. 121 B ackstr om Pro of: Let P = h A; ; # i b e the input plan, whic h is assumed v alid and denite, and Q = h A; 0 ; # i the output plan. It is ob vious that 0 and it follo ws from Lemma 7.6 that Q is v alid, so Q is a deordering of P . It remains to pro v e that Q is a minim um deordering of P . Supp ose that P has a deordering R = h A; 00 ; # i s.t. j 00 j < j 0 j . Then, there m ust b e some a; b 2 A s.t. a 0 b , but not a 00 b . It can b e assumed that a 0 b is not a transitiv e arc in 0 , since the transitiv e closure is an yw a y computed at the end of the algorithm. Since the order 0 is pro duced b y PRF, it follo ws from Observ ation 7.5 that a b and a # b . Because of the latter constrain t, it is necessary that either, a 00 b or b 00 a holds, but only the former is p ossible since a b and R is a deordering of P . This con tradicts the assumption, so Q m ust b e a minim um deordering of P . 2 Since PRF is a p olynomial algorithm, it follo ws that denite minim um deorderings of denite PCT plans can b e computed in p olynomial time under simple concurrency . F ur- thermore, since PRF pro duces denite plans it is p ossible to actually compute the shortest parallel execution ecien tly . Theorem 7.8 If the plan input to PRF is a valid and denite PCT plan satisfying the simple c oncurr ency criterion, then PRF outputs a denite minimum de or dering of this plan. Pro of: PRF runs in p olynomial time and ob viously pro duces denite parallel plans. Hence, it follo ws from Theorem 5.11 that a minim um parallel execution for the output plan can b e found in p olynomial time, whic h pro v es the theorem. 2 It seems lik ely that this is what Regnier and F ade mean t with their optimalit y claim, al- though for a sp ecial instance of the PCT formalism. This result sa ys nothing ab out the dicult y of nding a minim um reordering of a plan, since PRF only considers deorderings. Since minim um deorderings do not appro ximate minim um reorderings w ell, it can b e sus- p ected that it is more dicult to compute the latter. The follo wing theorem conrms this suspicion, sho wing that the latter problem remains NP-hard under quite sev ere restrictions, including the follo wing t w o. Denition 7.9 A GT action a is toggling i for al l liter als l 2 p ost ( a ) , it is also the c ase that : l 2 pr e ( a ) . A GT action a is unary i j p ost ( a ) j = 1 . Theorem 7.10 Minimum P arallel Reordering r emains NP-har d even when r estricte d to total-or der GT plans with only to ggling unary actions and under the assumption of unit time, simple c oncurr ency and that no actions ar e r e dundant. The pro of of this theorem app ears in App endix A. While minim um reorderings are more dicult to compute than minim um deorderings, they can also pro duce arbitrarily b etter results. Theorem 7.11 Minimum P arallel Deordering c annot appr oximate Minimum P ar- allel Reordering within j A j k for any c onstant k 0 . The pro of of this theorem app ears in App endix A. 122 Comput a tional Aspects of Reordering Plans Corollary 7.12 Minimum P arallel Deordering c annot appr oximate Minimum P ar- allel Reordering within j A j k for any c onstant k 0 even when the pr oblems ar e r e- stricte d to GT plans with only p ositive pr e c onditions and under the assumption of simple c oncurr ency. It ma y , th us, app ear as though minim um reordering is a preferable, alb eit more costly , op eration than minim um deordering. Ho w ev er, if the plan mo dication is to b e follo w ed b y sc heduling, it is no longer ob vious that a reordering is to prefer. Since sc heduling ma y tak e further information and constrain ts in to accoun t, e g upp er and lo w er b ounds on the release time and limited resources, a feasible sc hedule for the original plan ma y no longer b e a feasible sc hedule for a reordering of the same plan. That is, some or all feasible solutions ma y b e lost when reordering a plan. In con trast to this, deordering a plan is harmless since all previously feasible sc hedules are preserv ed in the deordering. Of course, the de- /reordered plan ma y ha v e new and b etter sc hedules than the old plan, whic h is wh y the problems studied in this article are in teresting at all. Ho w ev er, while minim um deordering is a safe and, usually c heap, op eration, minim um reordering is neither and m ust th us b e applied with more care. T o nd a reordering of a plan with an optim um sc hedule w ould require com bining minim um reordering and sc heduling in to one single computation, but it is out of the scop e of this article to study suc h com binations. Suce it to observ e that suc h a computation is nev er c heap er than either of its constituen t computations. 8. Related w ork This section analyses and discusses some algorithms suggested in the literature for gener- alising the ordering of a plan, in addition to the PRF algorithm already analysed in the preceeding section. Also some planners that generate plans with some optimalit y a v our on the ordering are discussed. Some of the algorithms to b e analysed use the common tric k of sim ulating the initial state and the goal of a planning instance b y t w o extra op erators, in the follo wing w a y . Let P = h A; i b e a plan and = h I ; G i a ppi , b oth in the GT language. In tro duce t w o extra actions a I , with pr e ( a I ) = ; and p ost ( a I ) = I , and a G , with pr e ( a G ) = G and p ost ( a G ) = ; . Dene the plan Q = h A [ f a I ; a G g ; 0 i where 0 = [f a I a; a a G j a 2 A g [ f a I a G g , that is a I is ordered b efore all other actions and a G is ordered after all other actions. The plan Q is a represen tation of b oth the plan P and the ppi . Suc h a com bined represen tation will b e referred to as a self-c ontaine d plan . A self-con tained plan is v alid i it is v alid wrt. to the ppi h; ; ; i . It is trivial to con v ert a plan and a ppi in to a corresp onding self-con tained plan and vice v ersa. Hence, b oth w a ys of represen ting a plan will b e used alternately without further notice. 8.1 The VPC Algorithm V eloso et al. (1990) ha v e presen ted an algorithm (here referred to as VPC 5 ) for con v erting t.o. plans in to `least-constrained' p.o. plans. They use the algorithm in the follo wing con text. First a total-order planner ( NoLimit ) is used to pro duce a t.o. plan. VPC con v erts this plan 5. In the original publication the algorithm w as named Build P artial Order. 123 B ackstr om 1 pro cedure VPC; 2 Input: a v alid self-con tained t.o. plan h a 1 ; : : : ; a n i where a 1 = a I and a n = a G 3 Output: A self-con tained v alid p.o. plan 4 for 1 i n do 5 for p 2 pr e ( a i ) do 6 Find max k < i s.t. p 2 p ost ( a k ); 7 if suc h a k exists then 8 Order a k a i 9 for : p 2 p ost ( a i ) do 10 for 1 k < i s.t. p 2 pr e ( a k ) do 11 Order a k a i 12 for eac h primary eect p 2 p ost ( a i ) do 13 for 1 k i s.t. : p 2 p ost ( a k ) do 14 Order a i a k 15 for 1 < i < n do 16 Order a I a i and a i a G 17 return hf a 1 ; : : : ; a n g ; + i ; Figure 11: The VPC algorithm in to a p.o. plan whic h is then p ost-pro cessed to determine whic h actions can b e executed in parallel. The action language used is a STRIPS-st yle language allo wing quan tiers and con text-dep enden t eects. Ho w ev er, the plans pro duced b y the planner, and th us input to VPC, are ground and without con text-dep enden t eects. That is, they are ordinary prop ositional STRIPS plans. The VPC algorithm is presen ted in Figure 11, with a few minor dierences in presen tation as compared to its original app earance: First, the algorithm is presen ted in the GT formalism, in order to minimize the n um b er of formalisms in this article, but all preconditions are assumed to b e p ositiv e, th us coinciding with the original algorithm. Second, while the original algorithm returns the transitiv e reduction of the computed order it instead returns the transitiv e closure here, an unimp ortan t dierence in order to coincide with the denition of plans in this article. F urthermore, V eloso 6 has p oin ted out that the published v ersion of the VPC algorithm is incorrect and that a corrected v ersion exists. The v ersion presen ted in Figure 11 is this corrected v ersion. A prop osition is a primary eect if it app ears either in the goal or in the subgoaling c hain of a goal prop osition. VPC is a greedy algorithm whic h constructs an en tirely new partial order b y analysing the action conditions, using the original total order only to guide the greedy strategy . The algorithm is claimed (V eloso et al., 1990, p. 207) to pro duce a `least-constrained' p.o. plan, although no denition is giv en of what this means. V eloso 7 has conrmed that the term `least constrained plan' w as used in a `lo ose sense' and no optimalit y claim w as in tended. Ho w ev er, if this term is not dened, then it is imp ossible to kno w what problem the algorithm is in tended to solv e or ho w to judge whether it mak es an y impro v emen t o v er using no algorithm at all. In the absence of suc h a denition from its authors, the algorithm will b e analysed with resp ect to the least-constrainmen t criteria dened in Section 4. This is admittedly a 6. P ersonal comm unication, o ct. 1993. 7. V eloso, ibid. 124 Comput a tional Aspects of Reordering Plans a b c p q p q r q s 1 P P P P P P q P 1 a b c p q p q r q s - - P 2 Figure 12: The p.o. plans in the failure example for VPC. somewhat unfair analysis, but it rev eals some in teresting facts ab out the algorithm, and ab out what problems it do es not solv e. It is immediate from Theorem 4.8 and Corollary 4.9 that VPC cannot b e exp ected to pro duce minim um-constrained de-/reorderings. P erhaps more surprisingly , VPC do es not ev en guaran tee that its output is a minimal -constrained deordering of its input, a problem already pro v en trivially p olynomial (Theorem 4.4). This is illustrated b y the follo wing example. Supp ose a total-order planner is giv en the ppi = h; ; f r ; s gi as input. It ma y then return either of the -v alid t.o. plans h a; b; c i and h a; c; b i , with action conditions as sho wn in Figure 12. When used as input to VPC, these t w o t.o. plans will giv e quite dier- en t results|the plan h a; c; b i will b e con v erted to the p.o. plan P 1 in Figure 12, while the plan h a; b; c i will b e con v erted to the p.o. plan P 2 in Figure 12. That is, in the rst case VPC pro duces a plan whic h is not only a minimal-constrained deordering but ev en a minim um-constrained deordering, while in the second case it do es not ev en pro duce a minimal-constrained deordering. 8 The reason that VPC ma y fail to pro duce a minimal-constrained deordering is that it uses a non-admissible greedy strategy . Whenev er it needs to nd an op erator a ac hieving an eect required b y the precondition of another op erator b , it c ho oses the last suc h action ordered b efore b in the input t.o. plan. Ho w ev er, there ma y b e other actions earlier in the plan ha ving the same eect and b eing a b etter c hoice. 8.2 The KK algorithm Kam bhampati and Kedar (1994) ha v e presen ted an algorithm for generalising the order- ing of a p.o. plan, using explanation-based generalisation. The algorithm is based on rst constructing a v alidation structure for the plan and then use this as a guide in the gen- eralisation phase. In the original pap er, these computations are divided in to t w o separate algorithms (EXP-MTC and EXP-ORD-GEN), but are here compacted in to one single al- gorithm, KK (Figure 13). F urthermore, the v ersion presen ted here is restricted to ground GT plans, while the original algorithm can also handle partially instan tiated plans. This is no restriction for the results to b e sho wn b elo w. The rst part of the KK algorithm constructs a v alidation structure V for the plan, that is, an explanation for eac h precondition of ev ery action in the plan. The v alidit y criterion underlying this phase is a simplied v ersion of Chapmans mo dal-truth criterion (Chapman, 8. Note that transitiv e arcs are omitted in the gures, so P 2 really has an ordering relation of size three. Although this example w ould not w ork if plans had b een dened in the equally reasonable w a y that ordering relations should b e in transitiv e, it is p ossible to construe similar examples also for this case. 125 B ackstr om 1 pro cedure KK 2 Input: A v alid self-con tained p.o. plan h A; i 3 Output: A deordering of the input plan 4 commen t Build a validation structur e V for the plan 5 V ; 6 Let h a 1 ; : : : ; a n i b e a top ologically sorted v ersion of h A; i 7 for 1 i n do 8 for p 2 pr e ( a i ) do 9 Find min k < i s.t. 10 1. p 2 p ost ( a k ) and 11 2. there is no j s.t. k < j < i and : p 2 p ost ( a j ) 12 Add h a k ; p; a i i to V 13 commen t Construct a gener alise d or dering 0 for the plan 14 for eac h h a; b i 2 do 15 Add h a; b i to 0 if either of the follo wing holds 16 1. a = a I or a = a G 17 2. h a; p; b i 2 V for some p 18 3. h c; p; a i 2 V and : p 2 p ost ( b ) 19 4. h b; p; c i 2 V and : p 2 p ost ( a ) 20 return h A; 0 i Figure 13: The KK algorithm 1987) without white knigh ts. Since the algorithm is simplied to only handle ground plans here, an explanation is a causal link h a P ; p; a C i , meaning that the action a P pro duces the condition p whic h is consumed b y the action a C . The algorithm constructs exactly one causal link for eac h precondition, and it c ho oses the earliest pro ducer of p preceeding a C with no in terv ening action pro ducing : p b et w een this pro ducer and a C . The second phase of the algorithm builds a generalised ordering 0 for the plan based on this v alidation structure. T o put things simply , only those orderings of the original plan are k ept whic h either corresp ond to a causal link in the v alidation structure or that is required to prev en t a threatening action to b e unordered wrt. the actions in suc h a causal link. It turns out that also the KK algorithm fails in generating plans that are guaran- teed to b e ev en minimal-constrained deorderings. Consider the t.o. plan h A; B ; C ; D i with action conditions as indicated in Figure 14. This t.o. plan is v alid for the ppi h; ; f r ; s; t; u gi . Since the KK algorithm alw a ys c ho oses the earliest p ossible pro ducer of a precondition for the v alidation structure, it will build the v alidation structure fh A; p; D i ; h A; s; a G i ; h B ; q ; D i ; h B ; t; a G i ; h C ; r ; a G i ; h D ; u; a G ig . Hence, the nal ordering pro duced b y KK will b e as sho wn in Figure 14a. Ho w ev er, this plan is not a minimal- constrained deordering of the original plan, since it can b e further deordered as sho wn in Figure 14b and remain v alid. In this example, the input plan w as totally ordered. In the case of partially ordered input plans, the b eha viour of the algorithm dep ends on the particu- lar top ological order c ho osen. So the algorithm ma y or ma y not nd a minimal-constrained deordering, but it is imp ossible to guaran tee that it will succeed for all plans. Similarly , the authors men tion that one ma y consider dieren t w a ys of constructing the v alidation struc- 126 Comput a tional Aspects of Reordering Plans ture. This w ould clearly also mo dify the b eha viour and it remains an op en question whether it is p ossible to generate, in p olynomial time, a v alidation structure that guaran tees that a minimal-constrained deordering is constructed in the second phase of the algorithm. Find- ing a v alidation structure that guaran tees a minim um-constrained deordering is ob viously an NP-hard problem since the second phase of the algorithm is p olynomial. p s A q t B D p q u p s A p q r C q t B - Z Z Z Z ~ - D q u p q r C p a) Plan pro duced b y KK b) Minimal deordered v ersion of a Figure 14: F ailure example for the KK algorithm 8.3 Planners with Optimalit y Guaran tees The planning algorithm Graphplan (Blum & F urst, 1997) has a notion of time steps and tries to pac k as man y non-in teracting actions as p ossible in to one single time step. F urther- more, Graphplan nds the shortest plan, using the n um b er of time steps as the measure. If assuming unit time and that all actions considered as non-in teracting b y Graphplan can b e executed in parallel, then there is no plan ha ving a shorter parallel execution than the plan pro duced b y Graphplan . That is, Graphplan pro duces minim um reordered parallel plans under these assumptions. The second assumption is no limitation in practice, since eac h non-concurrency relation can b e enco ded b y in tro ducing a new atom and letting one of the in teracting actions add it while the other one deletes it. The unit time assump- tion is more serious, ho w ev er, esp ecially since this assumption is lik ely not to hold in most applications. In the car-assem bly scenario in Section 2, for instance, Graphplan w ould pro duce a plan that corresp onds to the plan in Figure 5. Hence, the plan pro duced under the unit-time assumption happ ens to coincide with the optimal plan when taking actual execution times in to accoun t. This is just a fortunate coincidence, ho w ev er, dep ending on the particular durations of actions in this example. Supp ose instead that the durations of the actions are sligh tly dieren t suc h that P A C has duration 2 and MvT1 has duration 8. Then the plan pro duced b y Graphplan , whic h corresp onds to the plan in Figure 5, do es not ha v e a faster sc hedule than 19 time units. This is not optimal since the plan in Figure 4 can b e sc heduled to execute in 17 time units for these particular duration times. F urther- more, it m ust b e remem b ered that Graphplan is an yw a y restricted to those cases where a GT-equiv alen t planning language is sucien t, although recen t impro v emen ts extend it to 127 B ackstr om somewhat more expressiv e languages (Gazen & Knoblo c k, 1997; K ohler, Neb el, Homan, & Dimop oulos, 1997). Knoblo c k (1994) has mo died the UCPOP planner with a resource concept whic h mak es it a v oid unordered in teracting actions. This means that the resulting planner pro duces denite parallel plans. Knoblo c k further mo died the ev aluation heuristic of the searc h to tak e parallel execution time in to accoun t. It th us seems as if this planner migh t b e able to pro duce minim um reordered parallel plans, but the pap er do es not pro vide sucien t details to determine whether this is the case. It is also unclear whether the heuristic can handle actions with dieren t duration times. Y et another example is the p olynomial-time planner for the SAS + -IA O planning lan- guage (Jonsson & B ac kstr om, 1998) whic h pro duces plans whic h are minim um-constrained reordered. That is, for this restricted formalism it is clearly p ossible to optimise the ordering in p olynomial time. 9. Discussion The previous section listed a few planning algorithms from the literature that pro duce or attempt to pro duce plans whic h are least constrained or minim um parallel reordered. They do so only under certain restrictions, though. F urthermore, plans are not alw a ys generated `from scratc h', but can also b e generated b y mo difying some already existing plan, referred to as case-based planning, or b y repairing a plan that has failed during the execution phase. In suc h cases, the old plan ma y con tain man y ordering relations that will b e obsolete in the mo died/repaired plan. In fact, the KK algorithm (Kam bhampati & Kedar, 1994) is motiv ated in the con text of case-based planning. It is also imp ortan t to remem b er that to da y , and probably for a long time in to the future, v ery few plans are generated en tirely b y computer programs. The v ast ma jorit y of plans in v arious applications are designed b y h umans, p ossibly with computer supp ort. Already for quite small plans, it is v ery dicult for a h uman to see whether the ordering constrain ts are optimal or not, so computer supp ort for suc h analyses is vital for designing optimal plans. F or the same reason, also hierarc hical- task-net w ork planners, e g O-Plan (Currie & T ate, 1991) and Sipe (Wilkins, 1988), pro duce plans where reordering actions could lead to b etter sc hedules. Suc h a planner often commits to one of the t w o p ossible orderings for a pair of actions based on exp ert-kno wledge rules. Ho w ev er, it is hardly p ossible for a h uman exp ert to design rules that in all situations will guaran tee that the optimal ordering c hoice is made. On the coarseness lev el of complexit y analysis it do es not matter whether the tasks of planning, plan optimization and sc heduling are in tegrated or separated since the total resulting complexit y will b e the same in b oth cases|the latter t w o computations are at most NP-complete and will, th us, b e dominated b y the planning, whic h is PSP A CE-complete or w orse. Ho w ev er, for go o d reasons this has not prev en ted the researc h comm unit y from studying planning and sc heduling as separate problems, since understanding eac h problem in isolation also helps understanding the o v erall pro cess. F or the same reason, it is imp ortan t to also study separately the problems discussed and analysed in this article. F urthermore, on a more ne-grained, practical lev el there migh t b e considerable dierences in eciency b et w een in tegrating the three computations and doing them separately . F or instance, ev en if all three computations tak e exp onen tial time, eac h of the problems considered in isolation 128 Comput a tional Aspects of Reordering Plans ma y ha v e few er parameters, in whic h case it ma y b e m uc h more ecien t to solv e them in isolation. On the other hand, solving the whole problem at once ma y mak e it easier to do global optimisation. Whic h is the b etter will dep end b oth on whic h metho ds are used and on v arious prop erties of the actual application, and it seems unlik ely that one of the metho ds should alw a ys b e the b etter. As has b een sho wn in this article, minim um reordering is a m uc h b etter optimalit y criterion than minim um deordering, if only considering the o v erall parallel execution time. Ho w ev er, this is not necessarily true if also considering further metric constrain ts for subse- quen t sc heduling. Deordering a plan can only add to the n um b er of feasible sc hedules, while reordering ma y also remo v e some or, in the w orst case, all feasible sc hedules. On the other hand, reordering ma y also lead to new and b etter sc hedules not reac hable via deordering. Deordering can th us b e view ed as a safe and, sometimes, c heap w a y to allo w for b etter sc hedules, while reordering is an exp ensiv e metho d whic h has a p oten tial for generating considerably b etter plans, but whic h ma y also mak e things w orse. If using reordering in practice in cases where also metric sc heduling constrain ts are in v olv ed, it seems necessary to use feedbac k from the sc heduler to con trol the reordering pro cess, or to try other re- orderings. One could imagine a reordering algorithm whic h uses either heuristic searc h or randomized lo cal-searc h metho ds a la GSA T (Selman, Lev esque, & Mitc hell, 1992) to nd reorderings and then use the sc heduler as ev aluation function for the prop osed reorderings. While the plan mo dications studied in this article ma y add considerably to the opti- mizations that are p ossible with traditional sc heduling only , there is still a further p oten tial of optimization left to study|mo difying not only the action order, but also the set of ac- tions. Suc h mo dication is already done in plan adaptation, but then only for generating a new plan from old cases, and optimizations in the sense of this article are not considered. Some preliminary studies of action-set mo dications app ear in the literature, though. Fink and Y ang (1992) study the problem of remo ving redundan t actions from total-order plans, dening a sp ectrum of redundancy criteria and analysing the complexit y of ac hieving these. It is less clear that it is in teresting to study action addition; adding actions to a plan could ob viously not impro v e the execution time of it if it is to b e executed sequen tially . Ho w ev er, in the case of parallel execution of plans it has b een sho wn that adding actions to a plan can sometimes allo w for faster execution (B ac kstr om, 1994). Finally , if allo wing b oth remo v al and addition of actions, an ev en greater p oten tial for optimising plans seems a v ailable, but this problems seems not y et studied in the literature. 10. Conclusions This article studies the problem of mo difying the action ordering of a plan in order to optimise the plan according to v arious criteria. One of these criteria is to mak e a plan less constrained and the other is to minimize its parallel execution time. Three candidate denitions are prop osed for the rst of these criteria, constituting a sp ectrum of increasing optimalit y guaran tees. Tw o of these are based on deordering plans, whic h means that or- dering relations ma y only b e remo v ed, not added, while the last one builds on reordering, where arbitrary mo dications to the ordering are allo w ed. The rst of the three candidates, subset-minimal deordering, is tractable to ac hiev e, while the other t w o, deordering or re- 129 B ackstr om ordering a plan to minimize the size of the ordering, are b oth NP-hard and ev en dicult to appro ximate. Similarly , optimising the parallel execution time of a plan is studied b oth for deordering and reordering of plans. In the general case, b oth of these computations are NP-hard and dicult to appro ximate. Ho w ev er, based on an algorithm from the literature it is sho wn that optimal deorderings can b e computed in p olynomial time for denite plans for a class of planning languages based on the notions of pro ducers, consumers and threats, whic h includes most of the commonly used planning languages. Computing optimal reorderings can p oten tially lead to ev en faster parallel executions, but this problem remains NP-hard and dicult to appro ximate ev en under quite sev ere restrictions. F urthermore, deordering a plan is safe with resp ect to subsequen t sc heduling, while reordering a plan ma y remo v e feasible sc hedules, making deordering a go o d, but often sub optimal, approac h in practice. Ac kno wledgemen ts T om Bylander, Thomas Drak engren, Mark Drummond, Alexander Horz, P eter Jonsson, Bernhard Neb el, Erik Sandew all, Sylvie Thib eaux and the anon ymous referees pro vided helpful commen ts on this article and previous v ersions of it. The researc h w as supp orted b y the Sw edish Researc h Council for Engineering Sciences (TFR) under gran ts Dnr. 92-143 and 95-731. App endix A Theorem 7.10 Minimum P arallel Reordering r emains NP-har d even when r estricte d to total-or der GT plans with only to ggling unary actions and under the assumption of unit time, simple c oncurr ency and that no actions ar e r e dundant. Pro of: Pro of b y reduction from 3SA T (Garey & Johnson, 1979, p. 259). Let P = f p 1 ; : : : ; p n g b e a set of atoms and C = f C 1 ; : : : ; C m g a set of clauses o v er P s.t. for 1 i m , C i = f l i; 1 ; l i; 2 ; l i; 3 g is a set of three literals o v er P . First dene the set of atoms Q = f p F i ; p T i ; q i j 1 i n g [ f c i;j ; r i;j j 1 i n; 1 j 3 g : Then dene a GT ppi = h I ; G i with initial and goal states dened as I = Ne g ( Q ) G = f p F i ; p T i ; : q i j 1 i n g [ f c i;j ; : r i;j j 1 i n; 1 j 3 g Also, for eac h atom p i 2 P , dene four actions according to T able 2. F urther, for eac h clause C i 2 C , dene nine actions according to T able 3 where l i;j = ( p F k if l i;j = : p k p T k if l i;j = p k : Let A b e the set of all 4 n + 9 m actions th us dened. Clearly there is some total order s.t. the plan P = h A; i is -v alid. It is also ob vious that none of the actions is redundan t. 130 Comput a tional Aspects of Reordering Plans It is a trivial observ ation that an y parallel execution r of an y -v alid reordering of P m ust satisfy that for eac h i , 1 i n , either r ( A F i ) < r ( A + i ) < r ( A T i ) < r ( A i ) or r ( A + i ) < r ( A T i ) < r ( A i ) < r ( A F i ) ; and for eac h i , 1 i m , r ( C + i;k 1 ) < r ( B + i;k 1 ) < ( r ( C i;k 1 ) r ( C + i;k 2 ) ) < r ( B + i;k 2 ) < ( r ( C i;k 2 ) r ( C + i;k 3 ) ) < r ( B + i;k 3 ) < r ( C i;k 3 ) ; where k 1 ; k 2 ; k 3 is a p erm utation of the n um b ers 1 ; 2 ; 3. (This is to b e in terpreted s.t. the actions C i;k 1 and C + i;k 2 can b e released in either order, or sim ultaneously , and analogously for the actions C i;k 2 and C + i;k 3 ). The remainder of this pro of shall sho w that P can b e reordered to ha v e a parallel execution of length 8 i the set C of clauses is satisable. if: Supp ose C is satisable. Let I b e a truth assignmen t for the atoms in P that satises C . Wlg. assume I ( p i ) = T for all i . F urther, for eac h clause C j , let l j b e an y literal in C j whic h is satised b y I . Disregarding the action order for a momen t, c ho ose a release-time function r for the actions as follo ws. F or 1 i n , let r ( A + i ) = 0 ; r ( A T i ) = 1 ; r ( A i ) = 2 ; r ( A F i ) = 3 : F urther, for eac h j , 1 j m , c ho ose k 1 s.t. l j;k 1 2 C j is satised b y I (at least one suc h c hoice m ust exist b y the assumption). Let l j;k 2 and l j;k 3 b e the remaining t w o literals in C j . Assign release times s.t. for 1 h 3, r ( C + j;k h ) = 2 h 1 ; r ( B + j;k h ) = 2 h ; r ( C j;k h ) = 2 h + 1 : No w dene the partial order 0 on A s.t. for all actions a; b 2 A , a 0 b i r ( a ) < r ( b ). Clearly , the plan h A; 0 i is a -v alid reordering of P and r is a parallel execution of length 8 for h A; 0 i . (Note that no other c hoice of I could force a longer execution, while there is an execution of length 7 in the case where C is satised b y setting all atoms false.) op erator precond. p ostcond. A F i : p F i ; : q i p F i A T i : p T i ; q i p T i A + i : q i q i A i q i : q i T able 2: Generic actions for eac h atom p i in the pro of of Theorem 7.10. 131 B ackstr om op erator precond. p ostcond. B + i; 1 l i; 1 ; r i; 1 ; : r i; 2 ; : r 1 ; 3 ; : c i; 1 c i; 1 B + i; 2 l i; 2 ; : r i; 1 ; r i; 2 ; : r 1 ; 3 ; : c i; 2 c i; 2 B + i; 3 l i; 3 ; : r i; 1 ; : r i; 2 ; r 1 ; 3 ; : c i; 3 c i; 3 C + i; 1 : r i; 1 r i; 1 C i; 1 r i; 1 : r i; 1 C + i; 2 : r i; 2 r i; 2 C i; 2 r i; 2 : r i; 2 C + i; 3 : r i; 3 r i; 3 C i; 3 r i; 3 : r i; 3 T able 3: Generic atoms for eac h clause C i in the pro of of Theorem 7.10. only if: Supp ose C is not satisable. F urther supp ose that Q is a minim um reordering of P and that r is a parallel execution of length 8 or shorter for Q . Wlg. assume that ev ery action is released as early as p ossible b y r . Then, according to the observ ation ab o v e it m ust hold for eac h i , 1 i n , that either r ( A F i ) = 0 ; r ( A + i ) = 1 ; r ( A T i ) = 2 ; r ( A i ) = 3 or r ( A + i ) = 0 ; r ( A T i ) = 1 ; r ( A i ) = 2 ; r ( A F i ) = 3 : Hence, exactly one of the atoms p F i and p T i is true at time 2. Let p i denote this atom. Since r is of length 8, it follo ws from the earlier observ ation that for all j , 1 j m , r ( B + j;k ) 2 for some k , 1 k 3. Hence, l j;k = p i for some i , since Q is -v alid and r is a parallel execution for Q . Dene an in terpretation I s.t. for all i , 1 i n , I ( p i ) = ( F ; if p i = p F i T ; otherwise : Ho w ev er, this in terpretation is ob viously a mo del for C , whic h con tradicts the assumption. It follo ws that r m ust b e of length 9 or longer. This concludes the pro of and sho ws that C is satisable i P has a reordering with a parallel execution of length 8 or not. 2 Theorem 7.11 Minimum P arallel Deordering c annot appr oximate Minimum P arallel Reordering within j A j k for any c onstant k 0 . Pro of: The pro of assumes GT plans and simple concurrency . First, dene the generic actions a k i ( m ), b k i and c k i ( m ) according to T able 10. F urther, dene recursiv ely the generic plans P k i ( m ) = ( h a 1 ( i 1) m +1 (1) ; b 0 ( i 1) m +1 ; c 1 ( i 1) m +1 (1) ; : : : ; a 1 im (1) ; b 0 im ; c 1 im (1) i ; for k = 1 h a k ( i 1) m +1 ( m ); P k 1 ( i 1) m +1 ( m ); c k 1 ( m ) ; : : : ; a k im ( m ); P k 1 im ( m ); c k im ( m ) i ; for k > 1 : 132 Comput a tional Aspects of Reordering Plans F urthermore, for arbitrary k ; n > 0 dene the ppi k n = hf p k 1 ; : : : ; p k n g ; f q k 1 ; : : : ; q k n gi . No w, pro v e the claim that for arbitrary k ; n > 0, the plan P k 1 ( n ) 1. is k n -v alid, 2. has no deordering of length less than 3 n k + P k 1 i =1 2 n i and 3. has a reordering of length 2 k + 1. Pro of b y induction o v er k . Base c ase (k=1): Cho ose an arbitrary n > 0. The plan P 1 1 ( n ) is ob viously k n -v alid and has no deordering other than itself, whic h is of length 3 n . Consider the reordering Q 1 1 ( n ) of P 1 1 ( n ) with the same actions and with ordering relation dened s.t. for all i , 1 i n , a 1 i (1) b 0 i c 1 i (1) and for all i , 1 < i n , a 1 i (1) b 0 i 1 . This reordering is k ( n )-v alid and has a parallel execution r 1 1 ( n ) of length 3, dened s.t. for all i , 1 i n , r 1 1 ( n )( a 1 i (1)) = 1, r 1 1 ( n )( b 0 i ) = 2 and r 1 1 ( n )( c 1 i (1)) = 3. (This plan is sho wn in Figure 15.) The claim is th us satised for the base case. Induction: Supp ose the claim is satised for all l < k , for some k 1 and pro v e that the claim holds also for l = k . Cho ose an arbitrary n > 0. It follo ws from the induction h yp othesis that none of the subplans P k 1 1 ( n ) : : : ; P k 1 n ( n ) can b e deordered, so they ha v e to remain totally ordered. F urthermore, for all i , 1 i n , it is necessary that the action a k i ( n ) is ordered b efore the subplan P k 1 i ( n ) and that the action c k i ( n ) is ordered after it. It is also clear that for no i , 1 i n can the order c k i ( n ) a k i +1 ( n ) b e remo v ed without making the plan in v alid. Hence, P k 1 ( n ) has no other deordering than itself, whic h is of length n X i =1 (2 + length ( P k 1 i ( n )) = n (2 + length ( P k 1 1 ( n ))) = 2 n + n (3 n k 1 + k 2 X i =1 2 n i ) = 3 n k + k 1 X i =1 2 n i ; whic h pro v es the deordering case of the claim. F or the reordering case, dene a reordering Q k 1 ( n ) of P k 1 ( n ) with the same actions and with ordering relation dened as follo ws. F or eac h subplan P k 1 i ( n ) of P k 1 ( n ), reorder its actions so it has length 2( k 1) + 1, whic h is p ossible according to the induction h yp othesis. F urther, for eac h i , 1 i n , and eac h j , ( i 1) n + 1 j in order a k i ( n ) a k 1 j ( n ) and c k 1 j ( n ) c k i ( n ) (or a k i +1 ( n ) a k 1 j (1) and c k 1 j (1) c k i ( n ) for the case k = 2). Hence, eac h action pre-condition p ost-condition a k i ( m ) f p k i g f p k 1 ( i 1) m +1 ; : : : ; p k 1 im ; : q k 1 ( i 1) m g b k i f p k i g f q k i g c k i ( m ) f q k 1 ( i 1) m +1 ; : : : ; q k 1 im g p ost ( c k i ( m )) = f q k i g : T able 4: Generic actions for the pro of of Theorem 7.11. 133 B ackstr om . X X X X X z : X X X X X z : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a 2 2 ( n ) c 2 2 ( n ) P 1 2 ( n ) : X X X X X z X X X X X z : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a 2 n ( n ) c 2 n ( n ) P 1 n ( n ) - - - - - - : @ @ @ @ @ @ R @ @ @ @ @ @ R X X X X X X z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . b 0 n b 0 2 b 0 1 a 1 1 (1) a 1 2 (1) a 1 n (1) c 1 1 (1) c 1 2 (1) c 1 n (1) a 2 1 ( n ) c 2 1 ( n ) p 0 1 q 0 1 q 0 2 p 0 2 p 0 n q 0 n q 1 1 q 1 n q 1 2 : q 0 ( n 1) : q 0 1 p 1 1 p 1 2 p 1 n P 1 1 ( n ) : q 0 2 : q 1 n : q 1 ( n 1) Figure 15: The reordering Q 2 1 ( n ) of the plan P 2 1 ( n ) as an example of the induction case in the pro of of Theorem 7.11 (solid arro ws denote orderings required b y pro ducer- consumer relationships and are lab elled with the atom pro duced/consumed, while dashed arro ws denote ordering constrain ts to a v oid threats and are la- b elled with the p ossibly conicting atom). segmen t of the t yp e a k i ( n ); P k 1 i ( n ); c k i ( n ) is reordered to ha v e length 2 k + 1. Finally , for eac h i , 1 i n , order a k i ( n ) a k 1 ( i 1) n ( n ) (or a k i ( n ) a k 1 ( i 1) n (1) for the case k = 2). The plan Q k 1 ( n ) is k ( n )-v alid since the subplans P k 1 1 ( n ) ; : : : ; P k 1 n ( n ) do not ha v e an y atoms in common and, th us, the # relation do es not hold b et w een an y t w o actions b elonging to dieren t suc h subplans. This reordered plan can b e executed under the parallel execution r k i ( n ) dened s.t. r k i ( n )( a k i ( n )) = 1, r k i ( n )( c k i ( n )) = 2 k + 1 and for all i , 1 i n and all actions a 0 2 Q k 1 i ( n ), r k i ( n )( a 0 ) = r k 1 i ( n )( a 0 ) + 1. Since this is a parallel execution of length 2 k + 1 for the reordered plan, the claim holds also for k . This concludes the induction, so the claim holds for all k > 0. Since 3 n k + P k 1 i =1 2 n i 2 k + 1 1 (2 k + 1)3 k 1 j A j k for all k > 0, the theorem holds. 2 134 Comput a tional Aspects of Reordering Plans References B ac kstr om, C. (1993). Finding least constrained plans and optimal parallel executions is harder than w e though t. In B ac kstr om, C., & Sandew all, E. (Eds.), Curr ent T r ends in AI Planning: EWSP'93|2nd Eur op e an Workshop on Planning , pp. 46{59 V adstena, Sw eden. IOS Press. B ac kstr om, C. (1994). Executing parallel plans faster b y adding actions. In Cohn, A. G. (Ed.), Pr o c e e dings of the 11th Eur op e an Confer enc e on A rticial Intel ligenc e (ECAI'94) , pp. 615{619 Amsterdam, Netherlands. Wiley . B ac kstr om, C. (1995). Expressiv e equiv alence of planning formalisms. A rticial Intel ligenc e , 76 (1{2), 17{34. B ac kstr om, C., & Klein, I. (1991). P arallel non-binary planning in p olynomial time. In Reiter, R., & Mylop oulos, J. (Eds.), Pr o c e e dings of the 12th International Joint Con- fer enc e on A rticial Intel ligenc e (IJCAI'91) , pp. 268{273 Sydney , Australia. Morgan Kaufmann. Bellare, M., Goldreic h, O., & Sudan, M. (1995). F ree bits, PCPs and non-appro ximabilit y| to w ards tigh ter results. In Pr o c e e dings of the 36th A nnual IEEE Symp osium on the F oundations of Computer Scienc e (F OCS'95) , pp. 422{431 Milw auk ee, WI, USA. IEEE Computer So ciet y . Blum, A. L., & F urst, M. L. (1997). F ast planning through planning graph analysis. A rticial Intel ligenc e , 90 (1{2), 281{300. Chapman, D. (1987). Planning for conjunctiv e goals. A rticial Intel ligenc e , 32 (3), 333{377. Crescenzi, P ., & P anconesi, A. (1991). Completeness in appro ximation classes. Information and Computation , 93 (2), 241{262. Currie, K., & T ate, A. (1991). O-Plan: The op en planning arc hitecture. A rticial Intel li- genc e , 52 (1), 49{86. F eige, U., & Kilian, J. (1996). Zero kno wledge and the c hromatic n um b er. In 11th A nnual IEEE Confer enc e on Computational Comp elxity (CCC'96) Philadelphia, P A, USA. IEEE Computer So ciet y . F eige, U. (1996). A threshold of ln n for appro ximating set co v er (preliminary v ersion). In Pr o c e e dings of 28th A nnual A CM Symp osium on The ory of Computing (STOC'96) , pp. 314{318 Philadelphia, P A, USA. A CM. Fink, E., & Y ang, Q. (1992). F ormalizing plan justications. In Pr o c e e dings of the 9th Con- fer enc e of the Canadian So ciety for Computational Studies of Intel ligenc e (CSCSI'92) , pp. 9{14 V ancouv er, BC, Canada. Garey , M., & Johnson, D. (1979). Computers and Intr actability: A Guide to the The ory of NP-Completeness . F reeman, New Y ork. 135 B ackstr om Gazen, C., & Knoblo c k, C. (1997). Com bining the expressivit y of UCPOP with the eciency of Graphplan. In Steel, & Alami (1997), pp. 221{233. Ghallab, M., & Laruelle, H. (1994). Represen tation and con trol in IxT eT, a temp oral planner. In Hammond (1994), pp. 61{67. Hammond, K. (Ed.). (1994). Pr o c e e dings of the 2nd International Confer enc e on A rticial Intel ligenc e Planning Systems (AIPS'94) , Chicago, IL, USA. AAAI Press. Jonsson, P ., & B ac kstr om, C. (1998). State-v ariable planning under structural restrictions: Algorithms and complexit y . A rticial Intel ligenc e , 100 (1{2), 125{176. Kam bhampati, S. (1994). Multi-con tributor causal structures for planning: A formalization and ev aluation. A rticial Intel ligenc e , 69 (1{2), 235{278. Kam bhampati, S., & Kedar, S. (1994). A unied framew ork for explanation-based gener- alization of partially ordered and partially instan tiated plans. A rticial Intel ligenc e , 67 (1), 29{70. Klein, I., Jonsson, P ., & B ac kstr om, C. (1995). T ractable planning for an assem bly line. In Ghallab, M., & Milani, A. (Eds.), New Dir e ctions in AI Planning: EWSP'95| 3r d Eur op e an Workshop on Planning , F ron tiers in AI and Applications, pp. 313{324 Assisi, Italy . IOS Press. Klein, I., Jonsson, P ., & B ac kstr om, C. (1998). Ecien t planning for a miniature assem bly line. A rticial Intel ligenc e in Engine ering , 13 (1), 69{81. Knoblo c k, C. (1994). Generating parallel execution plans with a partial-order planner. In Hammond (1994). K ohler, J., Neb el, B., Homan, J., & Dimop oulos, Y. (1997). Extending planning graphs to an ADL subset. In Steel, & Alami (1997), pp. 273{285. Lund, C., & Y annak akis, M. (1994). On the hardness of appro ximating minimization prob- lems. Journal of the A CM , 41 (5), 960{981. Neb el, B., & B ac kstr om, C. (1994). On the computational complexit y of temp oral pro jec- tion, planning and plan v alidation. A rticial Intel ligenc e , 66 (1), 125{160. P ednault, E. P . D. (1986). F orm ulating m ultiagen t, dynamic-w orld problems in the classical planning framew ork. In George, M., & Lansky , A. L. (Eds.), R e asoning ab out A c- tions and Plans, Pr o c e e dings of the 1986 Workshop , pp. 47{82 Tim b erline, OR, USA. Morgan Kaufmann. Regnier, P ., & F ade, B. (1991a). Complete determination of parallel actions and temp oral optimization in linear plans of action. In Hertzb erg, J. (Ed.), Eur op e an Workshop on Planning , V ol. 522 of L e ctur e Notes in A rticial Intel ligenc e , pp. 100{111 Sankt Augustin, German y . Springer. 136 Comput a tional Aspects of Reordering Plans Regnier, P ., & F ade, B. (1991b). D etermination du parall elisme maximal et optimisation temp orelle dans les plans d'actions lin eaires. R evue d'intel ligenc e articiel le , 5 (2), 67{88. Selman, B., Lev esque, H., & Mitc hell, D. (1992). A new metho d for solving hard satis- abilit y problems. In Pr o c e e dings of the 10th (US) National Confer enc e on A rticial Intel ligenc e (AAAI'92) , pp. 440{446 San Jos e, CA, USA. American Asso ciation for Articial In telligence. Steel, S., & Alami, R. (Eds.). (1997). 4th Eur op e an Confer enc e on Planning, ECP'97 , V ol. 1348 of L e ctur e Notes in A rticial Intel ligenc e , T oulouse, F rance. Springer. Str om b erg, J.-E. (1991). St yrning a v LEGO-bilfabrik. Andra omarb etade upplagan. De- partmen t of Electrical Engineering, Link oping Univ ersit y . T ate, A. (1975). In teracting goals and their use. In Pr o c e e dings of the 4th International Joint Confer enc e on A rticial Intel ligenc e (IJCAI'75) , pp. 215{218 Tbilisi, USSR. IJCAI, William Kaufmann. V eloso, M. M., P erez, M. A., & Carb onell, J. G. (1990). Nonlinear planning with parallel resource allo cation. In Sycara, K. P . (Ed.), Workshop on Innovative Appr o aches to Planning, Sche duling and Contr ol , pp. 207{212 San Diego, CA, USA. Morgan Kaufmann. V ere, S. A. (1983). Planning in time: Windo ws and durations for activities and goals. IEEE T r ansactions on Pattern A nalysis and Machine Intel ligenc e , P AMI-5 (3), 246{267. Wilkins, D. E. (1988). Pr actic al Planning . Morgan Kaufmann, San Mateo, CA. 137
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment