Abstract: In the field of heuristic search, the consistency assumption—a form of the triangle inequality—is often a prerequisite for the efficiency of algorithms like A*. When heuristics are non-consistent, search performance can degrade significantly. This paper, originally published by László Mérő in 1984, introduces Algorithm B', a refinement of Martelli’s Algorithm B. By dynamically updating heuristic estimates during the search process, Algorithm B' achieves a worst-case complexity of $O(N^2/8)$, a fourfold improvement over previous bounds. Furthermore, the paper establishes that no single algorithm can be considered optimal across all possible graphs when measuring total node expansions.
Introduction: The Challenge of Non-Consistent Heuristics
The A algorithm is widely regarded as the standard for pathfinding in state-space searches. Its efficiency, however, is contingent upon the "consistency assumption": for any node $n$ and its successor $m$, the heuristic estimate $h(n)$ must satisfy $h(n) \le c(n, m) + h(m)$, where $c(n, m)$ is the cost of the edge between them. When this assumption is violated, A may reopen nodes an exponential number of times, leading to catastrophic performance.
To address this, Alberto Martelli previously proposed Algorithm B, which caps the worst-case complexity at $O(N^2)$. While a significant improvement, Algorithm B treats heuristic values as static, failing to leverage structural information discovered during the search itself.
Algorithm B': Dynamic Heuristic Refinement
Mérő’s primary contribution is Algorithm B', which introduces the concept of "sharpening" heuristics on the fly. The core insight is that the heuristic $h(n)$ is merely an estimate that can be improved as the algorithm explores the graph. Unlike standard A* or Algorithm B, which use fixed $h$-values, B' updates these values dynamically.
Algorithm B' implements three key mechanisms:
- Dynamic Updates: If the search reveals that a node’s heuristic is lower than what the path costs to its children would suggest, the algorithm raises that heuristic value.
- Information Propagation: Upon expanding a node $n$, the algorithm checks if the heuristics of its children $m$ can be improved based on $n$'s current (potentially updated) heuristic and the edge cost $c(n, m)$.
- Modified Selection Criteria: It maintains Martelli’s "global F" variable to control the search frontier and prevent the redundant re-expansions characteristic of naive A* in non-consistent spaces.
Theoretical Results and Complexity
The most striking result of Mérő’s work is the tightening of the theoretical upper bound for node expansions. While Martelli's Algorithm B has a worst-case complexity of $N^2/2 + O(N)$, Algorithm B' reduces this to $N^2/8 + O(N)$. This fourfold speedup is achieved solely through the propagation of heuristic information during the expansion process.
Beyond specific bounds, Mérő proves a fundamental limitation in search theory: the non-existence of a universally "optimal" algorithm. He demonstrates that if complexity is measured by the total number of node expansions (including re-expansions), for any given algorithm, one can construct a graph where a different algorithm would perform fewer expansions. This suggests that algorithm selection must be informed by the specific properties of the search space rather than a search for a single "best" method.
Conclusion
Algorithm B' represents a significant theoretical advancement in handling "misleading" or non-consistent heuristics. By treating heuristics as dynamic entities rather than static constants, Mérő demonstrated that substantial efficiency gains are possible even in difficult search scenarios. While the administrative overhead of heuristic updates might be a factor in systems where node expansion is extremely cheap, the reduction in worst-case complexity remains a cornerstone of heuristic search theory.
Summary updated