Top Banner
Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem
16

Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

Jan 17, 2016

Download

Documents

Annice Haynes
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

Algorithm Visualization

The Ford-Fulkerson Augmenting Path Algorithm for the Maximum

Flow Problem

Page 2: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

3

Ford-Fulkerson Max Flow

This is the original network, and the original residual network.

4

11

2

21

2

3

3

1

s

2

4

5

3

t

Page 3: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

4

4

11

2

21

2

3

3

1

Ford-Fulkerson Max Flow

Find any s-t path in G(x)

s

2

4

5

3

t

Page 4: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

5

4

1

1

2

13

Ford-Fulkerson Max Flow

Determine the capacity Δ of the path.

Send Δ units of flow in the path.Update residual capacities.

11

1

21

2

3

2

1

s

2

4

5

3

t

Page 5: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

6

4

1

1

2

13

Ford-Fulkerson Max Flow

Find any s-t path

11

1

21

2

3

2

1

s

2

4

5

3

t

Page 6: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

7

4

2

1

1

1

12

2

1

1

1

13

Ford-Fulkerson Max Flow

11

1

1

3

2

1

s

2

4

5

3

t

Determine the capacity Δ of the path.

Send Δ units of flow in the path.Update residual capacities.

Page 7: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

8

4

2

1

1

1

12

2

1

1

1

13

Ford-Fulkerson Max Flow

11

1

1

3

2

1

s

2

4

5

3

t

Find any s-t path

Page 8: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

9

11 1

11

4

1

2

1

12

11

3

Ford-Fulkerson Max Flow

113

2

1

s

2

4

5

3

t

Determine the capacity Δ of the path.

Send Δ units of flow in the path.Update residual capacities.

Page 9: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

10

11 1

11

4

1

2

1

1

2

2

11

3

Ford-Fulkerson Max Flow

113

2

1

s

2

4

5

3

t

Find any s-t path

Page 10: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

11

1

11

2 1 1

11

4

2

2

1

1

2

21

Ford-Fulkerson Max Flow

113

1

1

s

2

4

5

3

t

2

Determine the capacity Δ of the path.

Send Δ units of flow in the path.Update residual capacities.

Page 11: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

12

11

2 1 1

11

4

2

2

1

1

2

21

Ford-Fulkerson Max Flow

113

1

1

s

2

4

5

3

t

2

Find any s-t path

Page 12: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

13

111

11

4

13

11

2 1 1

3

2

21

21

Ford-Fulkerson Max Flow

2

1s

2

4

5

3

t

2

Determine the capacity Δ of the path.

Send Δ units of flow in the path.Update residual capacities.

Page 13: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

14

111

11

4

13

11

2 1 1

3

2

21

21

Ford-Fulkerson Max Flow

2

1s

2

4

5

3

t

2

There is no s-t path in the residual network. This flow is optimal

Page 14: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

15

111

11

4

13

11

2 1 1

3

2

21

21

Ford-Fulkerson Max Flow

2

1s

2

4

5

3

t

2

These are the nodes that are reachable from node s.

s

2

4

5

3

Page 15: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

4

112

21

2

3

3

1

s

2

4

5

3

t

16

Ford-Fulkerson Max Flow

1

1

2

2

2

1

2s

2

4

5

3

t

Here is the optimal flow

Page 16: Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.

MITOpenCourseWarehttp://ocw.mit.edu

15.082J / 6.855J / ESD.78J Network OptimizationFall 2010

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.