Module algorithms

Source
Expand description

Contains all algorithms that are implemented in this crate.

§Algorithms implemented

§Pathfinding algorithms

§Performance

All algorithms where measured using criterion on a graph with 10,000 nodes and 39,600 edges. The algorithms where run 100 times on the test graph, the mean time is listed in the table below. The tests where performed on a Ryzen 5 7600x processor.

AlgorithmMean time per run
Bellman-Ford2.1883 s
Dijkstra52.3155 ms

Enums§

RunAlgorithmError
Errors that can occur when algorithms are run.

Functions§

bellman_ford
Calculates the shortest distance between one source node and all other nodes on the graph using Bellman-Ford algorithm.
dijkstra
Calculates the shortest distance between one source node and all other nodes on the graph using Dijkstra’s algorithm.