The multi-commodity flow problem is a network flow problem with multiple commodities (flow demands) between different source and sink nodes.
Definition Given a flow network G ( V , E ) {\displaystyle \,G(V,E)} , where edge ( u , v ) ∈ E {\displaystyle (u,v)\in E} has capacity c ( u , v ) {\displaystyle \,c(u,v)} . There are k {\displaystyle \,k} commodities K 1 , K 2 , … , K k {\displaystyle K_{1},K_{2},\dots ,K_{k}} , defined by K i = ( s i , t i , d i ) {\displaystyle \,K_{i}=(s_{i},t_{i},d_{i})} , where s i {\displaystyle \,s_{i}} and t i {\displaystyle \,t_{i}} is the source and sink of commodity i {\displaystyle \,i} , and d i {\displaystyle \,d_{i}} is its demand. The variable f i ( u , v ) {\displaystyle \,f_{i}(u,v)} defines the fraction of flow i {\displaystyle \,i} along edge ( u , v ) {\displaystyle \,(u,v)} , where f i ( u , v ) ∈ [ 0 , 1 ] {\displaystyle \,f_{i}(u,v)\in [0,1]} in case the flow can be split among multiple paths, and f i ( u , v ) ∈ { 0 , 1 } {\displaystyle \,f_{i}(u,v)\in \{0,1\}} otherwise (i.e. "single path routing"). Find an assignment of all flow variables which satisfies the following four constraints: (1) Link capacity: The sum of all flows routed over a link does not exceed its capacity.
∀ ( u , v ) ∈ E : ∑ i = 1 k f i ( u , v ) ⋅ d i ≤ c ( u , v ) {\displaystyle \forall (u,v)\in E:\,\sum _{i=1}^{k}f_{i}(u,v)\cdot d_{i}\leq c(u,v)}
(2) Flow conservation on transit nodes: The amount of a flow entering an intermediate node u {\displaystyle u} is the same that exits the node.
∀ i ∈ { 1 , … , k } : ∑ ( u , w ) ∈ E f i ( u , w ) − ∑ ( w , u ) ∈ E f i ( w , u ) = 0 w h e n u ≠ s i , t i {\displaystyle \forall i\in \{1,\ldots ,k\}:\,\sum _{(u,w)\in E}f_{i}(u,w)-\sum _{(w,u)\in E}f_{i}(w,u)=0\quad \mathrm {when} \quad u\neq s_{i},t_{i}}
(3) Flow conservation at the source: A flow must exit its source node completely.
∀ i ∈ { 1 , … , k } : ∑ ( s i , w ) ∈ E f i ( s i , w ) − ∑ ( w , s i ) ∈ E f i ( w , s i ) = 1 {\displaystyle \forall i\in \{1,\ldots ,k\}:\,\sum _{(s_{i},w)\in E}f_{i}(s_{i},w)-\sum _{(w,s_{i})\in E}f_{i}(w,s_{i})=1}
(4) Flow conservation at the destination: A flow must enter its sink node completely.
… excerpt ends here. Continue reading the full article.
