compas.topology.astar_lightest_path(adjacency, weights, heuristic, root, goal)[source]

Find the path of least weight between two vertices of a graph using the A* search algorithm.

  • adjacency (dict) – An adjacency dictionary. Each key represents a vertex and maps to a list of neighboring vertex keys.

  • weights (dict) – A dictionary of edge weights.

  • heuristic (dict) – A dictionary of guesses of weights of paths from a node to the goal.

  • root (hashable) – The start vertex.

  • goal (hashable) – The end vertex.


list, None – The path from root to goal, or None, if no path exists between the vertices.