MCPcopy Create free account
hub / github.com/djeada/Algorithms-And-Data-Structures / a_star

Function a_star

src/graphs/python/a_star/src/a_star.py:12–73  ·  view source on GitHub ↗

Find the shortest path between source and destination using A* algorithm. Args: graph: The graph to search. source: The starting vertex. destination: The target vertex. heuristic: A function that estimates the distance between two vertex values.

(
    graph: Graph,
    source: Vertex,
    destination: Vertex,
    heuristic: Callable[[Any, Any], float],
)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

test_a_star_pointsMethod · 0.90

Calls 4

containsMethod · 0.45
verticesMethod · 0.45
edges_from_vertexMethod · 0.45
addMethod · 0.45

Tested by 1

test_a_star_pointsMethod · 0.72