| Copyright | Thodoris Papakonstantinou 2017-2026 |
|---|---|
| License | LGPL-3 |
| Maintainer | dev@tpapak.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.Graph.AdjacencyList.WFI
Description
Implementation of the Floyd-Warshall algorithm for computing all-pairs shortest path distances on a weighted or unweighted directed graph. Complexity: O(V^3).
Documentation
The array containing the distances from vertex to vertex
Instances
| Read Distances Source # | |
| Show Distances Source # | |
| Eq Distances Source # | |
| Ord Distances Source # | |
type IMArray = IntMap (IntMap Weight) Source #
Two-dimensional distance matrix: vertex → vertex → Weight.
shortestDistances :: Graph -> Distances -> Distances Source #
Get all shortest distances given initial weights on edges
unweightedShortestDistances :: Graph -> Distances Source #
Get all shortest unweighted distances
adjacencyArray :: Graph -> Distances Source #
Build the initial distance matrix from a graph's edges (unit weights).
Self-distances are 0; direct edges have distance 1; all others are absent
(infinite). Pass the result to shortestDistances to run Floyd-Warshall.