1 module IMinCostFlow where
2 import Data.Array.IArray
3 import Data.Graph.Inductive.Graph
5 type MinCostFlowImpl1 gr a b i f c =
6 (i, i) -> -- Range of edge indices
7 (b -> i) -> -- Edge label -> unique edge index
8 (b -> f) -> -- Edge label -> flow capacity
9 (b -> c) -> -- Edge label -> cost per unit of flow
11 (Node, Node) -> -- (source, sink)
12 Array i f -- ! edge index -> flow value
14 type MinCostFlowImpl =
15 forall gr a b i f c. (Graph gr, Ix i, Real f, Real c) =>
16 MinCostFlowImpl1 gr a b i f c