Class ShortestPathAStar

  • All Implemented Interfaces:
    ShortestPathHeuristicSt

    public class ShortestPathAStar
    extends ShortestPathHeuristicStAbstract
    A* shortest path algorithm.

    The A star (A) algorithm try to find the shortest path from a source to target vertex. It uses a heuristic that map a vertex to an estimation of its distance from the target position.

    An advantage of the A algorithm over other ShortestPathSingleSource algorithm, is that it can terminate much faster for the specific source and target, especially if the heuristic is good.

    The algorithm runs in O(m+nlogn) and uses linear space in the worse case. If the heuristic is good, smaller running time and space (!) will be used.

    Author:
    Barak Ugav
    See Also:
    Wikipedia