Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Maximum Flow Optimization

We have a network (represented as directed graph). The graph has a “Source” of a medium (it can be for example gas, water, or electricity) and Sink with additional nodes in between. All edges between source and sink has defined maximal capacity.

graph LR;
    A["Source"];
		D["Sink"];
		A-->|"10"|B1;
    A-->|"8"|B2;
    B1-->|"6"|C1;
		B1-->|"2"|C2;
		B2-->|"4"|C1;
		B2-->|"5"|C2;
		C1-->|"8"|D;
		C2-->|"9"|D;

What is the maximum amount medium we can transmit through the sink?

Mathematical Model

Let us first define our optimization variables as individual flows through the edges of our graph

graph LR;
    A["Source"];
		D["Sink"];
		A--->|"x₀ ≤ 10"|B1;
    A--->|"x₁ ≤ 8"|B2;
    B1-->|"x₂ ≤ 6"|C1;
		B1-->|"x₃ ≤ 2"|C2;
		B2-->|"x₄ ≤ 4"|C1;
		B2-->|"x₅ ≤ 5"|C2;
		C1-->|"x₆ ≤ 8"|D;
		C2-->|"x₇ ≤ 9"|D;

we may then write the problem as

where

Canonical Form

Manipulating the objective into the canonical form can be done simply with To deal with the constraints let us first formulate the equality constraints in matrix form as: where Equivalently we may write it as Together with the upper bounds they can be now rewritten into the canonical form