#alg #floyd-warshall #warshall #floyd #algorithm

floyd-warshall-alg

Floyd-Warshall algorithm supporting customization

2 releases

0.1.3 Feb 3, 2019
0.1.2 Feb 2, 2019

#1492 in Algorithms


Used in exchange-rate

GPL-3.0 license

20KB
244 lines

Floyd-Warshall algorithm

Rust implementation of Floyd-Warshall algorithm supporting customization.

Crate Documentation Travis CI CodeCov
Documentation Build Status codecov

Customization

Operator

  • Is used to calculate a new path weight when trying the path through additional node k.
  • By default set to be standard addition.
  • Can be used to replace default addition to something else (e.g. multiplication).

Comparison

  • Is used for a newly tested path (through k) and the old path to determine if the new path weight is better.
  • By default set to be standard min (return true if the left argument is lower than the right).
  • Can be used to replace default min to something else (e.g. max).

Dependencies

Safe Graph (safe-graph)

  • Rust implementation of Graph (refactored version of GraphMap from petgraph).
  • My own crate.

Numeric traits (num-traits)

  • Numeric traits for generic mathematics in Rust.
  • Third-party crate with 6+ millions downloads (so even not being in a stable release, the high usage gives it a high testing coverage).

License

Licensed under the General Public License (GPL), version 3 (LICENSE http://www.gnu.org/licenses/gpl-3.0.en.html).

Dependencies

~1MB
~20K SLoC