1. Trang chủ
  2. » Giáo án - Bài giảng

Tài liệu Max Flow

71 299 1

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

Algorithms, 4 th Edition · Robert Sedgewick and Kevin Wayne · Copyright © 2002–2012 · April 8, 2012 5:24:49 AM Algorithms FOUR T H EDIT ION R O B E R T S EDG EWICK K EVIN W A Y N E 6.4 M AXIMUM F LOW ‣ overview ‣ Ford-Fulkerson algorithm ‣ analysis ‣ Java implementation ‣ applications 2 ‣ overview ‣ Ford-Fulkerson algorithm ‣ analysis ‣ Java implementation ‣ applications Input. A weighted digraph, source vertex s, and target vertex t. Mincut problem 3 5 s t 15 10 15 16 9 15 6 8 10 154 4 10 10 each edge has a positive capacity capacity Def. A st-cut (cut) is a partition of the vertices into two disjoint sets, with s in one set A and t in the other set B. Def. Its capacity is the sum of the capacities of the edges from A to B. Mincut problem 4 5 s capacity = 10 + 5 + 15 = 30 15 10 t Def. A st-cut (cut) is a partition of the vertices into two disjoint sets, with s in one set A and t in the other set B. Def. Its capacity is the sum of the capacities of the edges from A to B. 10 Mincut problem 5 8 don't count edges from B to A t 16 capacity = 10 + 8 + 16 = 34 s Def. A st-cut (cut) is a partition of the vertices into two disjoint sets, with s in one set A and t in the other set B. Def. Its capacity is the sum of the capacities of the edges from A to B. Minimum st-cut (mincut) problem. Find a cut of minimum capacity. 10 Mincut problem 6 s 10 t capacity = 10 + 8 + 10 = 28 8 "Free world" goal. Cut supplies (if cold war turns into real war). Figure 2 From Harris and Ross [1955]: Schematic diagram of the railway network of the Western So- viet Union and Eastern European countries, with a maximum flow of value 163,000 tons from Russia to Eastern Europe, and a cut of capacity 163,000 tons indicated as ‘The bottleneck’. Mincut application (1950s) 7 rail network connecting Soviet Union with Eastern European countries (map declassified by Pentagon in 1999) Potential mincut application (2010s) Government-in-power’s goal. Cut off communication to specified set of people. 8 Input. A weighted digraph, source vertex s, and target vertex t. Maxflow problem 9 each edge has a positive capacity 4 4 15 10 105 s t 6 10 9 8 15 10 15 16 15 capacity Def. An st-flow (flow) is an assignment of values to the edges such that: • Capacity constraint: 0 ≤ edge's flow ≤ edge's capacity. • Local equilibrium: inflow = outflow at every vertex (except s and t). 10 Maxflow problem 0 / 4 0 / 4 0 / 15 10 / 10 10 / 105 / 5 v s t 0 / 6 5 / 10 5 / 9 5 / 8 5 / 15 10 / 10 10 / 15 10 / 16 inflow at v = 5 + 5 + 0 = 10 outflow at v = 10 + 0 = 10 flow capacity 0 / 15 [...]... to f Can improve flow f by sending flow along this path Thus, f is not a maxflow 31 Maxflow-mincut theorem Augmenting path theorem A flow f is a maxflow iff no augmenting paths Maxflow-mincut theorem Value of the maxflow = capacity of mincut Pf The following three conditions are equivalent for any flow f : i There exists a cut whose capacity equals the value of the flow f ii f is a maxflow iii There... value of any flow f ' ≤ capacity of (A, B) = value of f Thus, f is a maxflow weak duality 30 Maxflow-mincut theorem Augmenting path theorem A flow f is a maxflow iff no augmenting paths Maxflow-mincut theorem Value of the maxflow = capacity of mincut Pf The following three conditions are equivalent for any flow f : i There exists a cut whose capacity equals the value of the flow f ii f is a maxflow iii... 10 / t value = 5 + 10 + 10 = 25 10 10 / 16 11 Maxflow problem Def An st -flow (flow) is an assignment of values to the edges such that: • • Capacity constraint: 0 ≤ edge's flow ≤ edge's capacity Local equilibrium: inflow = outflow at every vertex (except s and t) Def The value of a flow is the inflow at t Maximum st -flow (maxflow) problem Find a flow of maximum value 8/9 10 s / 10 2 0/4 / 15 5 0 / 15... / 16 value of flow = 27 capacity of cut = 30 29 Maxflow-mincut theorem Augmenting path theorem A flow f is a maxflow iff no augmenting paths Maxflow-mincut theorem Value of the maxflow = capacity of mincut Pf The following three conditions are equivalent for any flow f : i There exists a cut whose capacity equals the value of the flow f ii f is a maxflow iii There is no augmenting path with respect...Maxflow problem Def An st -flow (flow) is an assignment of values to the edges such that: • • Capacity constraint: 0 ≤ edge's flow ≤ edge's capacity Local equilibrium: inflow = outflow at every vertex (except s and t) Def The value of a flow is the inflow at t we assume no edge points from s or to t 5/9 10 s / 10 5 0/4 / 15 5... maxflow application (2010s) "Free world" goal Maximize flow of information to specified set of people facebook graph 14 Summary Input A weighted digraph, source vertex s, and target vertex t Mincut problem Find a cut of minimum capacity Maxflow problem Find a flow of maximum value 8/9 2 10 s / 10 0/4 / 15 5 0 / 15 8/8 5/5 13 8 /1 0/4 3 /6 / 10 10 / 10 0 / 15 10 / 10 t s t 8 10 10 13 / 16 value of flow. .. value of flow 28 Relationship between flows and cuts Weak duality Let f be any flow and let (A, B) be any cut Then, the value of the flow ≤ the capacity of the cut Pf Value of flow f = net flow across cut (A, B) ≤ capacity of cut (A, B) flow bounded by capacity flow value lemma 8/9 2 10 s / 10 0/4 / 15 5 0 / 15 0/4 2 /6 / 10 9 / 10 7/8 5/5 12 8 /1 0 / 15 10 / 10 10 t s t 5 15 12 / 16 value of flow =... be any flow and let (A, B) be any cut Then, the net flow across (A, B) equals the value of f net flow across cut = 10 + 5 + 10 = 25 5/9 10 s / 10 5 0/4 / 15 5 0 / 15 5/8 5/5 10 /1 0/4 0 /6 5 / 10 10 / 10 0 / 15 10 / t value of flow = 25 10 10 / 16 26 Relationship between flows and cuts Def The net flow across a cut (A, B) is the sum of the flows on its edges from A to B minus the sum of the flows on... (A, B) be any cut Then, the net flow across (A, B) equals the value of f net flow across cut = 5 + 10 + 10 = 25 5/9 10 s / 10 5 0/4 / 15 5 0 / 15 5/8 5/5 10 /1 0/4 0 /6 5 / 10 10 / 10 0 / 15 10 / t value of flow = 25 10 10 / 16 25 Relationship between flows and cuts Def The net flow across a cut (A, B) is the sum of the flows on its edges from A to B minus the sum of the flows on its edges from from B... always compute a maxflow? Does FF always terminate? If so, after how many augmentations? 23 ‣ ‣ ‣ ‣ ‣ overview Ford-Fulkerson algorithm analysis Java implementation applications 24 Relationship between flows and cuts Def The net flow across a cut (A, B) is the sum of the flows on its edges from A to B minus the sum of the flows on its edges from from B to A Proposition Let f be any flow and let (A, . equilibrium: inflow = outflow at every vertex (except s and t). Def. The value of a flow is the inflow at t. Maximum st -flow (maxflow) problem. Find a flow of maximum. 10 10 / 15 10 / 16 inflow at v = 5 + 5 + 0 = 10 outflow at v = 10 + 0 = 10 flow capacity 0 / 15 11 Maxflow problem Def. An st -flow (flow) is an assignment

Ngày đăng: 25/12/2013, 10:48

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN