Copyright | (C) David Himmelstrup |
---|---|
License | see the LICENSE file |
Maintainer | David Himmelstrup |
Safe Haskell | None |
Language | Haskell2010 |
Implementation of Floyd-Warshall shortest path algorithm.
See Wikipedia article for details: https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm
Documentation
mkGraph :: (Unbox a, Num a) => Int -> a -> [(Int, Int, a)] -> ST s (MVector s (a, Int)) Source #
Construct a weighted graph from \(n\) vertices, a max bound, and a list of weighted edges.
floydWarshall :: (Unbox a, Fractional a, Ord a) => Int -> MVector s (a, Int) -> ST s () Source #
\( O(n^3) \)