Zog.Pathfinding (Zog v0.1.0)
View SourceNative pathfinding algorithms backed by Zog (Zig) via Zigler.
Summary
Functions
Computes the shortest path and its weight between two nodes using the A* algorithm.
Computes the shortest path and its weight between two nodes using Bellman-Ford algorithm.
Computes the shortest path and its weight between two nodes using Dijkstra's algorithm.
Computes all-pairs shortest paths using the Floyd-Warshall algorithm.
Checks if a target node is reachable from a start node using BFS traversal.
Computes all-pairs shortest paths using Johnson's Algorithm.
Functions
@spec astar( Zog.SoA.t(), Zog.SoA.label(), Zog.SoA.label(), map() | list(), map() | list(), atom() ) :: {:ok, {[Zog.SoA.label()], float()}} | {:error, :no_path}
Computes the shortest path and its weight between two nodes using the A* algorithm.
@spec bellman_ford(Zog.SoA.t(), Zog.SoA.label(), Zog.SoA.label()) :: {:ok, {[Zog.SoA.label()], float()}} | {:error, :no_path} | {:error, :negative_cycle}
Computes the shortest path and its weight between two nodes using Bellman-Ford algorithm.
@spec dijkstra(Zog.SoA.t(), Zog.SoA.label(), Zog.SoA.label()) :: {:ok, {[Zog.SoA.label()], float()}} | {:error, :no_path}
Computes the shortest path and its weight between two nodes using Dijkstra's algorithm.
Computes all-pairs shortest paths using the Floyd-Warshall algorithm.
@spec is_reachable(Zog.SoA.t(), Zog.SoA.label(), Zog.SoA.label()) :: boolean()
Checks if a target node is reachable from a start node using BFS traversal.
Computes all-pairs shortest paths using Johnson's Algorithm.