augmenting paths
play

Augmenting Paths Math 482, Lecture 25 Misha Lavrov April 3, 2020 - PowerPoint PPT Presentation

The greedy algorithm Augmenting paths The residual graph Augmenting Paths Math 482, Lecture 25 Misha Lavrov April 3, 2020 The greedy algorithm Augmenting paths The residual graph Lecture plan We know how to find a max flow using an LP.


  1. The greedy algorithm Augmenting paths The residual graph Augmenting Paths Math 482, Lecture 25 Misha Lavrov April 3, 2020

  2. The greedy algorithm Augmenting paths The residual graph Lecture plan We know how to find a max flow using an LP. But this is inefficient; there are many many algorithms that are faster.

  3. The greedy algorithm Augmenting paths The residual graph Lecture plan We know how to find a max flow using an LP. But this is inefficient; there are many many algorithms that are faster. Plan for today: 1 Describe a simple greedy algorithm that tries to find a max flow.

  4. The greedy algorithm Augmenting paths The residual graph Lecture plan We know how to find a max flow using an LP. But this is inefficient; there are many many algorithms that are faster. Plan for today: 1 Describe a simple greedy algorithm that tries to find a max flow. 2 See it get stuck.

  5. The greedy algorithm Augmenting paths The residual graph Lecture plan We know how to find a max flow using an LP. But this is inefficient; there are many many algorithms that are faster. Plan for today: 1 Describe a simple greedy algorithm that tries to find a max flow. 2 See it get stuck. 3 Make the algorithm more powerful.

  6. The greedy algorithm Augmenting paths The residual graph Directed s , t -paths Definition In a network, a directed path from s to t is a sequence s , v 1 , v 2 , . . . , v k , t where v 1 , v 2 , . . . , v k ∈ N and ( s , v 1 ) , ( v 1 , v 2 ) , . . . , ( v k , t ) ∈ A .

  7. The greedy algorithm Augmenting paths The residual graph Directed s , t -paths Definition In a network, a directed path from s to t is a sequence s → v 1 → v 2 · · · → v k → t where v 1 , v 2 , . . . , v k ∈ N and ( s , v 1 ) , ( v 1 , v 2 ) , . . . , ( v k , t ) ∈ A .

  8. The greedy algorithm Augmenting paths The residual graph Directed s , t -paths Definition In a network, a directed path from s to t is a sequence s → v 1 → v 2 · · · → v k → t where v 1 , v 2 , . . . , v k ∈ N and ( s , v 1 ) , ( v 1 , v 2 ) , . . . , ( v k , t ) ∈ A . Example: a 0 / 10 b 0 / 10 0 / 12 0 / 4 s t 0 / 4 0 / 10 0 / 8 c 0 / 4 d

  9. The greedy algorithm Augmenting paths The residual graph Directed s , t -paths Definition In a network, a directed path from s to t is a sequence s → v 1 → v 2 · · · → v k → t where v 1 , v 2 , . . . , v k ∈ N and ( s , v 1 ) , ( v 1 , v 2 ) , . . . , ( v k , t ) ∈ A . Example: directed path s → a → b → t a 0 / 10 b 0 / 10 0 / 12 0 / 4 s t 0 / 4 0 / 10 0 / 8 c 0 / 4 d

  10. The greedy algorithm Augmenting paths The residual graph Using a directed path Whenever we have a directed path from s to t and all arcs along the path are below capacity, we can use it to increase the flow. a 0 / 10 b 0 / 10 0 / 12 0 / 4 s t 0 / 4 0 / 10 0 / 8 c 0 / 4 d

  11. The greedy algorithm Augmenting paths The residual graph Using a directed path Whenever we have a directed path from s to t and all arcs along the path are below capacity, we can use it to increase the flow. a 0 / 10 b 0 / 10 0 / 12 0 / 4 s t 0 / 4 0 / 10 0 / 8 c 0 / 4 d

  12. The greedy algorithm Augmenting paths The residual graph Using a directed path Whenever we have a directed path from s to t and all arcs along the path are below capacity, we can use it to increase the flow. a 10 / 10 b 10 / 10 10 / 12 0 / 4 s t 0 / 4 0 / 10 0 / 8 c 0 / 4 d

  13. The greedy algorithm Augmenting paths The residual graph Using a directed path Whenever we have a directed path from s to t and all arcs along the path are below capacity, we can use it to increase the flow. a 10 / 10 b 10 / 10 10 / 12 0 / 4 s t 0 / 4 0 / 10 0 / 8 c 0 / 4 d

  14. The greedy algorithm Augmenting paths The residual graph Using a directed path Whenever we have a directed path from s to t and all arcs along the path are below capacity, we can use it to increase the flow. a 10 / 10 b 10 / 10 10 / 12 0 / 4 s t 0 / 4 0 / 10 0 / 8 c 0 / 4 d

  15. The greedy algorithm Augmenting paths The residual graph Using a directed path Whenever we have a directed path from s to t and all arcs along the path are below capacity, we can use it to increase the flow. a 10 / 10 b 10 / 10 10 / 12 0 / 4 s t 0 / 4 4 / 10 4 / 8 c 4 / 4 d

  16. The greedy algorithm Augmenting paths The residual graph Using a directed path Whenever we have a directed path from s to t and all arcs along the path are below capacity, we can use it to increase the flow. a 10 / 10 b 10 / 10 10 / 12 0 / 4 s t 0 / 4 4 / 10 4 / 8 c 4 / 4 d

  17. The greedy algorithm Augmenting paths The residual graph Using a directed path Whenever we have a directed path from s to t and all arcs along the path are below capacity, we can use it to increase the flow. a 10 / 10 b 10 / 10 10 / 12 0 / 4 s t 0 / 4 4 / 10 4 / 8 c 4 / 4 d

  18. The greedy algorithm Augmenting paths The residual graph Using a directed path Whenever we have a directed path from s to t and all arcs along the path are below capacity, we can use it to increase the flow. a 10 / 10 b 10 / 10 12 / 12 0 / 4 s t 2 / 4 6 / 10 4 / 8 c 4 / 4 d

  19. The greedy algorithm Augmenting paths The residual graph Using a directed path Whenever we have a directed path from s to t and all arcs along the path are below capacity, we can use it to increase the flow. a 10 / 10 b 10 / 10 12 / 12 0 / 4 s t 2 / 4 6 / 10 4 / 8 c 4 / 4 d At this point, there are no more directed paths where all arcs are below capacity. But is this the maximum flow?

  20. The greedy algorithm Augmenting paths The residual graph A further improvement If we redirect some a → b → t flow to go a → d → t , we can send more flow along the path s → c → d → t . . . a 10 / 10 b 10 / 10 12 / 12 0 / 4 s t 2 / 4 6 / 10 4 / 8 c 4 / 4 d

  21. The greedy algorithm Augmenting paths The residual graph A further improvement If we redirect some a → b → t flow to go a → d → t , we can send more flow along the path s → c → d → t . . . a 10 / 10 b 10 / 10 12 / 12 0 / 4 s t 2 / 4 6 / 10 4 / 8 c 4 / 4 d Increase flow along red edges, decrease flow along blue edge.

  22. The greedy algorithm Augmenting paths The residual graph A further improvement If we redirect some a → b → t flow to go a → d → t , we can send more flow along the path s → c → d → t . . . a 10 / 10 b 10 / 10 12 / 12 0 / 4 s t 2 / 4 6 / 10 4 / 8 c 4 / 4 d Increase flow along red edges, decrease flow along blue edge. Note: s → c → b ← a → d → t is almost a directed path.

  23. The greedy algorithm Augmenting paths The residual graph Augmenting paths Definition Given a network ( N , A ) and a feasible flow x , an augmenting path for x is a sequence of nodes s = v 0 , v 1 , v 2 , . . . , v k , v k +1 = t such that for each pair v i , v i +1 : either e = ( v i , v i +1 ) is an arc below capacity ( e ∈ A and x e < c e )

  24. The greedy algorithm Augmenting paths The residual graph Augmenting paths Definition Given a network ( N , A ) and a feasible flow x , an augmenting path for x is a sequence of nodes s = v 0 , v 1 , v 2 , . . . , v k , v k +1 = t such that for each pair v i , v i +1 : either e = ( v i , v i +1 ) is an arc below capacity ( e ∈ A and x e < c e ) or e = ( v i +1 , v i ) is an arc with positive flow ( e ∈ A and x e > 0).

  25. The greedy algorithm Augmenting paths The residual graph Augmenting paths Definition Given a network ( N , A ) and a feasible flow x , an augmenting path for x is a sequence of nodes s = v 0 , v 1 , v 2 , . . . , v k , v k +1 = t such that for each pair v i , v i +1 : either e = ( v i , v i +1 ) is an arc below capacity ( e ∈ A and x e < c e ) or e = ( v i +1 , v i ) is an arc with positive flow ( e ∈ A and x e > 0). The sequence s → c → b ← a → d → t we found on the previous slide was an augmenting path.

  26. The greedy algorithm Augmenting paths The residual graph Using an augmenting path to improve x To augment a feasible flow x along an augmenting path: 1 Let δ > 0 be the largest value such that x e ≤ c e − δ for all forward arcs on the path; x e ≥ δ for all backward arcs on the path.

  27. The greedy algorithm Augmenting paths The residual graph Using an augmenting path to improve x To augment a feasible flow x along an augmenting path: 1 Let δ > 0 be the largest value such that x e ≤ c e − δ for all forward arcs on the path; x e ≥ δ for all backward arcs on the path. 2 For each forward arc e , increase x e by δ .

  28. The greedy algorithm Augmenting paths The residual graph Using an augmenting path to improve x To augment a feasible flow x along an augmenting path: 1 Let δ > 0 be the largest value such that x e ≤ c e − δ for all forward arcs on the path; x e ≥ δ for all backward arcs on the path. 2 For each forward arc e , increase x e by δ . 3 For each backward arc e , decrease x e by δ .

Recommend


More recommend