0% found this document useful (0 votes)
65 views8 pages

A Star

A Formal Basis for the Heuristic Determination of Minimal Cost Paths, by Peter E. Hart, Nils J. Nilsson, and Bertram Raphael

Uploaded by

Aline
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
65 views8 pages

A Star

A Formal Basis for the Heuristic Determination of Minimal Cost Paths, by Peter E. Hart, Nils J. Nilsson, and Bertram Raphael

Uploaded by

Aline
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 8
100 1 J, E, Fal, “Lagrange mutplier and nonlinear programming,” J. Math. Anal. Aapply vol 19, Say 1987, (610. ie" Mangaessian and J. Ponsteiny “Minimax and duality in pouliaear progeamming,” J Maik. inal, Appl, vol. Il, pp. at Bis, 1905, Fide Siver, “Duality in nonlinear programming and the minimax theorem" Numeritche Mathematik, wa. Dp. 371-379, 1963 BSR Rockafellar, “Dnay’ and staity in extrem probe len tuvaliing conven factions” Pore J Math, vol 2h Bp 007. oat! Wolfe, pi. Math vole 19, elf 1, Teockafellar," Nonlineat programming,” presented wt the American Mathematical Society: Stmnmer Seminar on the Math- ematice of the Decision Sciences, Stanford University, Stanford, Calif, July-Angiet 1967, Thi’. C, Luenberger, “Convex. programming and duslity in normal space,” Proc, IEEE Systema Science and Cybernetics Con. (Boston, Ales, October 11-13, 1967) FSIS" Me Danskin, “The theory of max-min with applications,” J. SIAL, vol. 14, pp, 641-865, July 1966. G81 W.’ Fenchel, “Convex cones, sets, and funetions,"” mimeo- graphed ‘notes, Princeion University, Princeton, N. J, September 1988, 411 Fleteher and M. J. D, Powell, “A rapidly. convergent escent method for minimization,” Compuer J., vol. 6, p. 183, duly 11063, TIL. 8. for optimal design, vB, Rosen progratnming, pt. T, linear constraints, 17, 1900. A. duality, theorem for nonlinear programming, 19-245, 1961 usdon and A. D, Waren, “Mathematical programming ‘Blectro-Technol, pp. i-T1, Novernber 1967. Phe gradient projection method for nonlinear JSAM, vol. DD IS1 (CB AND CYBERNETICS, Vo. 860-4, NO. 2, UL 168, 1 R, Fletcher and C. M, Reeves, “Function minimization by conjugaie gradients," Compuler J vol. 7, July 1968 Eatery “A, eonjuaté mac method for wolioear programming, jmzrtation, Dept of Chem. Kingre, Prince= KonUiniverity, Princeton, Ned, 1066. "e tal LS. Lasdon,. "A multilevel technique for optimization,” Ph.D. ‘disertation,’ Systems esearch Center, Case Instivite of ‘echnology, Cleveland, Ohio, Rep, SRC 50-C-64-19, 1904 ‘I. S Lagdon and J. D. Schoeiier, “A nnltidevel technique for optimization,” Preprints, Joint Astomatie Control Cont, Troy, NEY done 32-28, 1905, po. R92 rehRecettaize plant control” ISA Trans, vol. 5 175-185, Apa 1066. PED ion and Le 8. Lasdon, “A two level optimization technique for reevele process," 1908 Proc. AICHE Symp. on Application of ‘Mathematical Models in Chemical Engineering Kee ‘enteh, Design, and Production (London, nglond). Tite baadon, “Dray and decompo in mathamaieal programming,” Systoms Research Center, Case Institute of Tech nology; Cleveland, Ohio, Rept, SRC 119.C-67-52, 1967, mA. V. Faced and GB, McCormick, Sequential Unconsteained Minimization ‘Tesonques for Nonlinear Programing. Now Tork: ‘Wiley, 0s Th. Fox and L. Schmit, “Advances in the integrated approach to stryiaal sph" J Spacecraft and Rockey val Sh Sh, ine 1966, 160 B.D, Daiolinski and R. E. Gomory, “Optimal programming of lor si, faventry, and tao aloat,” Management Se, ¥0l Th pps 1985, eli relaxed interior approach to noni ‘gaming? Rwtnrch Analysis Cor. Maan, Va."RACY cr. A Formal Basis for the Heuristic Determination of Minimum Cost Paths PETER E, HART, wewner, teen, NILS J. NILSSON, seamen, mee, ano BERTRAM RAPHAEL Abstract—Although the problem of determining the minimum cost path through a graph arises naturally in a number of interesting applications, there has been no underlying theory to guide the development of eficient search procedures. Moreover, there is no ‘adequate conceptual framework within which the various ad hoe search strategies proposed (o date can be compared. This paper describes how heuristic information from the problem domain can be incorporated into a formal mathematical theory of graph searching and demonstrates an optimality property of a class of search strate- fies. 1. Iyruopveriox A. The Problem of Finding Paths Through Graphs ANY PROBLEMS of engineering and _ scientific importance ean be telated to the general problem of finding a path through a graph. Examples of such prob lems inclide routing of telephone traffic, navigation through a maze, layout of printed circuit boards, and Manuscript reeeived November 24, 1967. ‘The authors are. with the Artificial Tnielligence Geoup of the Applied Physios Laboratory, Stanford Research Instituce, Menlo Park, Calif mechanical theorem-proving and problem-solving, ‘These problems have usually been approached in one of two ways, which we shall call the mathematical approach and the heuristic approach. 1) The mathematical approach typically deals with the properties of abstract graphs and with algorithms that preseribe an orderly examination of nodes of a graph to establish a minimum cost path. For example, Pollock and Wiebenson'”| review several algorithms which are guaran- teed to find such a path for any graph. Busacker and Santy'® also discuss several algorithms, one of which uses the concept of dynamic programming.'®! The mathematical approach is generally more concerned with the ultimate ‘achievement of solutions than it is with the computational feasibility of the algorithms developed, 2) The heuristie approach typically uses special knowl- edge about the domain of the problem being represented by ‘a graph to improve the computational efficieney of solu- tions to particular graph-searching problems. For example, Gelemter’s'® program used Euclidean diagrams to direct. the search for geometric proofs. Samuel! and others have used ad hoe characteristics of particular games to reduce TARY ef a: DETERMINATION OF MINIMUM COST PaTUIS the “look-ahead” effort in searching game trees, Procedures developed via the heuristie approach generally have not been able to guarantee that minimum cost solution paths will always be found. ‘This paper draws together the above two approaches by describing how information from a problem domain ean be incorporated ina formal mathematical approach to a graph analysis problem. It also presents a general algo- rithm which prescribes how to use such information to find ‘8 minimum cost path through a graph. Finally, it proves, ‘under mild assumptions, that this algorithm is optimal in the sense that it examines the smallest number of nodes necessary to guarantee a minimum cost solution. ‘The following is a typical illustration of the sort of problem to which our results are applieable. Imagine a set of cities with ronds conneeting certain pairs of them. Suppose we desire technique for diseovering a sequence of eities on the shortest route from a specified start to a ied goal city. Our algorithm preseribes how to use special knowledge—e, the knowledge that the shortest road route between any’ pair of cities eannot be less than the airline distance between them—in order to reduee the total number of cities that need to be considered. First, we must make some pretiminary statements and definitions about graphs and search algorithms. B, Some Definitions About Graphs A graph G is defined to be a set {nf of elements called nodes and a set {eq} of directed line segments called ares. If gis an clement of the set fe,}, then we say that there is an are from node nto node n, and that ne is a successor ‘of ny. We shall be concerned here with graphs whose ares have costs associated with them. We shall represent the ‘cost of are ey by ¢y- (An are from n, ton, does not imply the existence of an are from n, to m,. If both ares exist, in general ¢ ¢.) We shall consider only those graphs @ for which there exists 8 > 0 such that the cost of every are of G is greater than or equal to 8. Such graphs shall be called 8 graphs. In many problems of interest the graph is not specified explicitly as a set of nodes and ares, but rather is specified implicitly by means of a set of source nodes SC|n4} and a ‘successor operator T, defined on {n,}, whose value for each ‘ny is a set of pairs | (n,, ¢.)]- In other words, applying I’ to node n; yields all the successors n, of my and the costs cy associated with the ares from n, to the various n,. Applica- tion of 1 to the source nodes, to their successors, and so forth as long as new nodes ean be generated results in an explicit specification of the graph thus defined. We shall assume throughout this paper that a graph Gis always sziven in implieit form. The subgraph G, from any node n in {nq} is the graph. defined implicitly by the single souree node n and some I defined on {nq. We shall say that each node in Gy is accessible from n. ‘A path from ny to nis an ordered set of nodes (n,m 17) with each nts w successor of, There exists path from n, to n, if and only if n, is accessible from nq Every wo path has a cost which is obtained by adding the individual costs of each are, ¢..:25 in the path, An eplimal path from 1, to nis @ path having the smallest cost-over the set of all paths from n,ton,, Weshall represent this cost by A(%.,)- ‘This paper will be concerned with the subgraph G, from some single specificd start node s, We define a nonempty set T of nodes in G, as the goal nodes." For any node 1 in G,, an clement CT isa preferred goal node of n if und only if the eost of an optimal path from n to f does not exceed the cost of any other path from n to any member of 7. For simplicity, we shall represent the unique cost of an optimal path from m to a preferred goal node of n by the symbol h(n) ie) = min 0. C. Algorithms for Finding Minimum Cost Paths We are interested in algorithms that search @ to find san optimal path from s to n preferred goal node of s. What we mean by searching a graph and finding an optimal path is made clear by deseribing in general how such algorithms proceed. Starting with the node s, they generate some part of the subgraph G, by repetitive applieation of the suc~ ‘eessor operator 1". During the course of the algorithm, if is applied to a node, we say that the algorithm has expanded that node. We can keep track of the minimum eost path from s to each node encountered as follows. Each time a node is expanded, we store with each successor node n both the cost of getting to n by the lowest cost path found thus far, and a pointer to the predecessor of » along that path. Eventually the algorithm terminates ut some goal node f, and no more nodes are expanded. We ean then reconstruct minimum cost path from # to £ known at the time of termination simply by chaining back from ¢ to s through ‘the pointers. We call an algorithm admissible if it is guaranteed to find an optimal path from s to a preferred goal node of & for any 6 graph. Various admissible algorithms may differ oth in the order in which they expand the nodes of G, and in the number of nodes expanded. In the next section, we shall propose a way of ordering node expansion and show that the resulting algorithm is admissible. ‘Then, in « fole lowing seetion, we shall show, under & mild assumption, that this algorithm uses information from the problem represented by the graph in an optimal way. That is, it expands the smallest number of nodes necessary to guat- antee finding an optimal path. IL. Ax Anwisstnne SeancHING ALGoRITHDt A Description of the Algorithm Inorder to expand the fewest possible nodes iti searching for an optimal path, a search algorithm must eoustantly make as informed a decision as possible about which node to expand next, I7 it expands nodes which obviously cannot be on an optimal puth, it is wasting effort, On the other hand, if it continues to ignore nodes that might be on an | We exclude the trivial ease of» «7. me optimal path, it will sometimes fail to find such a path and thus not be admissible, An efficient algorithm obviously needs some way to evaluate available nodes to determine which one should be expanded next. Suppose some evalu ation function f(n) could be caleulated for any node n. ‘We shall suggest a specifie funetion below, but first we shall describe how a search algorithm would use such a funetion. Let our evaluation funetion fin) be defined in such way that the available node having the smallest value of 7 is the node that should be expanded next. Then we ean define a search algorithm as follows. ‘Search Algorithn A*: 1) Mark ¢ “open” and calculate f(s). 2) Select the open node n whose value of f is smallest. Resolve ties arbitrarily, but alway's in favor of any node neT. 3) IfmeT, markn “closed” and terminate the algorithm. 4) Otherwise, mark m closed and apply the successor operator P to n. Calculate f for each successor of nm and mark a3 open each successor not already marked closed. Remark as open any closed node , which is a successor of n and for which f(n,) is smaller now than it was when 7, ‘was marked closed. Go to Step 2. We shall next show that for a suitable choice of the evaluation funtion f, the algorithm A* is guaranteed to find an optimal path to a preferred goal node of s and thus is admissible. B. The Evaluation Punction For any subgraph @, and any goal set 7, let f(n) be the actual cost of an optimal path constrained fo go through n, from s to a preferred goal node of n. Note that f(s) = h(s) is the eost of an unconstrained optimal path from s to a preferred goal node of s. In fact, fin) = fis) for every node n on an optimal path, and Hin) > fis) for every node n not on an optimal path. Thus, although /(1) is not known a priori (in faet, determination, of the true value of /(n) may be the main problem of inter- cst), it soems reasonable to use an estimate of fn) as the evaluation function f(n). In the remainder of this paper, ‘we shall exhibit some properties of the seareh algorithm A* when the cost j(n) of an optimal path through node m is ‘estimated by an appropriate evaluation function fn). We ean write fin) as the sum of two parts: Hn) = gin) + h(n) a where (x) is the actual cost of an optimal path from s ton, and h(n) is the actual cost of an optimal path from n toa preferred goal node of n Now, if we had estimates of g and h, we could add them to form an estimate of /. Let g(n) be an estimate of o(n) ‘An obvious choice for g(n) is the cost of the path from sto ‘n having the smallest eost so far found by the algorithm, Notice that this implies (n) > g(n). ‘A simple example will illustrate that this estimate is ‘easy to calculate as the algorithm proceeds. Consider the ree TRANSACTIONS ON SYBIFIMS SCIENCE AND CYBERNETICS, 301 1968 subgraph shown in Fig. 1. It consists of a start node ¢ and three other nodes, m1, ne, and ma. The ares are shown with arrowheads and eosts, Let us trace how algorithm A* pro- ceeded in generating this subgraph. Starting with s, we ‘obtain successors ry and ns. The estimates g(m) and g(r) are then 3 and 7, respectively. Suppose A* expands my next swith successors ne and ns. At this stage g(na) = 3 +2 = 5, and 9(n.) is lowered (because a less costly path to it has been found) to 3 + 3 = 6. The value of a(m) remains equal to 3. ‘Next we must have an estimate h(n) of h(n). Here we rely on information from the problem domain. Many problems that can be represented as a problem of finding a minimum cost path through a graph contain some “physi- cal” information that ean be used to form the estimate h, In our example of cities connected by roads, h(n) might be the airline distanee between eity n and the goal city. This distance is the shortest possible length of any road con- necting city n with the goal city; thus it is a lower bound on (n). We shall have more to say later about using informa tion from the problem domain to form an estimate A, but first we can prove that iff is any lower bound of h, then the algorithm A* is admissible. C. The Admissibility of A* ‘We shall take as our evaluation funetion to be used in A* Sen) = an) + hin) @) where §(n) is the cost of the path from s to n with minimum cost s0 fur found by A*, and A(n) is any estimate of the cost of an optimal path from n to a preferred goal node of, nn, We first prove a lemma. Lemma t For any nonclosed node n and for any optimal path P from s to n, there exists an open node n’ on P with g(n’) = a(n’). Proof: Let P= (8 = nom May -*+,% =m). Th sis open (that is, A* has not completed even one iteration), let in! = s, and the lemma is trivially true since 9(s) = g(8) = (0, Suppose s is closed. Let A be the set of all closed nodes n, in P for which 9(n,) = g(n). A is not empty, since by assumption ¢ ¢ A. Let n* be the element of 4 with, highest index. Clearly, n* % n, as n is nonclosed. Let n" tbe the suecessor of n* on P. (Possibly n’ =n.) Now Gln’) < Gln") + case: by definition of G ln") = gln*) because n* is in A, and gin’) = g(n*) + Cye.« because P is an optimal path. Therefore, g(n') < g(n’). But in MARE ef al: DireaacTto® OF MINIMUM Cost PATHS general, G(n') > g(n’), since the lowest cost y(n’) from s ton! discovered at any time is certainly not lower than the optimal cost g(x’). Thus g(a’) = g(n’), and moreover: ‘n’ must be open by the definition of A. Corollary Suppose h(n) < h(n) for all n, and suppose A* has not terminated. Then, for any optimal path P from s to any preferred goal node of s, there exists an open node n’ on P Io) < f9) Proof: By the lemma, there exists an open node n’ on P with 9(n') = g(n’), 80 by definition of f = Hin’) + An’) an’) + hn’) g(n) > y(n) > Mb ‘J{e). Clearly, no node » further than M steps from 8 is ever expanded, for by the corollary to Lemma 1, there will be some open node n’ on an optimal path such that f(r’) < Sis) < f(n), so, by Step 2, A* will select n’ instead of n. Failure of A* to terminate could then only be caused by continued reopening of nodes within Mf steps of s. Let x(M) be the set of nodes accessible within M steps from s, and let »(M) be the number of nodes in x(IM). Now, any node n in x(IM) ean be reopened at most a finite number of times, say a(n, M), sinee there are only a finite number of paths from s to n passing only through nodes within MW steps of». Let (M) = max a(n, M), naximum number of times any one node ean be opened. Hence, after at most »(M)p(M) expansions, all 103 nodes in x(/) must be forever closed, Since no nodes out side x(M) can be expanded, A* must terminate. Case 3 Termination is at a youl node without achieving mini mum cost. Suppose A* terminates at some goal node ¢ with f= G() > f(6). But by the corollary to Lemma 1, there existed just before termination an open node 1” on an optimal path with f(w’) < fla) < f, Thus at this stage, n’ would have ted for expansion rather than ¢, contradicting the assumption that A* terminated. The proof of Theorem 1 is now complete. In the next section, we shall show that for a certain choice of the function f(m), A* is not only admissible hut optimal, in tho sense that no other admissible algorithm expands fewer nodes. TIL, Oy tHe Orritanrry ov At A. Limitation of Subgeaphs by Information from the Problem In the preceding section, we proved that if fi(n) is any lower bound on A(n), then A* is admissible. One such Tower bound is (nm) = O for all, Such an estimate amounts to assuming that any open node n might be arbitrarily close to a preferred goul node of n. Then the sct {G.} is unconstrained; anything is possible at node n, and, in particular, if 7 is a minimum at node n, then node n must be expanded by every admissible algorithm. Often, however, we have information from the problem that constrains the set {G,} of possible subgraphs at each node, In our example with cities connected by roads, no subgraph Gy is possible for which h(n) is less than the airline distance between city n and a preferred goal city of 1n. Tn general, if the set of possible subgraphs is eon- strained, one ean find 1 higher lower bound of h(n) than one ean for the unconstrained situation. If this higher lower ound is used for h(n), then A* is still admissible, but, as will become obvious later, A* will generally expand fewer nodes. We shall assume in this section that at each node n, certain information is available from the physical situation on which we can base « computation to limit the set {G,} of possible subgraphs. Suppose we denote the set of all subgraphs from node m by the symbol {G,,,} where « indexes each subgraph, and a is in some index set ,. Now, we presume that certain information is available from the problem domain about the state that node » represents; this information limits the set of subgraphs from node n to the set {G,4}, wl is in some smaller index set OC Q, For each Gye in {Gyo} there corresponds cost. h(n) of the optimum path from 1 to a preferred goal node of n. We shall now take ax our estimate (n), the greatest ower bound for hel). ‘That is, A(n) = inf hg(n). @) We assume the infimum is achieved for some ¢6,. In actual problems one probably never has an explicit representation for {@qg}, but instead one selects a pro- 104 cedure for computing &(n), known from information about. the problem domain, to be a lower bound on h(n). This selection itself induces the set {Gus} by (3). Never theless, it is convenient to proceed with our formal dis. cussion as if {Gy9} were available and as if A(n) were explicitly calculated from (3). Por the rest of this paper, we assume that the algorithm A* uses (3) as the definition of h. B. A Consistency Assumption When a real problem is modeled by a graph, each node of the graph corresponds to some state in the problem omain, Our general knowledge about the structure of the problem domain, together with the specific state repre- sented by a node n, determines how the set 2 is reduced to the set 0,. However, we shall make one assumption about the uniformity of the manner in which knowledge of the problem domain is used to impose this reduetion. ‘This assumption may be stated formally as follows. For any nodes m and n, h(onyn) + ink h(n) > ink Ayla). Wy Hom a Using the definition of & given in (3), we ean restate (4) as a kind of triangle inequality: ‘dm, n) + h(n) > hlon). o ‘The assumption expressed by (4) [and therefore (5)] amounts to a type of consistency assumption on the esti- ite h(n) over the nodes. Tt means that any estimate (n) caleulated from data available in the “physical” situation represented by node » alone would not be improved by using corresponding data from the situations represented by the other nodes. Let us see what this assumption means in the ease of our example of cities and roads. Suppose we decide, in this example, to use as an estimate h(n), the air- line distance from city n to its closest goal city. As we have stated previously, such an estimate is certainly a lower bound on h(n). It induces at each node n a set {Gao} of possible subgraphs from n by (3). If we let d(m, n) be the airline distance between the two cities correspone nnodes and m, we have h(n, n) 2 d(m, n) and, therefore, by the triangle inequality for Euclidean distance Han, n) + hn) > alm, n) + h(n) > hm), hich shows that this A satisfies the assumption of (5). ider for a moment the following h for the ties problem. Suppose the nodes of the graph are numbered sequentially in the order im which they are discovered. Let h for cities represented by nodes with odd- numbered indexes be the airline distance to a preferred goal city of these nodes, and let = 1 for nodes with even- humbered indexes. For the graph of Fig. 2, f(s) = hm) = 8, Nodes nz and 7g are the suecessors of m along ures with costs as indicated. By the above rule for computing f, f(g) = 1 while h(na) = 5. Then f(r) = 6 + 1 = 7, while ‘f(ns) = 3 + 5 = §, and algorithm A* would erroneously {IEEE TRANSACTIONS ON SYSTEMS SeIBNCH AND CYDERNERICS, 20 1068 choose to expand node nis next. This error occurs because the estimates f(s) = 8 and (rm) = 1 are inconsistent in view of the fact that 1 is only six units away from s. The information that there eannot exist a path from «to a goal with total cost less than eight was somchow available for the computation of f(s), and then ignored during the com- putation of h(n). ‘The result is that (5) was violated, ie., N(@, me) + Alm) = 6 +1<8 = Ale). For the rest of this paper, we shall assume that the family {@,} of index sets satisfies (4) or, equivalently, the procedures for computing the estimates h always lead to values that satisfy (5). We shall call this assumption the consistency assumption, Note that the estimate h(n) = 0 for all n trivially satisfies the consistency assumption, Intuitively, the eonsisteney assumption will generally be satisfied by 2 computation rule for h that uniformly uses measurable parameters of the problem state at all nodes; it will generally be violated if the computation rule de- pends tipon any parameter that varies between nodes independently of the problem state (such as a parity count or a random variable), or if the computations at some nodes are more elaborate than at others. ©. Proof of the Optimality of A* ‘The next lemma makes the important observation about, the operation of A* that, under the consisteney assump- tion, if node n is closed, then g(x) = g(x). This fact is im- portant for two reasons, First, itis used in the proof of the theorem about the optimality of A* to follow, and second, it states that A* need never reopen a closed node. That is, i A* expands a node, then the optimal path to that node has already been found. ‘Thus, in Step 4 of the algorithm A*, the provision for reopening a closed node is vacuous and may be eliminated. Lemma 2 Suppose the consistency assumption is satisfied, and suppose that node m is closed by A*. Then fn) = g(n). Proof: Consider the subgraph G, just before closing n, and suppose the contrary, ie., suppose f(n) > g(n). Now there exists some optimal path P from s to n. Since g(n) > a(n), A* did not find P. By Lemma 1, there exists an open node n’ on P with g(n') = g(r’). If n’ = n, we have proved the lemma. Otherwise, Mar ef al; DETERMINATION OF MENIKUM COs PATHE (0) = a(n!) + Ain'sn) = Glu’) + hin'sn) ‘Thus, Gn) > an’) + h(n'n). Adding h(n) to both sides yields Gln) + Km) > Gln") + hln’yn) + hn). We can apply (5) to the right-hand side of the above in- equality to yield Gin) + Kn) > Hn) + ln’) Fa) > fn, ‘contradieting the fact that A* selected n for expansion when 7’ was available and thus proving the lemma. ‘The next lemma states that f is monotonically nonde- creasing on the sequenee of nodes closed by A*. Lemma 8 Let (my ma +++; m) be the sequence of nodes closed by A+. Then, if the consisteney assumption is satisfied, p fom). Sinee this fact is true for any pair of nodes my and ness in ‘the sequence, the proof is eomplete. Corollary Under the premises of the lemma, ifm is closed then Se) SI). Proof: Let t be the goal node found by A*, Then fn) < fO = 50 =f). ‘We ean now prove a theorem about, the optimality of A* as compared with any other admissible algorithm A that 105 uses no more information about the problem than does A*, Let O44 be the index set used by algorithm A at node n. ‘Then, if 0,4" C O,* for all nodes n in G,, we shall say that algorithm A is no more informed than algorithm A’ ‘The next theorem states that if an admissible algorithm, A is no more informed than A*, then any node expanded by A* must also be expanded by A. We prove this theorem for the special ease for which ties never occur in the value of f used by A®. Later we shall generalize the theorem to cover the case where ties ean occur, but the proof of the no- ties theorem is so transparent that we include it for clarity. Theorem 2 Let A be any admissible algorithm no more informed than A", Let Gi, be any 6 graph such that » # m implies J{n) » fm), and let the consistency assumption be satis- fied by the h used in *, ‘Then if node n was expanded by A®, it was also expanded by A. Proof: Suppose the coutrary. ‘Then there exists some node n expanded by A* but not by A. Let t* and t be the preferred goal nodes of s found by A* and A, respectively. Sinee A* and A are both admissible, SU) = GE) + HOH) = gl) +0 = FH) = $0 = Je). Since A* must have expanded » before closing ¢*, by ‘Lemma 3 we have Fen) < He) = 10. (Strict inequality occurs beenuse no ties are allowed.) ‘There exists some graph G9, @ €,, for which h(n) = ‘A(n) by the definition of h. Now by Lemma 2, §(n) = g(n). ‘Then on the graph Gy. fn) = fin). Sinee A is no more informed than A*, A could not rule out the existence of G9; but A did not expand n before termination and is, therefore, not admissible, contrary to our assumption and completing the proof. ‘Upon defining N(A,G,) to be the total number of nodes in G, expanded by the algorithm A, the following simple corollary is immediate. Corollary Under the premises of Theorem 2, N(A*G,) < NA, G) with equality if and only nodes as A*. In this sense, we claim that A* is an optimal algorithm. Compared with other no more informed admissible algorithms, it expands the fewest possible nodes necessary to guarantee finding an optimal path. In ease of ties, that is if there exist two or more open nodes ns, +++, na with fm) = fou) < Hn) for every other open node , A* arbitrarily chooses one of the n,. Consider the set @* of all algorithms that act identically to A® if there are no ties, but whose members resolve ties differently, An algorithm is a member of @* if it is simply the original A* with any arbitrary tie-breaking rule. A expands the identieal set of 106 ‘The next theorem extends Theorem 2 to situations where ties may oceur. It states that for any admissible algorithm A, one ean always find a member A* of @* such that each nocle expanded by A* is also expanded by A. Theorem 3 Let A be any admissible algorithm no more informed ‘than the algorithms in @*, and suppose the consistency assumption is satisfied by the A used in the algorithms in @*. Then for any 6 graph G, there exists an A*e @* such that every node expanded by A’ is also expanded by A. Proof: Let G, be any 6 graph and A:* be any algorithm, in @*. If every node of G, that A:* expands is also ex- panded by A, let A,* be the A* of the theorem. Otherwise, ‘we will show how to construct the A* of the theorem by changing the tie-breaking rule of A,*. Let L be the set of nodes expanded by A, and let P = (s,m, nay ©*; me) be the optimal path found by 4. Expand nodes as prescribed by Ay* as long as all nodes selected for expansion are elements of J. Let m be the first node seleeted for expansion by A,* which is not in L. Now fin) < f(s) by the corollary to Lemma 3. Since fin) < f(s) = f() would imply that A is inadmissible (by the argument of Theorem 2), we may conclude that f(n) f(s). At the time Ay* selected n, goal node twas not closed (or Ay* would have been terminated). Then by the corollaty to Lemma 1, there is an open node n’ on P such that f(n’) < f(s) = f(r). But since n was selected for ex- pansion by Ai* instead of n’, f(n) < fn"). Hence fn) Flo!) < flr), 80 flr) = fin’). Let A4* be identical to A:* ‘except that the tie-breaking rule is modified just enough to choose n instead of n. By repeating the above argument, we obtain for some é an A,*e @* that expands only nodes that are also expanded by A, completing the proof of the theorem. Corollary 1 Suppose the premises of the theorem are satisfied. Then for any 6 graph G, there exists an A*e @* such that N(A*, G)

You might also like