lecture 5 lecture 5
play

Lecture 5 Lecture 5 Previously in Opt 2 The maximum flow problem - PowerPoint PPT Presentation

Lecture 5 Lecture 5 Previously in Opt 2 The maximum flow problem Input G = (N, E), a directed graph The node set N contains: A source node, s A sink node, t u ij = edge capacity; u ij 0 Objective: To maximize


  1. Lecture 5

  2. Lecture 5 Previously in Opt 2 …

  3. The maximum ‐ flow problem • Input – G = (N, E), a directed graph – The node set N contains: • A source node, s • A sink node, t – u ij = edge capacity; u ij ≥ 0 • Objective: To maximize net flow into t, subject to constraints: – Capacity constraints – Flow conservation constraints: Net flow out of node i = 0 (for each node i in N, except s and t)

  4. The maximum ‐ flow problem • Input – G = (N, E), a directed graph – The node set N contains: • A source node, s • A sink node, t – u ij = edge capacity; u ij ≥ 0 • Objective: To maximize net flow into t, subject to constraints: – Capacity constraints – Flow conservation constraints: Total flow into i = total flow out of i (for each node i in N, except s and t)

  5. The maximum ‐ flow problem • Example: 10 A B 20 40 s t 15 20 C D 15 10

  6. The maximum ‐ flow problem • Example: 10 A B 20 0 15 0 40 15 s t 15 15 20 0 C D 0 15 10 Flow value = 15

  7. Cuts and cut capacities • Example: 10 A B 20 40 s t 15 20 C D 15 10

  8. Q1 (i>clicker)

  9. Q1: Which of the following pairs of sets (S, T) is a valid cut, and what is its corresponding cut capacity? A. S = {t, B, C}, T = {s, A, D}, capacity = 50 B. S = {s, B, C}, T = {A, t}, capacity = 70 C. S = {s, B, C}, T = {A, B, C, t}, capacity = 80 D. S = {s, B, C}, T = {A, D, t}, capacity = 70 E. S = {s, B, C}, T = {A, D, t}, 10 A B 20 capacity = 80 40 s t 15 20 C D 15 10

  10. Q1: Which of the following pairs of sets (S, T) is a valid cut, and what is its corresponding cut capacity? A. S = {t, B, C}, T = {s, A, D}, capacity = 50 B. S = {s, B, C}, T = {A, t}, capacity = 70 C. S = {s, B, C}, T = {A, B, C, t}, capacity = 80 D. S = {s, B, C}, T = {A, D, t}, capacity = 70 E. S = {s, B, C}, T = {A, D, t}, 10 A B 20 capacity = 80 40 s t 15 20 S C D 15 10

  11. Q1: Which of the following pairs of sets (S, T) is a valid cut, and what is its corresponding cut capacity? A. S = {t, B, C}, T = {s, A, D}, capacity = 50 B. S = {s, B, C}, T = {A, t}, capacity = 70 C. E = {s, B, C}, T = {A, B, C, t}, capacity = 80 D. S = {s, B, C}, T = {A, D, t}, capacity = 70 E. S = {s, B, C}, T = {A, D, t}, 10 A B 20 capacity = 80 40 s t 15 20 S C D 15 10

  12. 10 A B 20 40 s t 15 20 S C D 15 10

  13. The maximum ‐ flow problem and capacities of cuts Claim 1 The value of any feasible flow is less than or equal to the capacity of any cut Claim 2 The maximum flow value is less than or equal to the capacity of any cut

  14. Today: Maxflow, continued More on cuts, flows, and Ford ‐ Fulkerson’s algorithm

  15. The maximum ‐ flow and the minimum ‐ cut problems Theorem 1 Consider a maxflow problem with input G = (N, E) and capacities u ij for each (i, j) in E. If x* is a feasible flow and (S, T) is a valid cut with the property that the value of flow of x* = capacity of the cut (S, T), then x* is a maximum flow.

  16. The maximum ‐ flow problem and capacities of cuts Claim 1 The value of any feasible flow is less than or equal to the capacity of any cut Claim 2 The maximum flow value is less than or equal to the capacity of any cut

  17. The maximum ‐ flow problem and capacities of cuts Claim 1 The value of any feasible flow is less than or equal to the capacity of any cut Claim 2’ The maximum flow value is less than or equal to the smallest cut capacity

  18. The minimum ‐ cut problem • Input – G = (N, E), a directed graph – The node set N contains: • A source node, s • A sink node, t – u ij = edge capacity; u ij ≥ 0 • Objective: To find a cut with minimum cut capacity. – A cut: A partition of N into sets (S, T), where S contains the source and T contains the sink – Capacity of the cut (S, T) is the sum of capacities of edges that go from S to T: ∑ u ij ∈ ( i , j ) E, s.t. ∈ ∈ , i S j T

  19. The maximum ‐ flow and the minimum ‐ cut problems Maxflow Mincut Input Input • • G = (N, E), a directed graph G = (N, E), a directed graph – – – The node set N contains: – The node set N contains: • A source node, s • A source node, s • A sink node, t • A sink node, t u ij = edge capacity; u ij ≥ 0 u ij = edge capacity; u ij ≥ 0 – – Objective: Objective: To find a cut with • • To maximize net flow into t, minimum cut capacity. subject to constraints: – A cut: A partition of N into sets (S, T), where S contains the – Capacity constraints source and T contains the sink – Flow conservation constraints: – Capacity of the cut (S, T) is Net flow out of node i = 0 the sum of capacities of edges (for each node i in N, except s and t) that go from S to T: ∑ u ij ∈ ( i , j ) E, s.t. ∈ ∈ i S , j T

  20. The maximum ‐ flow and the minimum ‐ cut problems Claim 2’ The maximum flow value is less than or equal to the minimum cut capacity

  21. The maximum ‐ flow and the minimum ‐ cut problems Theorem 2 The maximum flow value is equal to the minimum cut capacity

  22. The maxflow ‐ mincut theorem Theorem 2 The maximum flow value is equal to the minimum cut capacity Proof. …

  23. The Ford ‐ Fulkerson method 0. Find an initial feasible solution (flow) 1. Consider the current solution, x. 2. If x is not optimal, then find a way to improve the flow. Otherwise, if x is optimal, we’re done!

  24. The Ford ‐ Fulkerson method 0. Find an initial feasible solution (flow) 1. Consider the current solution, x. 2. If x is not optimal, then find a way to improve the flow. Otherwise, if x is optimal, we’re done!

  25. Example: An initial feasible flow 10 A B 20 0 15 0 40 15 s t 15 15 20 0 C D 0 15 10

  26. The Ford ‐ Fulkerson method 0. Find an initial feasible solution (flow) 1. Consider the current solution, x. 2. If x is not optimal, then find a way to improve the flow. Otherwise, if x is optimal, we’re done!

  27. The Ford ‐ Fulkerson method 0. Find an initial feasible solution (flow) 1. Consider the current solution, x. 2. If x is not optimal, then find a way to improve the flow. Otherwise, if x is optimal, we’re done!

  28. Finding a way to improve flow Current solution, x (1) Scratchwork graph for x (1) 10 10 A B A B 20 20 0 15 0 40 40 15 s t s t 15 15 20 15 20 0 C D C D 0 15 15 10 10 Flow value = 15

  29. Finding a way to improve flow Current solution, x (1) Scratchwork graph for x (1) 10 10 A B A B 20 20 0 0 15 15 0 0 40 40 15 15 s t s t 15 15 20 15 15 20 0 0 C D C D 0 15 0 15 10 10 Flow value = 15

  30. Finding a way to improve flow Current solution, x (1) Scratchwork graph for x (1) 10 10 A B A B 20 5 0 15 0 40 40 15 s t s t 15 15 20 0 5 0 C D C D 0 15 15 10 10 Flow value = 15

  31. Finding a way to improve flow Current solution, x (1) Scratchwork graph for x (1) 10 10 A B A B 5 20 5 0 15 5 5 0 40 40 15 s t s t 15 15 20 0 5 0 C D C D 0 15 15 10 10 Flow value = 15

  32. Finding a way to improve flow Updated solution, x (2) Scratchwork graph for x (1) 10 10 A B A B 5 20 5 5 20 5 5 5 40 40 15 s t s t 15 15 20 0 5 0 C D C D 0 15 15 10 10 Flow value = 20 An augmenting path of capacity 5!

  33. One more iteration to improve flow? Current solution, x (2) Scratchwork graph for x (2) 10 5 A B A B 20 0 5 20 5 40 35 15 s t s t 15 15 20 0 5 0 C D C D 0 15 15 10 10 Flow value = 20

  34. One more iteration to improve flow? Current solution, x (2) Scratchwork graph for x (2) 10 5 A B A B 20 0 5 20 5 40 35 15 s t s t 15 15 20 0 5 0 C D C D 0 15 15 10 10 No way to improve the current solution? Flow value = 20 Is x (2) an optimal flow?

  35. Nope! A better flow: 10 A B 20 10 20 10 40 10 s t 15 15 20 5 C D 5 15 10 Flow value = 25

  36. Finding a way to improve flow Current solution, x (2) Scratchwork graph for x (2) 10 5 A B A B 20 0 5 20 5 40 35 15 s t s t 15 15 20 0 5 0 C D C D 0 15 15 10 10 Flow value = 20

  37. Finding a way to improve flow, v.2! By building a Residual Graph Current solution, x (2) Residual graph for x (2) , G x(2) 10 5 A B A B 20 0 5 20 5 40 35 15 s t s t 15 15 15 20 0 5 0 C D C D 0 15 15 10 10 Flow value = 20

  38. Building a Residual Graph Current solution, x (2) Residual graph for x (2) , G x(2) 5 10 20 A B A B 20 5 5 0 20 5 40 35 5 15 s t s t 0 15 15 15 20 5 0 C D C D 15 0 15 15 10 10 Flow value = 20

  39. Building a Residual Graph Current solution, x (2) Residual graph for x (2) , G x(2) 5 10 20 A B A B 20 5 5 20 5 40 35 5 15 s t s t 15 15 15 20 5 0 C D C D 15 0 15 15 10 10 Flow value = 20

  40. Building a Residual Graph Current solution, x (2) Residual graph for x (2) , G x(2) 5 10 20 A B A B 20 5 5 20 5 40 35 5 15 s t s t 15 15 15 20 5 0 C D C D 15 0 15 15 10 10 Flow value = 20

  41. Then, finding an augmenting path in the residual graph Current solution, x (2) Residual graph for x (2) , G x(2) 5 10 20 A B A B 20 5 5 20 5 40 35 5 15 s t s t 15 15 15 20 5 0 C D C D 15 0 15 15 10 10 Flow value = 20 An augmenting path!

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend