Flow augmenting paths

• The Ford-Fulkerson Algorithm

• The classic algorithm for finding the maximum flow is called:

• The Ford-Fulkerson Algorithm:

 ``` for ( each edge e ) { f(e) = 0; // Start with 0 flow on each edge } while ( there is a "flow augmenting path" ) { increase the flow along this "flow augmenting path"; } ```

To understand the algorithm, we need to learn about:

 What is a flow augmenting path ???

• Flow augmenting paths --- introduction

• Flow augmenting path:

 Flow augmenting path = a path from source S to sink T where you can increase the amount of flow of the commodity

• I distinguish 2 types of flow augmenting paths:

• I call the first type of flow augmenting paths:

 Purely unsaturated path

• I call the second type of flow augmenting paths:

 Hybrid paths

• Flow Augmenting Paths --- type #1

• Flow augmenting path - type #1:

 A path from source S → sink T consisting entirely if unsaturated edges is an flow augmenting path

Example:

• The following path is an flow augmenting path of type#1:

 ``` Source S ---> A ---> D ---> Sink T ```

in the following basic network:

• Every edge on the path from source S → sink T is unsaturated (i.e.: f(e) < c(e))

• Slack: amount of increase on a flow augmenting path

• Definition: slack

 ``` Slack( path ) = maximum amount of flow that can be increased along the given path ```

• Slack on a flow augmenting path of type #1:

 ``` Slack ( flow augmenting path type 1 ) = min e ∈ path ( c(e) - f(e) ) ```

Example:

• Consider the flow augmenting path S A B T in the following basic network:

The slack of this path is:

 ``` Slack ( S --> A --> B --> T ) = min ( (3-2), (5-2), 4-2) ) = min ( 1, 3, 2 ) = 1 ```

• Increasing the flow along a flow augnmenting path

• Fact:

 The flow along a flow augmenting path can be increased by an amount equal to the slack without violating the feasibility condition f(e) ≤ c(e)

Example: increase flow along a "flow augmenting path"

• A flow augmenting path:

• The slack on this flow augmenting path = 1

(The bottleneck edge is (S,A))

• After increasing the flow by 1 along the flow augmenting path:

• Flow augment path --- preliminray to the type #2 paths

• Consider the flowing network flow:

• Observation:

• The current flow amount from ST = 5

• There are no more paths from ST that consists entirely of unsaturated edges:

• The only posible increase is through SC:

• The only path from ST through SC is:

• The slack on this path is:

 ``` Slack = 2 - 2 (on the edge E --> T) = 0 ```

• \$64,000 question:

 Is this solution the maximum possible flow through the network ???

There is a better solution:

(Total flow = 6 !!!)

• The flow augmenting path used (reconstructed by comparing the before and after values of the flows):

• State before the change:

• State after the change:

• Difference:

• \$64,000 question:

 How can such a path be an flow augmenting path ???

• Forward and backward edges

• Definition: forward and backward edges

• Let P be a path from source S to sink T

• Let e be an edge on path P

• The edge e is an forward edge if:

 The path P uses edge e in the forward direction

• The edge e is an backward edge if:

 The path P uses edge e in the backward direction

Example:

• Consider the following path from source S to sink T:

Forward edges:

 ``` S --> C, C --> E, B --> F, F --> T ```

Backward edge:

 ``` B --> E ```

• How to increase flow on a path

• Fact:

• The flow on a (any) path is increased by:

 Increasing the flow on the forward edges of the path       and (simultaneously)     Decreasing the flow on the back edges of the path !!!!

Example:

To increase flow, we must:

 Increase flow on the green edges      and Decrease flow on the red edge !!!!

• Intuitive explanation:

 When you cut back on the amount you push backward, you will increase the amount that you push forward !!!

• Flow augmenting path: final definition

• Flow augmenting path:

• Flow augmenting path = a path from source S → sink T that consists of:

 forward edges that are unsaturated (i.e., f(e) < c(e))           and/or         backward edges with non-zero flow (i.e., f(e) > 0)

• The slack of a flow augmenting path P:

 ``` { min forward e ( c(e) - f(e) ) slack( P ) = min of : { { min backward e ( f(e) ) ```