7. Ford-Fulkerson Demo

9
Algorithm Design by Éva Tardos and Jon Kleinberg Copyright © 2005 Addison Wesley Slides by Kevin Wayne 7. Ford-Fulkerson Demo

description

7. Ford-Fulkerson Demo. Ford-Fulkerson Algorithm. 0. flow. 2. 4. 4. capacity. G:. 0. 0. 0. 6. 0. 8. 10. 10. 2. 0. 0. 0. 0. 10. s. 3. 5. t. 10. 9. Flow value = 0. 8. X. 8. X. 8. X. Ford-Fulkerson Algorithm. 0. flow. 2. 4. 4. capacity. G:. 0. 0. 0. 6. - PowerPoint PPT Presentation

Transcript of 7. Ford-Fulkerson Demo

Page 1: 7.  Ford-Fulkerson Demo

Algorithm Design by Éva Tardos and Jon Kleinberg • Copyright © 2005 Addison Wesley • Slides by Kevin Wayne

7. Ford-Fulkerson Demo

Page 2: 7.  Ford-Fulkerson Demo

2

Ford-Fulkerson Algorithm

s

2

3

4

5 t 10

10

9

8

4

10

10 6 2

0

0

0

0 0 0

0

0

G:

Flow value = 0

0

flowcapacity

Page 3: 7.  Ford-Fulkerson Demo

3

Ford-Fulkerson Algorithm

s

2

3

4

5 t 10

10

9

8

4

10

10 6 2

0

0

0

0 0 0

0

0

G:

s

2

3

4

5 t 10 9

4

10 6 2

Gf:10 8

10

8 8

8

X X

X

0

Flow value = 0

capacity

residual capacity

flow

Page 4: 7.  Ford-Fulkerson Demo

4

Ford-Fulkerson Algorithm

s

2

3

4

5 t 10

10

9

8

4

10

10 6 2

8

0

0

0 0 8

8

0 0

G:

s

2

3

4

5 t 10

4

10 6 Gf:

8

8

8

9

22

2

10

210

X

X

X2X

Flow value = 8

Page 5: 7.  Ford-Fulkerson Demo

5

0

Ford-Fulkerson Algorithm

s

2

3

4

5 t 10

10

9

8

4

10

10 6 2

10

0

0

0 2 10

8

2

G:

s

2

3

4

5 t

4

2

Gf:

10

810

2

10 7

10 6

X

66

6

X

X

8X

Flow value = 10

Page 6: 7.  Ford-Fulkerson Demo

6

Ford-Fulkerson Algorithm

s

2

3

4

5 t 10

10

9

8

4

10

10 6 2

10

0

6

6 8 10

8

2

G:

s

2

3

4

5 t1

6 Gf:

10

8 10

8

6

6

6

4

4

4

2

X

8

2

8

X

X

0X

Flow value = 16

Page 7: 7.  Ford-Fulkerson Demo

7

Ford-Fulkerson Algorithm

s

2

3

4

5 t 10

10

9

8

4

10

10 6 2

10

2

8

8 8 10

8

0

G:

s

2

3

4

5 t

6 2

Gf:

10

10

8

6

8

8

2

2 1

2

8 2

X

9

7 9

X

X

9X

X 3

Flow value = 18

Page 8: 7.  Ford-Fulkerson Demo

8

Ford-Fulkerson Algorithm

s

2

3

4

5 t 10

10

9

8

4

10

10 6 2

10

3

9

9 9 10

7

0

G:

s

2

3

4

5 t 1 9

1

1 6 2

Gf:

10

7 10

6

9

9

3

1

Flow value = 19

Page 9: 7.  Ford-Fulkerson Demo

9

Ford-Fulkerson Algorithm

s

2

3

4

5 t 10

10

9

8

4

10

10 6 2

10

3

9

9 9 10

7

0

G:

s

2

3

4

5 t 1 9

1

1 6 2

Gf:

10

7 10

6

9

9

3

1

Flow value = 19Cut capacity =

19