Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "algorithm/a-star"

Index

Functions

Functions

aStar

  • aStar<T>(source: T, target: T, g: Graph<T> & Weighted<T>, heuristic: (s: T, t: T) => number, maxlen: number): Deque<T>
  • Finds the shortest path between two points on a weighted graph using A*.

    Type parameters

    • T

    Parameters

    • source: T

      Source node.

    • target: T

      Target node.

    • g: Graph<T> & Weighted<T>

      Weighted graph.

    • heuristic: (s: T, t: T) => number

      Heuristic function for A*.

        • (s: T, t: T): number
        • Parameters

          • s: T
          • t: T

          Returns number

    • maxlen: number

    Returns Deque<T>

    shortest path between the source and target nodes as a double ended queue.

Generated using TypeDoc