A* Optimality and Heuristic Conditions (Admissible vs. Consistent vs. Inconsistent vs. Arbitrary)
In graph search, the A* algorithm uses evaluation function where is the path cost from the start to state , and is a heuristic estimate of the remaining cost to a goal. The commonly tested multiple-choice fact is:
A* guarantees optimality if the heuristic is admissible and consistent (under the standard graph-search version of A* that uses a closed list without reopening states).
A quick intuition is that admissibility means the heuristic never overestimates the true remaining cost, while consistency (a.k.a. monotonicity) imposes a “triangle-inequality-like” constraint that prevents -values along a path from decreasing, which in turn supports optimal goal selection in graph search.2
Key learning terms:
- heuristic
- admissible heuristic
- consistent heuristic
- A* graph search
- optimality
Footnotes
-
A* search algorithm - Wikipedia - Describes A* and notes optimality relations with heuristic conditions and consistency/reopening issues. ↩ ↩2
-
CS 188: Artificial Intelligence (CS188) Lec 04 PDF - States: tree search optimal with admissible heuristic; graph search optimal with consistent heuristic; includes consistency definition. ↩
-
Search: A* (Stanford CS221 autumn2022 module PDF) - Provides formal discussion of admissibility/consistency and how consistency implies admissibility. ↩
Admissible and Consistent Heuristics (A*)
The correct option among (i)–(iv)
Let’s map each proposed heuristic condition to A*’s optimality guarantee (for the standard graph-search interpretation):
- (i) Arbitrary → No guarantee. A* relies on heuristic conditions to ensure the first goal found is optimal.
- (ii) Inconsistent → Optimality guarantee is not assured in general (graph-search may require re-expansions; some variants can still be made optimal, but the usual guarantee does not hold under inconsistent heuristics without special handling).
- (iii) Admissible and consistent → Yes, optimality is guaranteed (standard A* graph search).
- (iv) Random → No guarantee (it is not constrained to be admissible/consistent).
Therefore, the correct choice is (iii) Admissible and consistent.
Footnotes
-
A* search algorithm - Wikipedia - Describes A* and notes optimality relations with heuristic conditions and consistency/reopening issues. ↩ ↩2
-
A* Search with Inconsistent Heuristics (IJCAI 2009 paper) - Discusses consequences of inconsistent heuristics and node reopening/re-expansion behavior. ↩
-
Search: A* (Stanford CS221 autumn2022 module PDF) - Provides formal discussion of admissibility/consistency and how consistency implies admissibility. ↩ ↩2
Why consistency matters for graph-search optimality
Never overestimate
Heuristic admissibilityEnsures optimistic estimates; supports optimality arguments for search."
Triangle-inequality-like constraint
Heuristic consistencyGuarantees does not decrease along paths, preventing problematic re-expansions in standard graph search."
Closed list safety
A* graph search loopWith consistency, once a state is expanded, it need not be “improved later” in a way that breaks optimality."
Optimal goal cost returned
First goal selectionA* returns an optimal least-cost solution under these assumptions."
Definitions (formal conditions)
Let be the step cost from node to a neighbor node , and let be the true minimal cost from to a goal.
- Admissible means:
- Consistent means:
Consistency implies admissibility, and the standard A* optimality statement for graph search uses consistency.2
Key learning terms for this section:
- cost-to-go
- monotonicity
- triangle inequality (heuristic form)
Footnotes
-
Search: A* (Stanford CS221 autumn2022 module PDF) - Provides formal discussion of admissibility/consistency and how consistency implies admissibility. ↩
-
CS 188: Artificial Intelligence (CS188) Lec 04 PDF - States: tree search optimal with admissible heuristic; graph search optimal with consistent heuristic; includes consistency definition. ↩
A* and the role of heuristic consistency (graph search view)
- 1Step 1
A* prioritizes nodes by the smallest estimated total solution cost, using .
- 2Step 2
The algorithm removes the lowest- node from open and expands it.
- 3Step 3
In the standard graph-search formulation, consistency ensures that once expanded, a node will not later need re-expansion to preserve optimality.
- 4Step 4
With admissible and consistent heuristics, when a goal node is selected for expansion (popped from open), its path cost is guaranteed minimal.
- 5Step 5
If the heuristic is arbitrary or inconsistent, the assumptions used for the “first goal is optimal” argument no longer hold.
Admissible vs. consistent (what to remember)
"Admissible prevents overestimation; consistent additionally enforces , which is what most graph-search optimality proofs rely on for avoiding harmful re-expansions."
Footnotes
-
Search: A* (Stanford CS221 autumn2022 module PDF) - Provides formal discussion of admissibility/consistency and how consistency implies admissibility. ↩
Inconsistent heuristics can harm the standard A* optimality argument
"With inconsistent (but admissible) heuristics, A* may expand the same node multiple times (reopen/re-expand behavior), and naive “closed list = final” reasoning no longer applies; the usual guarantee is therefore stated for admissible+consistent heuristics under the standard graph-search model." 2
Footnotes
-
A* Search with Inconsistent Heuristics (IJCAI 2009 paper) - Discusses consequences of inconsistent heuristics and node reopening/re-expansion behavior. ↩
-
CS 188: Artificial Intelligence (CS188) Lec 04 PDF - States: tree search optimal with admissible heuristic; graph search optimal with consistent heuristic; includes consistency definition. ↩
Heuristic condition vs. A* optimality guarantee (graph search)
Assumes the standard A* optimality claim used in common AI courses.
Common exam nuance: “admissible” vs “admissible & consistent”
Knowledge Check
The A* algorithm guarantees optimality if the heuristic used is:
Explore Related Topics
Algorithms
Algorithms are finite, well-defined procedures that transform inputs into outputs, requiring correctness, efficiency, and formal properties such as definiteness and finiteness.
- Valid algorithms must be definite, finite, have clear input/output, and be effective; correctness and efficiency are essential.
- Analyzing an algorithm involves problem specification, pseudocode, correctness proof, and measuring time (, , ) and space complexity.
- Common growth rates range from to , with divide‑and‑conquer recurrences like .
- Key design paradigms include divide‑and‑conquer, dynamic programming, greedy, backtracking, and branch‑and‑bound.
- Choosing an algorithm depends on input characteristics, worst‑case vs. average performance, memory limits, stability, and preprocessing needs.
Ambiguity in the Grammar \(S \rightarrow ABA,\; A \rightarrow aA \mid \epsilon,\; B \rightarrow bB \mid \epsilon\)
The grammar (S\rightarrow ABA,;A\rightarrow aA\mid\epsilon,;B\rightarrow bB\mid\epsilon) is ambiguous because the two (A) nonterminals can distribute the same (a)-string in multiple ways, especially when (B) derives (\epsilon).
- It generates the language (L(S)={a^i b^j a^k\mid i,j,k\ge0}=a^*b^a^).
- The shortest string (a) has two distinct left‑most derivations (or parse trees), proving ambiguity.
- Every string (a^n) with (n\ge1) can be split between the two (A) symbols in (n+1) ways, yielding multiple parse trees.
- The ambiguity stems from both (A) producing (a^*) and (B) being able to vanish via (\epsilon).
- An equivalent unambiguous grammar can be constructed, showing the ambiguity is a property of this grammar, not necessarily of the language.
Criteria for Evaluating a Search Strategy