java.lang.Object
org.jgrapht.demo.ShortestPathAStarALTDemo
Demo comparing A* shortest path search with a trivial (zero) heuristic against A* guided
by the ALT (A*, Landmarks, Triangle inequality) heuristic.
ALT precomputes shortest-path distances from a small set of landmark vertices and uses the triangle inequality to derive a tight, admissible lower-bound estimate of the remaining distance to the target. This lets A* skip exploring large portions of the graph without ever sacrificing the guarantee of finding the true shortest path.
The demo builds a weighted grid graph, computes the shortest path between two opposite corners using both heuristics, and reports how many vertices each search had to expand. Both approaches must agree on the path weight -- ALT only changes search efficiency, never correctness.
- Author:
- federicodeca
-
Method Summary
-
Method Details
-
main
Main demo entry point.- Parameters:
args- command line arguments
-