eastar v0.5.0 Astar

A* graph pathfinding.

Link to this section Summary

Functions

Find path between two vertices in a directed weighted graph.

Link to this section Types

Link to this type

distance_f()

distance_f() :: (vertex(), vertex() -> non_neg_integer())
Link to this type

nbs_f()

nbs_f() :: (vertex() -> [vertex()])
Link to this type

vertex()

vertex() :: any()

Link to this section Functions

Link to this function

astar(env, start, goal)

astar(env(), vertex(), vertex() | (vertex() -> bool())) :: [vertex()]

Find path between two vertices in a directed weighted graph.

  • env - a graph "environment" - the tuple {nbs, dist, h} where each element is a function:

    • nbs - returns collection of neighbor vertices for a given vertex
    • dist - returns edge cost between two neighbor vertices
    • h - returns estimated cost between two arbitrary vertices
  • start - starting vertex
  • goal - vertex we want to reach, or a function of arity 1 to check if current vertex is a goal