Network and Network Flow Optimization Tools
The following example is based on the following graph
sourced from [Wikipedia][https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm].
Here, the goal is to find the shortest path tree rooted at node 0. In the example, it is verified the distance from node 0 to node 4 is 20.
```rust use spokes::{Network, algorithms::{dijkstrashortestpath, Distance}, ArcStorage};
let mut network: Network
let shortestpathtree = dijkstrashortestpath(&network, 0);
asserteq!(shortestpath_tree.node(&4), Some(&Distance::Finite(20)));
let mut expected_network: Network
expectednetwork.addnodes([ (0, Distance::Finite(0)), (1, Distance::Finite(7)), (2, Distance::Finite(9)), (3, Distance::Finite(20)), (4, Distance::Finite(20)), (5, Distance::Finite(11)), ]);
expectednetwork.addarcs([ (1, 0), (2, 0), (3, 2), (5, 2), (4, 5), ]);
asserteq!(shortestpathtree, expectednetwork); ```
License: MIT or Apache-2.0