Goal state 2026-10-25
A state satisfying a problem's goal test. Whether its generation or its later selection terminates a search algorithm affects optimality for algorithms such as A-star search. A goal state's remaining optimal cost is zero, whereas its accumulated path cost need not be zero.
Greedy perfect-heuristic descent 2026-10-25
In a finite reachable search problem with strictly positive step costs and a reachable goal, greedy best-first search using a perfect heuristic selects one parent–child chain until it reaches a goal state. At a selected nonterminal state , an optimal first transition has . Every older search frontier entry has estimate at least , so the next selected entry must be a newly generated child with smaller estimate. Repeating proves the chain property. In an infinite finitely branching problem, a positive uniform lower bound on costs also bounds the chain length by the initial remaining cost divided by that lower bound. Zero-cost ties can break the chain property; the lemma does not establish least accumulated path cost.
Iterative lengthening search 2026-10-24
Iterative lengthening search repeatedly runs cost-bounded depth-first search, starting with threshold zero and replacing each unsuccessful threshold by the smallest rejected path cost. It uses a depth-first search stack rather than the potentially large search frontier of uniform-cost search.
Suppose an optimal plan has cost and each pass terminates. At every unsuccessful threshold , some first rejected prefix of an optimal plan has path cost at most . Therefore the next threshold is no larger than . Any first returned goal state has cost at most and hence exactly . Finite branching factor and a positive lower bound on step costs ensure that only finitely many search nodes precede that cost, giving completeness as well as optimality. With arbitrary real step costs, the threshold increments can be much smaller than the smallest step cost: the difference between two path costs need not itself be a step cost.
The first assertion is false. Give the root a first child that is a goal state of cost ten and another child leading to many cheaper non-goal search nodes. Depth-first search can take the first child and stop immediately. A-star search with the admissible heuristic behaves as uniform-cost search and expands the cheaper non-goal search nodes before selecting that goal. Thus an admissible heuristic does not make A-star search expand fewer nodes than every possible depth-first search ordering. The latter need not return an optimal solution.
The second assertion is true under the usual finite-branching factor assumption. Breadth-first search orders by search depth, not path cost. Every finite depth contains finitely many search nodes, so a goal at finite depth is eventually reached even if some steps cost zero. Zero-cost steps can affect cost optimality, but do not obstruct this completeness argument. An infinite branching factor would invalidate the argument irrespective of step costs.
The third assertion is true as a worst-case black-box requirement, with a finite optimum assumed. If outgoing actions are known only by expanding a state, an unexamined reachable branch can conceal a sufficiently negative-cost action followed by a route to a goal. Its total cost can beat the current solution by an arbitrarily large amount. Without additional lower bounds or structural information, finding one cheap solution cannot justify stopping; exhaustive examination can be necessary. This does not assert that every already-described irrelevant state must be visited on every input. Moreover, a reachable negative-cost cycle in a graph that can still reach a goal can make costs unbounded below, in which case no finite-cost optimal solution exists at all.
Start the threshold at zero and let be the least solution cost. Suppose an unsuccessful pass has threshold . Along an optimal action sequence, take the first prefix whose path cost exceeds . Its preceding prefix is explored, so that rejected prefix contributes to the next-threshold calculation. Positive step costs imply that its cost is at most . Therefore the next threshold is also at most .
By induction, no threshold used before the first solution exceeds . A returned goal state therefore has cost at most ; by the definition of it cannot cost less. The first returned solution is optimal.
The termination qualification matters. In a finitely branching problem with step costs at least , a threshold admits only depths up to , so each pass is finite and only finitely many path costs precede . These conditions establish completeness as well. Strict positivity alone on an arbitrary infinite tree is insufficient: an infinite branch with costs can remain below a finite threshold and trap depth-first search. The optimality argument above is valid whenever the required passes terminate; a finite graph with finitely many strictly positive action costs supplies a uniform positive lower bound.
TODO: the classifications, chosen heuristic functions and least-cost outcomes for G1–G5 cannot be established from the corrupted original Figure 1. The missing edges, costs, priority labels and lower portions of the five search trees are required inputs. The surviving portions and the two heuristic function tables do not determine those answers. No reconstructed graph or invented expansion trace is assumed.
For a readable instance, depth-first search follows the deepest pending branch and breadth-first search expands by search depth; neither generally minimizes unequal edge costs. Uniform-cost search orders by path cost , whereas A-star search orders by . A displayed A-star search score would identify the estimate by subtracting the accumulated path cost. Under nonnegative costs and the usual terminating-search assumptions, uniform-cost search returns a least-cost goal state when testing goals on removal from the search frontier; A-star search additionally needs an admissible heuristic with appropriate reopening, or a consistent heuristic for the usual closed-set implementation. These rules explain how the missing information would be used, but cannot identify a particular damaged search tree.
With the conventional strictly positive step costs, the five answers in printed order are false, false, true, true, true. The third answer needs that positivity convention: it is false in general if zero-cost edges and unrestricted ties are admitted. Take the goal test on selection from the search frontier, and assume a finite reachable problem with a reachable goal state; finite branching factor and a positive lower bound on step costs give the corresponding tree search guarantees on an infinite problem. These assumptions make the usual A-star search guarantees precise.[ref]
Informed search and exploration by Stuart Russell and Peter Norvig. §4.1, printed pp. 94–100: best-first priorities, consistency and optimality conditions
For the first assertion, use a directed graph with transitions of cost , of cost and of cost , where is the only goal state. The perfect heuristic is , , . Greedy best-first search selects the direct goal of cost because its priority is zero. The least path cost is . Knowing the exact remaining distance does not account for an expensive transition already taken.
The same counterexample settles the second assertion. Greedy best-first search selects , while A-star search selects : after expanding , the A-star search priorities are for and for the direct copy of . Thus even the expanded state sets differ.
For the third assertion, let the current nonterminal search node have finite remaining distance . The first transition of a least-cost continuation has some successor withEvery older entry in the search frontier has estimate at least , since the current entry was selected with minimum estimate. A newly generated successor with strictly smaller estimate therefore wins over every older entry. Whichever new successor is selected has smaller remaining distance than the current search node, so the argument repeats. Consequently the selected search nodes form one parent–child chain; include the selected goal, or append it if “expanded” excludes goal processing. This greedy perfect-heuristic descent does not imply least path cost, as the first counterexample demonstrates.
The zero-cost qualification is substantive. Give two successors of cost , add of cost , and add and of cost . The perfect heuristic has values at , at and at . Alphabetical priority ties let greedy best-first search select , which is not one graph path. Thus the unqualified third assertion requires a cost or tie convention absent from the printed text.
For the fourth assertion, a least remaining distance satisfieson every edge, by taking that edge and then a least-cost continuation. Thus is a consistent heuristic. The usual A-star search graph search finalizes each expanded state's least path cost and returns a least-cost goal.
For the fifth assertion, write . Before a goal is selected, an unexpanded prefix of an optimal graph path remains on the search frontier, with . A-star search therefore selects only search nodes with . Since ,This compares remaining cost, not search depth or accumulated path cost. The statement can fail with negative costs; those are outside the convention used here.
A sufficient sequential bound is for any physically valid initial and goal states, assuming every bucket is directly reachable. A goal must be consistent with the stated one-hand and one-location invariants. No bound can guarantee a satisfying plan for an inconsistent goal, such as requiring the same ball in two buckets simultaneously.
Here is a constructive bound independent of the number of buckets. If the hand initially holds a ball, drop it in the current bucket, costing at most one action. For each ball that should end in a bucket, move to its current bucket, pick it up, move to its target bucket, and drop it: at most four actions per ball, omitting unnecessary actions. If the final state requires a held ball, reserve it for last, move to its current bucket and pick it up, costing at most two more actions. Finally move the arm to its prescribed final location, costing at most one action.
If the final hand is empty, this costs at most . If it holds a ball, only balls need bucket placement, giving at most for . Thus the common bound is valid. A partially specified, physically consistent goal can first be completed to a valid target state. For the special goal of putting all balls in one bucket with no specified final arm location, is already a sufficient bound.
Perfect heuristic 2026-10-25
The exact minimum remaining path cost from a state to a goal state, with value when no goal is reachable. For nonnegative step costs, at goals and on every transition. Thus a perfect heuristic is a consistent heuristic and an admissible heuristic. It measures remaining cost; a greedy best-first search decision using only this number can still take an excessively costly incoming edge.