Maximum Flow. Reading: CLRS Chapter 26. CSE 6331 Algorithms Steve Lai

Size: px
Start display at page:

Download "Maximum Flow. Reading: CLRS Chapter 26. CSE 6331 Algorithms Steve Lai"

Transcription

1 Maximum Flow Reading: CLRS Chapter 26. CSE 6331 Algorithms Steve Lai

2 Flow Network A low network G ( V, E) is a directed graph with a source node sv, a sink node tv, a capacity unction c. Each edge ( u, v) E has a nonnegative capacity c( u, v) 0. I ( u, v) E, assume c( u, v) 0. Also, assume that every node v is on some path rom s to t. This implies O( V E) O( E). A maxlow may only go through such nodes. 2

3 Flow Let G ( V, E) be a low network with capacity unction c, source node s, and sink node t. A low is a real-valued unction : V V satisying Capacity constraint: u, v V, ( u, v) c( u, v). Skew symmetry: u, v V, ( u, v) ( v, u). Flow conservation: u V { s, t}, ( u, V ) ( u, v) 0 The value o a low is ( s, V) ( s, v). The vv maxlow problem is to ind a low o maximum value. vv 3

4 Some Properties o Flows I no edge between u and v, then ( u, v) ( v, u) 0. Flow conservation implies: u V { s, t}, Total positive low into u Total positive low out o u. For X, Y V, deine ( X, Y ) ( x, y). ( X, X ) 0. ( X, Y ) ( Y, X ). xx yy ( X Y, Z) ( X, Z) ( Y, Z), i X Y. ( Z, X Y ) ( Z, X ) ( Z, Y ), i X Y. 4

5 Residual networks and augmenting paths Let G ( V, E) be a low network and a low. Residual capacity o ( uv, ) is c ( u, v) c( u, v) ( u, v). Residual network induced by is G ( V, E ), where E ( u, v) V V : c ( u, v) 0. Augmenting path: a simple path p rom s to t in G. Residual capacity o p : c ( p) min c ( u, v) : ( u, v) is in p. 5

6 10 1/4 7/ /4 7/ Example s a c 12/12 11/14 b d t s a c b d t (a) Flow network and low (b) Residual network and augmenting path p with c ( p) 4 s a c 12/12 11/14 b d t s a c b d t (c) Augmented low (d) No augmenting path 6

7 Flow: an alternative deini tion (CLRS, 3rd ed.) Let G ( V, E) be a low network with a capacity unction c, source s, and i.e., sink t. Assume G i ( uv, ) E then ( v, u) E. has no parallel edges, A low is a real-valued unction : V V R, satisying Capacity constraint: u, v V, 0 ( u, v) c( u, v). Flow conservation: u V { s, t}, ( v, u) ( u, v) i.e. V, u u, V vv vv V s The value o a low is s, V,. Note: when ( u, v) E, ( u, v) 0. 7

8 Some o these properties do not hold any more (when using the second deinition o lows) I no edge between u and v, then ( u, v) ( v, u) 0. Flow conservation implies: u V { s, t}, Total positive low into u Total positive low out o u. For X, Y V, deine ( X, Y ) ( x, y). ( X, X ) 0. ( X, Y ) ( Y, X ). xx yy ( X Y, Z) ( X, Z) ( Y, Z), i X Y. ( Z, X Y ) ( Z, X ) ( Z, Y ), i X Y. 8

9 Residual networks and augmenting paths (using the second deinition o lows) Let G ( V, E) be a low network and a low. Residual capacity o ( uv, ) is c( u, v) ( u, v) i ( u, v) E c ( u, v) ( v, u) i ( v, u) E 0 otherwise Residual network induced by is G ( V, E ), where E ( u, v) V V : c ( u, v) 0. Augmenting path: a simple path p rom s to t in G. 9

10 Ford-Fulkerson Method Given a low network G ( V, E) with source s and sink t, Initialize low to 0 while there exists an augmenting path p do do augment low along p return 10

11 Ford-Fulkerson G, s, t or each edge ( u, v) E( G) do ( u, v) 0 ( v, u) 0 while there exists an augmenting path p in residual network G do c ( p) min c ( u, v) : ( u, v) is on p or each edge ( u, v) is in p do ( u, v) ( u, v) c ( p) ( v, u) ( u, v) 11

12 Analysis The running time depends on how the augmenting path p is determined. I capacities are integers, the running time is O E, where Each iteration can There are at most Integrality Theorem. is the value o the maxlow. be done in O E iterations. time. I all capacities are integers, the low produced by the Ford-Fulkerson method has the property that ( u, v) is an integer or all u, v V. 12

13 Lemma 1. Let G be the residual network induced by low. Let be a low in G. Then is a low in G with Proo. Skew symmetry:. ( u, v) ( u, v) ( u, v) Capacity constraint: ( v, u) ( v, u) ( vu, ) ( u, v) ( u, v) ( u, v) ( u, v) c ( u, v) ( u, v) c( u, v) ( u, v) c( u, v) 13

14 Flow conservation: or all u V s, t, Finally, ( u, V ) ( u, V ) ( u, V ) ( s, V ) ( s, V ) ( s, V ) 14

15 Lemma 2. I p is an augmenting path in G, then augmenting along p yields a low in G with value c ( p). Corollary 3. The produced by Ford-Fulkerson is a lo w. 15

16 10 1/4 7/7 Cuts A cut S, T o a low network G ( V, E) is a partition o o V into S and T V S such that s S and t T. I is a low, ( S, T ) denotes the net low across the cut ( S, T ). The capacity o ( ST, ) is c( S, T ) c( u, v). us vt Example: c( S, T ) c( a, b) c( c, d) ( S, T) ( a, b) ( c, d) ( c, b) a 12/12 b s S c 11/14 d t T 16

17 Lemma 4. For any cut ( S, T ), ( S, T ). Proo. Note that ( u, V ) 0 u s, t. ( S, T ) ( S, V ) ( S, S) ( S, V ) ( s, V ) ( S s, V ) ( s, V ) Corollary 5. c( S, T ). Proo. ( S, T ) c( S, T ). 17

18 The Max-low Min-cut Theorem. Theorem. The ollowing conditions are equivalent: 1. is a maxlow in G. 2. The residual network G contains no augmenting paths. 3. c( S, T ) or some cut ( S, T ) in G. //minimum cut// Proo. (3) (1): Immediately ollows rom Corollary 5. (1) (2): Immediately ollows rom Lemma 2. (I G contains an augmenting path p, augmenting along p increase the low.) will 18

19 2. The residual network G contains no augmenting paths. 3. c( S, T ) or some cut ( S, T ) in G. (2) (3): Suppose G contains no augmenting path. Deine S v : there is a path rom s to v in G, T V S. ( ST, ) is a cut since s S and t T (no path rom s to t in G ). For all u S, v T, we have ( u, v) c( u, v), since otherwise ( u, v) E and v would be in S. So, By Lemma 4, ( S, T ) c( S, T ). ( S, T ) c( S, T ). 19

20 Edmonds-Karp Algorithm In the while loop o Ford-Fulkerson, ind the augmenting path p with a breadth-irst search, that is, the augmenting path is a shortest path rom s to t in the residual network, where "shortest" is in terms o number o edges. 2 Running time: O VE (to be shown ). 20

21 Analysis o the Edmonds-Karp Algorithm Lemm a 6. In the execution o Edmonds-Karp algorithm, or all v s, t, ( v) is nondecreasing with each low augmentation where ( v) shortest distance (# edges) rom s to v in G. Proo. By contradiction. Assume the lemma is not true. Consider the irst augmentation that decreases some ( ). Let and be the lows just beore and ater the augmentation. Let v be the vertex s.t. ( v) ( v) and ( v) is minimum among those nodes x with ( x) ( x). Let p be a shortest path rom s to v in G, and let ( u, v) be the last edge o p. So, ( u, v) E, ( u) 1 ( v), an d ( u) ( u). 21

22 Case 1: ( u, v) E. Then, ( u) 1 ( v), and then ( v) ( u) 1 ( u) 1 ( v) ( v), a contradiction. Case 2: ( u, v) E. Now, ( u, v) E, but ( u, v) E. This means, the augmenting path contains edge ( vu, ). As Edmonds-Karp always augments low along shortest paths, ( v, u) is the last edge o a shortest path rom s to u in G. Thereore, ( u) ( v) 1 ( u) 1 ( v). As in case 1, this will lead to a contrdiction. 22

23 ( ) decreases or red nodes; does not decrease or green nodes. v : the red node closest to s in G. u : predecessor o v on shortest path s to v in G ; a green node. G s st augmentation G s u v st 23

24 I edge ( u, v) exists in G G s u v st ( u) 1 ( v) G s u v st ( u) 1 ( v) 24

25 I edge ( u, v) does not exist in G G s u v st augmenting path ( u) 1 ( v) G s u v st ( u) 1 ( v) 25

26 Theorem 7. I Edmonds-Karp Algorithm runs on G V, E, then the total number o low augmentations is 2 and hence the total running time is O VE. O VE Proo. An edge ( u, v) in G is criticl a on an augmenting path p i c ( p) c ( u, v). Every augmenting path has a critical edge. An edge ( u, v) may become critical only i ( u, v) E or ( v, u) E. So there are at most 2 E edges that may become critical during the algorithm's execution. We will show that each o these edges may become critical at most V 2 times, which will imply that during the execution o the Edmonds-Karp algorithm there are at most O VE augmentations. 26

27 Claim: an edge ( u, v) can become critical at most When ( u, v) becomes critical in a residual network G, ( v) ( u) 1. (1) Ater low augmentation along the augmenting path, ( uv, ) disappears rom the residual network. V 2 times. It may reappear later on another augmenting path only ater ( u, v) decreases, which occurs only i edge ( vu, ) appears on an augmenting path in some ( u) ( v) 1 ( v) 1 by Lemma 6 G ( u) 2 by (1)., in which case, 27

28 Thus, i ( uv, ) becomes critical more than once, then or each additional time ( u, v) becomes critical, ( u) increases by at least 2. When ( u, v) becomes critical or the last time, ( u) V 2. Thus, ( u, v) can become critical no more than This proves the claim and the theorem. V 2 times. 28

29 Networks with multiple sources and sinks G V, E : low network with m sources: s, s,, s n sinks: t, t,, t m m s s1 s2 s1 G t1 t2 t3 t 29

30 Maximum Bipartite Matching G V, E : undirected graph Bipartite graph: i V can be partitioned into L and R such that all edges in E go between L and R. Theorem: G is bipartite i it has no cycles o odd length. Matching: a set o edges M V is an endpoint o at most one edge in M. such that every vertex in Maximum matching: a matching with the max cardinality. A maximum matching o a bipartite graph can be ound using the Ford-Fulkerson method. E 30

31 Edge-Disjoint Paths G V, E : a graph Edge-disjoint paths: two paths are edge-disjoint i they do not share any edges. Problem: Given a directed graph G V, E and two nodes s, t, ind a maximum number o edge-disjoint paths rom s to t. Problem: Given an undirectd e graph G V, E and two nodes s, t, ind a maximum number o edge-disjoint paths rom s to t. 31

32 Node-Disjoint Paths G V, E : a graph Node-disjoint paths: two paths rom s to t are node-disjoint i they do not share any intermediate nodes. Problem: Given a di rect ed graph G V, E and two nodes s, t, ind a maximum number o node-disjoint paths rom s to t. Problem: Given an undirected graph G V, E and two nodes s, t, ind a maximum number o node-disjoint paths ro m s to t. 32

33 Image Segmentation A undamental problem in computer vision. Given a digital image (a set o pixels), we want to partition it into multiple segments. In a simple case, we just want to divide the image into two segments: the oreground and the background. Represent the image by an undirected graph G ( V, E), where V is the set o pixels and there is an edge between two pixels i there are neighbors. 33

34 34

35 Each pixel i has a likelihood (goodness) a 0 to belong to the oreground and a likelihood b background. 0 to belong to the Each edge ( i, j) E is associated with a separation penalty p ij i p 0, which is incurred i pixels i and j ji are placed in dierent segments. i 35

36 Proble m: Given a pixel graph G ( V, E), likelihood unctions a, b : E and penalty unction p : E, we want to partition V into two sets A and B and maximize Q( A, B) ai bi pij :( i, j) E, i, j in dierent segments ia ib Or, equivalently, minimize Q( A, B) ai bi Q( A, B) iv iv a b p : ( i, j) E, i, j in dierent segments ib i i ij ia 36

37 We can solve the image segmentation problem by converting it to a low network. Let G ( V, E) be the pixel graph. Introduce two new vertices: a source s and a sink t. Connect s to each pixel i V with capacity a. Connect t rom each pixel i V with capacity b. Replace each edge ( i, j) E with two directed edges ( i, j) and ( j, i) with capacities p and p. Relationship between the pixel graph G V, E and the constructed low network G V, E : Segmentations o G ij 1-1 correspondence ji i Cuts o Q( A, B) c A{ s}, B { t} i G 37

38 a i p ij B A Pixel graph G ( V, E) b k Q( A, B) c A{ s}, B { t} 38

39 Generic Push-Relabel Algorithms or Maximum Flows 2 Running time: O V E

40 Prelows Flow net G ( V, E), capacity unction c, source s, sink t. A prelow is a unction : V V, satisying Capacity constraint: u, v V, ( u, v) c( u, v). Skew symmetry: u, v V, ( u, v) Relaxed ( V, u) 0 low conservation: u V { s}, ( v, u). The quantity e( u) ( V, u) is called the excess low into u. Vertex u t is overlowing i ( V, u) 0. 40

41 Height unction: h( s) ht ( ) 0 Note: V a unction h: V 0, satisying h( u) h( v) 1 or every residual edge u, v E. Lemma: I a height unction is hu ( ) deined relative to a prelow. h( v) 1 then u, v E. 41

42 Operation Push( uv, ) Applicable when: Action: low u is overlowing, c ( u, v) 0, and h( u) h( v) 1. push ( u, v) min e( u), c ( u, v) units o rom u to v. ( u, v) ( u, v) ( u, v). ( v, u) ( u, v). e( u) e( u) ( u, v). e( v) e( v) ( u, v). 42

43 The operation Push( u, v) is called a push rom u to v. Saturating push: edge ( uv, ) becomes saturated (i.e., c ( u, v) 0) ater the push. Nonsaturating push: c ( u, v) 0 ater the push. Lemma: Ater a nonsaturating push rom u to v, vertex u is no longer overlowing. Proo : Ater the push, either e( u) 0 or c ( u, v) 0. 43

44 Operation Relabel( u) Applicable when: u { s, t} is overlowing and h( u) h( v) or all edges ( u, v) E. Action: increase the height o u. h( u) 1min h( v) : ( u, v) E. Note: s ince u is overlowing, there is at least one edge ( u, v) E, so the above min is not over an empty set. 44

45 Initialize-Prelow( G, s, t) Initial prelow: For all u, v V, c( u, v) i u s ( u, v) c( u, v) i v s 0 otherwise Corresponding excess low unction: c( s, v) i ( s, v) E e( v) c( s, x) : ( s, x) E i v s 0 otherwise Initial height unction: V i u s hu ( ) 0 otherwise 45

46 Generic-Push-Relabel Algorithm 1. Initialize-Prelow( G, s, t) // initialize a prelow // 2. while there is an applicable push or relabel operation do select an applicable operation and perorm it Quest ion: For correctness, what do we need to prove? 46

47 Correctness o Generic-Push-Relabel Lemma 1. I u t is an overlowing vertex, then either a push or relabel operation can be applied to it. Lemma 2. Whenever a relabel operation is applied to a vertex u, its height hu ( ) increases by at least 1. Lemma 3. During the execution o the algorithm, always a height unction. Lemma 4. During the execution o the algorithm, always a prelow. h is is 47

48 Lemma 5. Let be a prelow. I there is a height unction h relative to, then there is no path rom s to t in the residual network G. Proo. Otherwise, i there is a simple path p in G rom s to t, then h( s) h( t) length( p) V 1 contradicting the act that h( s) h( t) V. 48

49 Theorem. I/when the algorithm terminates, the prelow it computes is a maximum low. Proo. When the algorithm terminates: is a prelow (by Lemma 4). No vertex is overlowing (by Lemma 1). So, is a low. h is a height unction (by Lemma 3). There is no augmenting path in G (by Lemma 5). So, is a maxlow (by Max-low Min-cut Theorem). 49

50 Analysis o Generic-Push-Relabel Lemma 1. Let be a prelow. Then, or any overlowing vertex u, there is a path rom u to s in G. Lemma 2. At any time during the execution o the algorithm, h( u) 2 V 1 or any node uv. Proo. When a vertex u is relabeled, it is overlowing and has a simple path to s (which is still true ater the relabel). Since the path has at most V 1 edges, h( u) 2 V 1. Corollary (bound on relabel operations). The total number o relabel operations is at most 2 V 1 V 2 2 V 2. 50

51 Lemma 3 (bound on saturating pushes). o saturating pushes is at most 2 V E. The total number Proo. Push( u, v) may occur only i ( u, v) E or ( v, u) E. Between two consecutive saturati ng pushes rom u to v, hu ( ) increases by at least 2. Reasons: Between two saturating pushs rom u to v, there must be a push rom v to u. At the 1st Push( u, v) : say h( u) a. At Push( v, u) : h( v) h( u) 1 a1. At the 2nd Push( u, v) : h( u) h( v) 1 a 2. So, or each ( u, v) E or ( v, u) E, satulating Push( u, v) may occur no more than V times. 51

52 Lemma 4 (bound on nonsaturating pushes). Proo. eu ( ) 0 2 The number o nonsaturating pushes is less than 4 V V E. Deine hu ( ). Initially, 0. Relabeling a vertex u increases by less than 2 V. A saturating push rom u to v increases by less than 2 V. Total amount o increase to is less than V 2 V 2 V E 4 V V E. A nonsaturating push rom u to v deccreases by at least 1. Thus, the total 2 4 V V E. number o nonsaturating pushes is less than 52

53 Lemma 5. Each relabel can be done in each push can be done in O 1 time. OV time and Theo rem. The running time o the generic push-relabel algori Proo. 2 thm is O V E. 3 Total time or rel OV ( ) abels:. Total time or satulating pushes: O( VE). Total time or nonsatulating pushes: O V E 2 ( ). 53

54 The Relabel-to-Front Algorithm Running time: O V 3

55 Admissible edges and networks An edge ( uv, ) is admissible c ( u, v) 0 and h( u) h( v) 1. Admissible network: i G V, E, where E is, h, h, h the set o admissible edges. It is a subgraph o G. Lemma 1. The admissible network G, h is acyclic. Proo. The height unction h( ) is decreasing along any path in G., h 55

56 When is Push( u, v) applicable? How does it aect G? Lemma 2. I a vertex u is overlowing and edge ( u, v) is admissible, then Push( uv, ) is applicable. The operation does not create any new admissible edges, but it may cause ( uv, ) to become inadmissible. Proo. The Push( u, v) operation reduces c ( u, v) and increases c ( v, u). I c ( u, v) becomes 0, ( u, v) becomes inadmissible. Since h( u) h( v) 1, ( v, u) cannot become admissible., h 56

57 When is Relabel( u) applicable? How does it aect G?, h Lemma 3. I a vertex u { st, } is overlowing and there are no admissible edges leaving u, then Relabel( u) is applicable. Ater the relabel operation, there is at least one admissible edge leaving u, but there are no admissible edges entering u. Proo. Only the last claim needs a proo. I, ater the relabel, ( vu, ) is an admissible edge entering then h( v) h( u) 1. Beore the relabel o u, h( v) h( u) 1 and thus ( v, u) E. u, 57

58 Neighbor lists Same as the adjacency lists o the low network G ( V, E), except that the list o u contains v i ( u, v) E or ( v, u) E. N( u) : the neighbor list o u. It contains those vertices v or which there may be a residual edge ( u, v). head N( u) : pointing to the irst element in N( u). current( u) : pointing to the vertex currently under consideration in next- neighbor( ) : N( u). Initially, current( u) head N( u). 58

59 Discharging an overlowing vertex Discharge( u) : push all excess low o u thru admissible edges leaving u, relabeling u as necessary. Procedure Discharge( u) //ater Discharge( u), eu ( ) 0// while eu ( ) 0 do v current( u) i v NIL then Relabel( u) current( u) head N( u) elsei ( uv, ) is admissible then Push( uv, ) else current( u) next- neighbor( v) 59

60 Algorithm Relabel-to-Front( G, s, t) 1 Initialize-Prelow( G, s, t) 2 L V[ G] { s, t} in any order 3 Initialize current( u) or each u V[ G] { s, t} 4 u head( L) 5 while u NIL do 6 Discharge( u) 7 i u has been relabeled during Discharge( u) 8 then move u to the ront o L 9 u next- neighbor( u) 60

61 Lemma 4. Relabel-to-Front perorms push and relabel operations only when they are applicable. Lemma 5. At each test in line 5 o Relabel-to-Front, L is a topological sort o G { s, t} and no, h vertex beore u in the list has excess low. Corollary. When Relabel-to-Front terminates, there are no applicable push or relabel operations (since by Lemma 5 there is no overlowing node). Theore m. Relabel-to-Front is an implementation o the generic push and relable algorithm. 61

62 Proo o Lemma 5 (part 1). By induction, we show L is a topological sort o G { s, t}. For iteration 1, it is true, since initially E., h Assume that L is in topological order at the beginning o an iteration. During the iteration, we perorm pushes and relables. Pushes do not create any admissible edges (Lemma 2). By Lemma 3, Relabel( u) may create admissible edges leaving u, but ater the relabel there will be no admissible edge entering u. By moving u to the ront o LL, remains in topological order., h 62

63 Proo o Lemma vertices beore Initially, it is true since u 5 (part 2). By induction, we show that have no excess u low. is at the ront o L. Assume the property holds at the beginning o an iteration. Let u be the vertex that will be the u in the next iteration. We will show that no vertex beore I u has excess low. is moved to ront, it has no excess low (since it has been discharged), and it is the only vertex beore u. I u is not moved to ront, additional low now has no excess. u vertices beore and thus still have no excess, and u received no u itsel 63

64 Theorem. Proo. The running time 3 The running time o Relabel-to-Front is OV. the total number o iterations (discharges) O the time spent on executing the discharges We irst determine the number o discharges: 2 There are at most OV ( ) relabels. Preceding each relabel there may be Discharge. Similarly, relabel. OV ( ) calls to OV ( ) discharges ater the last 3 Thus, the total number o calls to Discharge is OV ( ). 64

65 Now we determine the total time spent within Discharge. 3 Total time or moving the pointer current: OV ( ). Preceding each Relabel( u), it takes O V time to move current( u). 2 There are at most OV ( ) relabels. 3 Total time or relabels: OV ( ). 3 Total time or satulating pushes: O( VE) O( V ). 3 Total time or nonsatulating pushes: OV ( ). Each discharge has at most 1 nonsatulating push. 65

CMPSCI 611: Advanced Algorithms

CMPSCI 611: Advanced Algorithms CMPSCI 611: Advanced Algorithms Lecture 12: Network Flow Part II Andrew McGregor Last Compiled: December 14, 2017 1/26 Definitions Input: Directed Graph G = (V, E) Capacities C(u, v) > 0 for (u, v) E and

More information

Flow Network. The following figure shows an example of a flow network:

Flow Network. The following figure shows an example of a flow network: Maximum Flow 1 Flow Network The following figure shows an example of a flow network: 16 V 1 12 V 3 20 s 10 4 9 7 t 13 4 V 2 V 4 14 A flow network G = (V,E) is a directed graph. Each edge (u, v) E has a

More information

1 Review for Lecture 2 MaxFlow

1 Review for Lecture 2 MaxFlow Comp 260: Advanced Algorithms Tufts University, Spring 2009 Prof. Lenore Cowen Scribe: Wanyu Wang Lecture 13: Back to MaxFlow/Edmonds-Karp 1 Review for Lecture 2 MaxFlow A flow network showing flow and

More information

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time Network Flow 1 The Maximum-Flow Problem directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time 2 Maximum Flows and Minimum Cuts flows and cuts max flow equals

More information

6.046 Recitation 11 Handout

6.046 Recitation 11 Handout 6.046 Recitation 11 Handout May 2, 2008 1 Max Flow as a Linear Program As a reminder, a linear program is a problem that can be written as that of fulfilling an objective function and a set of constraints

More information

Running Time. Assumption. All capacities are integers between 1 and C.

Running Time. Assumption. All capacities are integers between 1 and C. Running Time Assumption. All capacities are integers between and. Invariant. Every flow value f(e) and every residual capacities c f (e) remains an integer throughout the algorithm. Theorem. The algorithm

More information

10 Max-Flow Min-Cut Flows and Capacitated Graphs 10 MAX-FLOW MIN-CUT

10 Max-Flow Min-Cut Flows and Capacitated Graphs 10 MAX-FLOW MIN-CUT 10 Max-Flow Min-Cut 10.1 Flows and Capacitated Graphs Previously, we considered weighted graphs. In this setting, it was natural to thinking about minimizing the weight of a given path. In fact, we considered

More information

Maximum Flow. Jie Wang. University of Massachusetts Lowell Department of Computer Science. J. Wang (UMass Lowell) Maximum Flow 1 / 27

Maximum Flow. Jie Wang. University of Massachusetts Lowell Department of Computer Science. J. Wang (UMass Lowell) Maximum Flow 1 / 27 Maximum Flow Jie Wang University of Massachusetts Lowell Department of Computer Science J. Wang (UMass Lowell) Maximum Flow 1 / 27 Flow Networks A flow network is a weighted digraph G = (V, E), where the

More information

Lecture 2: Network Flows 1

Lecture 2: Network Flows 1 Comp 260: Advanced Algorithms Tufts University, Spring 2011 Lecture by: Prof. Cowen Scribe: Saeed Majidi Lecture 2: Network Flows 1 A wide variety of problems, including the matching problems discussed

More information

Agenda. Soviet Rail Network, We ve done Greedy Method Divide and Conquer Dynamic Programming

Agenda. Soviet Rail Network, We ve done Greedy Method Divide and Conquer Dynamic Programming Agenda We ve done Greedy Method Divide and Conquer Dynamic Programming Now Flow Networks, Max-flow Min-cut and Applications c Hung Q. Ngo (SUNY at Buffalo) CSE 531 Algorithm Analysis and Design 1 / 52

More information

Types of Networks. Internet Telephone Cell Highways Rail Electrical Power Water Sewer Gas

Types of Networks. Internet Telephone Cell Highways Rail Electrical Power Water Sewer Gas Flow Networks Network Flows 2 Types of Networks Internet Telephone Cell Highways Rail Electrical Power Water Sewer Gas 3 Maximum Flow Problem How can we maximize the flow in a network from a source or

More information

7.5 Bipartite Matching

7.5 Bipartite Matching 7. Bipartite Matching Matching Matching. Input: undirected graph G = (V, E). M E is a matching if each node appears in at most edge in M. Max matching: find a max cardinality matching. Bipartite Matching

More information

Algorithms and Theory of Computation. Lecture 11: Network Flow

Algorithms and Theory of Computation. Lecture 11: Network Flow Algorithms and Theory of Computation Lecture 11: Network Flow Xiaohui Bei MAS 714 September 18, 2018 Nanyang Technological University MAS 714 September 18, 2018 1 / 26 Flow Network A flow network is a

More information

Introduction to Algorithms

Introduction to Algorithms Introduction to Algorithms, Lecture 5 // Introduction to Algorithms 6.46J/.4J LECTURE Shortest Paths I Properties o shortest paths Dijkstra s Correctness Analysis Breadth-irst Pro. Manolis Kellis March,

More information

Computer Science & Engineering 423/823 Design and Analysis of Algorithms

Computer Science & Engineering 423/823 Design and Analysis of Algorithms Bipartite Matching Computer Science & Engineering 423/823 Design and s Lecture 07 (Chapter 26) Stephen Scott (Adapted from Vinodchandran N. Variyam) 1 / 36 Spring 2010 Bipartite Matching 2 / 36 Can use

More information

Algorithms: COMP3121/3821/9101/9801

Algorithms: COMP3121/3821/9101/9801 NEW SOUTH WALES Algorithms: COMP32/382/90/980 Aleks Ignjatović School of Computer Science and Engineering University of New South Wales LECTURE 7: MAXIMUM FLOW COMP32/382/90/980 / 24 Flow Networks A flow

More information

Internet Routing Example

Internet Routing Example Internet Routing Example Acme Routing Company wants to route traffic over the internet from San Fransisco to New York. It owns some wires that go between San Francisco, Houston, Chicago and New York. The

More information

Maximum flow problem

Maximum flow problem Maximum flow problem 7000 Network flows Network Directed graph G = (V, E) Source node s V, sink node t V Edge capacities: cap : E R 0 Flow: f : E R 0 satisfying 1. Flow conservation constraints e:target(e)=v

More information

Flows and Cuts. 1 Concepts. CS 787: Advanced Algorithms. Instructor: Dieter van Melkebeek

Flows and Cuts. 1 Concepts. CS 787: Advanced Algorithms. Instructor: Dieter van Melkebeek CS 787: Advanced Algorithms Flows and Cuts Instructor: Dieter van Melkebeek This lecture covers the construction of optimal flows and cuts in networks, their relationship, and some applications. It paves

More information

Graph Algorithms -2: Flow Networks. N. H. N. D. de Silva Dept. of Computer Science & Eng University of Moratuwa

Graph Algorithms -2: Flow Networks. N. H. N. D. de Silva Dept. of Computer Science & Eng University of Moratuwa CS4460 Advanced d Algorithms Batch 08, L4S2 Lecture 9 Graph Algorithms -2: Flow Networks Dept. of Computer Science & Eng University of Moratuwa Announcement Assignment 2 is due on 18 th of November Worth

More information

Max Flow: Algorithms and Applications

Max Flow: Algorithms and Applications Max Flow: Algorithms and Applications Outline for today Quick review of the Max Flow problem Applications of Max Flow The Ford-Fulkerson (FF) algorithm for Max Flow Analysis of FF, and the Max Flow Min

More information

GRAPH ALGORITHMS Week 7 (13 Nov - 18 Nov 2017)

GRAPH ALGORITHMS Week 7 (13 Nov - 18 Nov 2017) GRAPH ALGORITHMS Week 7 (13 Nov - 18 Nov 2017) C. Croitoru croitoru@info.uaic.ro FII November 12, 2017 1 / 33 OUTLINE Matchings Analytical Formulation of the Maximum Matching Problem Perfect Matchings

More information

CS 1501 Recitation. Xiang Xiao

CS 1501 Recitation. Xiang Xiao CS 1501 Recitation Xiang Xiao Network Flow A flow network G=(V,E): a directed graph, where each edge (u,v) E has a nonnegative capacity c(u,v)>=0. If (u,v) E, we assume that c(u,v)=0. two distinct vertices

More information

Discrete Optimization 2010 Lecture 3 Maximum Flows

Discrete Optimization 2010 Lecture 3 Maximum Flows Remainder: Shortest Paths Maximum Flows Discrete Optimization 2010 Lecture 3 Maximum Flows Marc Uetz University of Twente m.uetz@utwente.nl Lecture 3: sheet 1 / 29 Marc Uetz Discrete Optimization Outline

More information

Graphs and Network Flows IE411. Lecture 15. Dr. Ted Ralphs

Graphs and Network Flows IE411. Lecture 15. Dr. Ted Ralphs Graphs and Network Flows IE411 Lecture 15 Dr. Ted Ralphs IE411 Lecture 15 1 Preflow-Push Algorithms First developed by A. V. Goldberg in 1985. Best preflow-push algorithms outperform best augmenting path

More information

CSE 326: Data Structures Network Flow. James Fogarty Autumn 2007

CSE 326: Data Structures Network Flow. James Fogarty Autumn 2007 CSE 36: Data Structures Network Flow James Fogarty Autumn 007 Network Flows Given a weighted, directed graph G=(V,E) Treat the edge weights as capacities How much can we flow through the graph? A 1 B 7

More information

Problem Set. Problems on Unordered Summation. Math 5323, Fall Februray 15, 2001 ANSWERS

Problem Set. Problems on Unordered Summation. Math 5323, Fall Februray 15, 2001 ANSWERS Problem Set Problems on Unordered Summation Math 5323, Fall 2001 Februray 15, 2001 ANSWERS i 1 Unordered Sums o Real Terms In calculus and real analysis, one deines the convergence o an ininite series

More information

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)}

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} Preliminaries Graphs G = (V, E), V : set of vertices E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) 1 2 3 5 4 V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} 1 Directed Graph (Digraph)

More information

The maximum flow problem

The maximum flow problem The maximum flow problem A. Agnetis 1 Basic properties Given a network G = (N, A) (having N = n nodes and A = m arcs), and two nodes s (source) and t (sink), the maximum flow problem consists in finding

More information

The max flow problem. Ford-Fulkerson method. A cut. Lemma Corollary Max Flow Min Cut Theorem. Max Flow Min Cut Theorem

The max flow problem. Ford-Fulkerson method. A cut. Lemma Corollary Max Flow Min Cut Theorem. Max Flow Min Cut Theorem The max flow problem Ford-Fulkerson method 7 11 Ford-Fulkerson(G) f = 0 while( simple path p from s to t in G f ) 10-2 2 1 f := f + f p output f 4 9 1 2 A cut Lemma 26. + Corollary 26.6 Let f be a flow

More information

Maximum flow problem (part I)

Maximum flow problem (part I) Maximum flow problem (part I) Combinatorial Optimization Giovanni Righini Università degli Studi di Milano Definitions A flow network is a digraph D = (N,A) with two particular nodes s and t acting as

More information

Supplementary material for Continuous-action planning for discounted infinite-horizon nonlinear optimal control with Lipschitz values

Supplementary material for Continuous-action planning for discounted infinite-horizon nonlinear optimal control with Lipschitz values Supplementary material or Continuous-action planning or discounted ininite-horizon nonlinear optimal control with Lipschitz values List o main notations x, X, u, U state, state space, action, action space,

More information

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11 Undirected Graphs Undirected graph. G = (V, E) V = nodes. E = edges between pairs of nodes. Captures pairwise relationship between objects. Graph size parameters: n = V, m = E. V = {, 2, 3,,,, 7, 8 } E

More information

Energy minimization via graph-cuts

Energy minimization via graph-cuts Energy minimization via graph-cuts Nikos Komodakis Ecole des Ponts ParisTech, LIGM Traitement de l information et vision artificielle Binary energy minimization We will first consider binary MRFs: Graph

More information

Two Applications of Maximum Flow

Two Applications of Maximum Flow Two Applications of Maximum Flow The Bipartite Matching Problem a bipartite graph as a flow network maximum flow and maximum matching alternating paths perfect matchings 2 Circulation with Demands flows

More information

CSCE423/823. Introduction. Flow Networks. Ford-Fulkerson Method. Edmonds-Karp Algorithm. Maximum Bipartite Matching 2/35 CSCE423/823.

CSCE423/823. Introduction. Flow Networks. Ford-Fulkerson Method. Edmonds-Karp Algorithm. Maximum Bipartite Matching 2/35 CSCE423/823. 1/35 2pt 0em Computer Science & Engineering 423/823 Design and s Lecture 07 (Chapter 26) Stephen Scott (Adapted from Vinodchandran N. Variyam) 2/35 Can use a directed graph as a flow network to model:

More information

CS 4407 Algorithms Lecture: Shortest Path Algorithms

CS 4407 Algorithms Lecture: Shortest Path Algorithms CS 440 Algorithms Lecture: Shortest Path Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Outline Shortest Path Problem General Lemmas and Theorems. Algorithms Bellman-Ford

More information

Standard Diraphs the (unique) digraph with no vertices or edges. (modulo n) for every 1 i n A digraph whose underlying graph is a complete graph.

Standard Diraphs the (unique) digraph with no vertices or edges. (modulo n) for every 1 i n A digraph whose underlying graph is a complete graph. 5 Directed Graphs What is a directed graph? Directed Graph: A directed graph, or digraph, D, consists of a set of vertices V (D), a set of edges E(D), and a function which assigns each edge e an ordered

More information

Algorithms: Lecture 12. Chalmers University of Technology

Algorithms: Lecture 12. Chalmers University of Technology Algorithms: Lecture 1 Chalmers University of Technology Today s Topics Shortest Paths Network Flow Algorithms Shortest Path in a Graph Shortest Path Problem Shortest path network. Directed graph G = (V,

More information

We say that a flow is feasible for G (or just feasible if the graph and capacity function in question are obvious) if

We say that a flow is feasible for G (or just feasible if the graph and capacity function in question are obvious) if CS787: Advanced Algorithms Lecture 4: Network Flow We devote this lecture to the network flow problem and the max-flow min-cut theorem. A number of other problems can be cast into a maximum flow or minimum

More information

Analysis of Algorithms. Outline. Single Source Shortest Path. Andres Mendez-Vazquez. November 9, Notes. Notes

Analysis of Algorithms. Outline. Single Source Shortest Path. Andres Mendez-Vazquez. November 9, Notes. Notes Analysis of Algorithms Single Source Shortest Path Andres Mendez-Vazquez November 9, 01 1 / 108 Outline 1 Introduction Introduction and Similar Problems General Results Optimal Substructure Properties

More information

Network Flows. 4. Maximum Flows Problems. Fall 2010 Instructor: Dr. Masoud Yaghini

Network Flows. 4. Maximum Flows Problems. Fall 2010 Instructor: Dr. Masoud Yaghini In the name of God Network Flows 4. Maximum Flows Problems 4.1 Introduction Fall 2010 Instructor: Dr. Masoud Yaghini Introduction Introduction The maximum flow problem In a capacitated network, we wish

More information

Part V. Matchings. Matching. 19 Augmenting Paths for Matchings. 18 Bipartite Matching via Flows

Part V. Matchings. Matching. 19 Augmenting Paths for Matchings. 18 Bipartite Matching via Flows Matching Input: undirected graph G = (V, E). M E is a matching if each node appears in at most one Part V edge in M. Maximum Matching: find a matching of maximum cardinality Matchings Ernst Mayr, Harald

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms CSE 5311 Lecture 21 Single-Source Shortest Paths Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 Single-Source

More information

CSC 373: Algorithm Design and Analysis Lecture 12

CSC 373: Algorithm Design and Analysis Lecture 12 CSC 373: Algorithm Design and Analysis Lecture 12 Allan Borodin February 4, 2013 1 / 16 Lecture 12: Announcements and Outline Announcements Term test 1 in tutorials. Need to use only two rooms due to sickness

More information

Parallel Graph Algorithms (con4nued)

Parallel Graph Algorithms (con4nued) Parallel Graph Algorithms (con4nued) MaxFlow A flow network G=(V,E): a directed graph, where each edge (u,v) E has a nonnega4ve capacity c(u,v)>=0. If (u,v) E, we assume that c(u,v)=0. Two dis4nct ver4ces

More information

15.082J and 6.855J and ESD.78J October 21, Max Flows 4

15.082J and 6.855J and ESD.78J October 21, Max Flows 4 5.08J and 6.855J and ESD.78J October, 00 Max Flows 4 Overview of today s lecture Scaling Algorithms Potential function analysis The Excess Scaling Algorithm O(n log U) non-saturating pushes, where U =

More information

On shredders and vertex connectivity augmentation

On shredders and vertex connectivity augmentation On shredders and vertex connectivity augmentation Gilad Liberman The Open University of Israel giladliberman@gmail.com Zeev Nutov The Open University of Israel nutov@openu.ac.il Abstract We consider the

More information

( x) f = where P and Q are polynomials.

( x) f = where P and Q are polynomials. 9.8 Graphing Rational Functions Lets begin with a deinition. Deinition: Rational Function A rational unction is a unction o the orm ( ) ( ) ( ) P where P and Q are polynomials. Q An eample o a simple rational

More information

Recall: Matchings. Examples. K n,m, K n, Petersen graph, Q k ; graphs without perfect matching

Recall: Matchings. Examples. K n,m, K n, Petersen graph, Q k ; graphs without perfect matching Recall: Matchings A matching is a set of (non-loop) edges with no shared endpoints. The vertices incident to an edge of a matching M are saturated by M, the others are unsaturated. A perfect matching of

More information

Circuit Complexity / Counting Problems

Circuit Complexity / Counting Problems Lecture 5 Circuit Complexity / Counting Problems April 2, 24 Lecturer: Paul eame Notes: William Pentney 5. Circuit Complexity and Uniorm Complexity We will conclude our look at the basic relationship between

More information

Parallel Graph Algorithms (con4nued)

Parallel Graph Algorithms (con4nued) Parallel Graph Algorithms (con4nued) MaxFlow A flow network G=(V,E): a directed graph, where each edge (u,v) E has a nonnega4ve capacity c(u,v)>=0. If (u,v) E, we assume that c(u,v)=0. Two dis4nct ver4ces

More information

CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi

CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs Instructor: Shaddin Dughmi Outline 1 Introduction 2 Shortest Path 3 Algorithms for Single-Source Shortest

More information

1 Matchings in Non-Bipartite Graphs

1 Matchings in Non-Bipartite Graphs CS 598CSC: Combinatorial Optimization Lecture date: Feb 9, 010 Instructor: Chandra Chekuri Scribe: Matthew Yancey 1 Matchings in Non-Bipartite Graphs We discuss matching in general undirected graphs. Given

More information

Breadth-First Search of Graphs

Breadth-First Search of Graphs Breadth-First Search of Graphs Analysis of Algorithms Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Applications of Breadth-First Search of Graphs a) Single Source

More information

15.1 Matching, Components, and Edge cover (Collaborate with Xin Yu)

15.1 Matching, Components, and Edge cover (Collaborate with Xin Yu) 15.1 Matching, Components, and Edge cover (Collaborate with Xin Yu) First show l = c by proving l c and c l. For a maximum matching M in G, let V be the set of vertices covered by M. Since any vertex in

More information

On Adjacent Vertex-distinguishing Total Chromatic Number of Generalized Mycielski Graphs. Enqiang Zhu*, Chanjuan Liu and Jin Xu

On Adjacent Vertex-distinguishing Total Chromatic Number of Generalized Mycielski Graphs. Enqiang Zhu*, Chanjuan Liu and Jin Xu TAIWANESE JOURNAL OF MATHEMATICS Vol. xx, No. x, pp. 4, xx 20xx DOI: 0.650/tjm/6499 This paper is available online at http://journal.tms.org.tw On Adjacent Vertex-distinguishing Total Chromatic Number

More information

Lecture 1. 1 Overview. 2 Maximum Flow. COMPSCI 532: Design and Analysis of Algorithms August 26, 2015

Lecture 1. 1 Overview. 2 Maximum Flow. COMPSCI 532: Design and Analysis of Algorithms August 26, 2015 COMPSCI 532: Design and Analysis of Algorithms August 26, 205 Lecture Lecturer: Debmalya Panigrahi Scribe: Allen Xiao Oeriew In this lecture, we will define the maximum flow problem and discuss two algorithms

More information

Single Source Shortest Paths

Single Source Shortest Paths CMPS 00 Fall 017 Single Source Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk Paths in graphs Consider a digraph G = (V, E) with an edge-weight

More information

Computer Science B Homework #2 Due Monday February 9, 2004, 13:30

Computer Science B Homework #2 Due Monday February 9, 2004, 13:30 Computer Science 308-250B Homework #2 Due Monday February 9, 2004, 13:30 In all the problems, all calculations are done mod M where M=3333373 in order to limit the size o the integers involved. This way

More information

The min cost flow problem Course notes for Search and Optimization Spring 2004

The min cost flow problem Course notes for Search and Optimization Spring 2004 The min cost flow problem Course notes for Search and Optimization Spring 2004 Peter Bro Miltersen February 20, 2004 Version 1.3 1 Definition of the min cost flow problem We shall consider a generalization

More information

CSC2420: Algorithm Design, Analysis and Theory Spring (or Winter for pessimists) 2017

CSC2420: Algorithm Design, Analysis and Theory Spring (or Winter for pessimists) 2017 CSC2420: Algorithm Design, Analysis and Theory Spring (or Winter for pessimists) 2017 Allan Borodin January 30, 2017 1 / 32 Lecture 4 Announcements: I have posted all 7 questions for assignment 1. It is

More information

22 Max-Flow Algorithms

22 Max-Flow Algorithms A process cannot be understood by stopping it. Understanding must move with the flow of the process, must join it and flow with it. The First Law of Mentat, in Frank Herbert s Dune (965) There s a difference

More information

Soviet Rail Network, 1955

Soviet Rail Network, 1955 Ch7. Network Flow Soviet Rail Network, 955 Reference: On the history of the transportation and maximum flow problems. Alexander Schrijver in Math Programming, 9: 3, 2002. 2 Maximum Flow and Minimum Cut

More information

Problem set 1. (c) Is the Ford-Fulkerson algorithm guaranteed to produce an acyclic maximum flow?

Problem set 1. (c) Is the Ford-Fulkerson algorithm guaranteed to produce an acyclic maximum flow? CS261, Winter 2017. Instructor: Ashish Goel. Problem set 1 Electronic submission to Gradescope due 11:59pm Thursday 2/2. Form a group of 2-3 students that is, submit one homework with all of your names.

More information

Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths

Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths Matroids Shortest Paths Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths Marc Uetz University of Twente m.uetz@utwente.nl Lecture 2: sheet 1 / 25 Marc Uetz Discrete Optimization Matroids

More information

The min cost flow problem Course notes for Optimization Spring 2007

The min cost flow problem Course notes for Optimization Spring 2007 The min cost flow problem Course notes for Optimization Spring 2007 Peter Bro Miltersen February 7, 2007 Version 3.0 1 Definition of the min cost flow problem We shall consider a generalization of the

More information

The 2nd Texas A&M at Galveston Mathematics Olympiad. September 24, Problems & Solutions

The 2nd Texas A&M at Galveston Mathematics Olympiad. September 24, Problems & Solutions nd Math Olympiad Solutions Problem #: The nd Teas A&M at Galveston Mathematics Olympiad September 4, 00 Problems & Solutions Written by Dr. Lin Qiu A runner passes 5 poles in 30 seconds. How long will

More information

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 7 Network Flow Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 7.5 Bipartite Matching Matching Matching. Input: undirected graph G = (V, E). M E is a matching

More information

Robust Network Codes for Unicast Connections: A Case Study

Robust Network Codes for Unicast Connections: A Case Study Robust Network Codes for Unicast Connections: A Case Study Salim Y. El Rouayheb, Alex Sprintson, and Costas Georghiades Department of Electrical and Computer Engineering Texas A&M University College Station,

More information

Graphic sequences, adjacency matrix

Graphic sequences, adjacency matrix Chapter 2 Graphic sequences, adjacency matrix Definition 2.1. A sequence of integers (d 1,..., d n ) is called graphic if it is the degree sequence of a graph. Example 2.2. 1. (1, 2, 2, 3) is graphic:

More information

Midterm Exam 2 Solutions

Midterm Exam 2 Solutions Algorithm Design and Analysis November 12, 2010 Pennsylvania State University CSE 565, Fall 2010 Professor Adam Smith Exam 2 Solutions Problem 1 (Miscellaneous). Midterm Exam 2 Solutions (a) Your friend

More information

On the Girth of (3,L) Quasi-Cyclic LDPC Codes based on Complete Protographs

On the Girth of (3,L) Quasi-Cyclic LDPC Codes based on Complete Protographs On the Girth o (3,L) Quasi-Cyclic LDPC Codes based on Complete Protographs Sudarsan V S Ranganathan, Dariush Divsalar and Richard D Wesel Department o Electrical Engineering, University o Caliornia, Los

More information

CMPS 6610 Fall 2018 Shortest Paths Carola Wenk

CMPS 6610 Fall 2018 Shortest Paths Carola Wenk CMPS 6610 Fall 018 Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk Paths in graphs Consider a digraph G = (V, E) with an edge-weight function w

More information

Partition is reducible to P2 C max. c. P2 Pj = 1, prec Cmax is solvable in polynomial time. P Pj = 1, prec Cmax is NP-hard

Partition is reducible to P2 C max. c. P2 Pj = 1, prec Cmax is solvable in polynomial time. P Pj = 1, prec Cmax is NP-hard I. Minimizing Cmax (Nonpreemptive) a. P2 C max is NP-hard. Partition is reducible to P2 C max b. P Pj = 1, intree Cmax P Pj = 1, outtree Cmax are both solvable in polynomial time. c. P2 Pj = 1, prec Cmax

More information

Graph G = (V, E). V ={vertices}, E={edges}. V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)}

Graph G = (V, E). V ={vertices}, E={edges}. V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)} Graph Theory Graph G = (V, E). V ={vertices}, E={edges}. a b c h k d g f e V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)} E =16. Digraph D = (V, A). V ={vertices}, E={edges}.

More information

Finger Search in the Implicit Model

Finger Search in the Implicit Model Finger Search in the Implicit Model Gerth Stølting Brodal, Jesper Sindahl Nielsen, Jakob Truelsen MADALGO, Department o Computer Science, Aarhus University, Denmark. {gerth,jasn,jakobt}@madalgo.au.dk Abstract.

More information

An example of LP problem: Political Elections

An example of LP problem: Political Elections Linear Programming An example of LP problem: Political Elections Suppose that you are a politician trying to win an election. Your district has three different types of areas: urban, suburban, and rural.

More information

Graphs and Network Flows IE411. Lecture 12. Dr. Ted Ralphs

Graphs and Network Flows IE411. Lecture 12. Dr. Ted Ralphs Graphs and Network Flows IE411 Lecture 12 Dr. Ted Ralphs IE411 Lecture 12 1 References for Today s Lecture Required reading Sections 21.1 21.2 References AMO Chapter 6 CLRS Sections 26.1 26.2 IE411 Lecture

More information

9.3 Graphing Functions by Plotting Points, The Domain and Range of Functions

9.3 Graphing Functions by Plotting Points, The Domain and Range of Functions 9. Graphing Functions by Plotting Points, The Domain and Range o Functions Now that we have a basic idea o what unctions are and how to deal with them, we would like to start talking about the graph o

More information

Lecture 3. 1 Polynomial-time algorithms for the maximum flow problem

Lecture 3. 1 Polynomial-time algorithms for the maximum flow problem ORIE 633 Network Flows August 30, 2007 Lecturer: David P. Williamson Lecture 3 Scribe: Gema Plaza-Martínez 1 Polynomial-time algorithms for the maximum flow problem 1.1 Introduction Let s turn now to considering

More information

Figure 1: Bayesian network for problem 1. P (A = t) = 0.3 (1) P (C = t) = 0.6 (2) Table 1: CPTs for problem 1. (c) P (E B) C P (D = t) f 0.9 t 0.

Figure 1: Bayesian network for problem 1. P (A = t) = 0.3 (1) P (C = t) = 0.6 (2) Table 1: CPTs for problem 1. (c) P (E B) C P (D = t) f 0.9 t 0. Probabilistic Artiicial Intelligence Problem Set 3 Oct 27, 2017 1. Variable elimination In this exercise you will use variable elimination to perorm inerence on a bayesian network. Consider the network

More information

Discrete Mathematics. On the number of graphs with a given endomorphism monoid

Discrete Mathematics. On the number of graphs with a given endomorphism monoid Discrete Mathematics 30 00 376 384 Contents lists available at ScienceDirect Discrete Mathematics journal homepage: www.elsevier.com/locate/disc On the number o graphs with a given endomorphism monoid

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LETURE 2 Network Flow Finish bipartite matching apacity-scaling algorithm Adam Smith 0//0 A. Smith; based on slides by E. Demaine,. Leiserson, S. Raskhodnikova, K. Wayne Marriage

More information

9.1 The Square Root Function

9.1 The Square Root Function Section 9.1 The Square Root Function 869 9.1 The Square Root Function In this section we turn our attention to the square root unction, the unction deined b the equation () =. (1) We begin the section

More information

Statistical Mechanics and Combinatorics : Lecture II

Statistical Mechanics and Combinatorics : Lecture II Statistical Mechanics and Combinatorics : Lecture II Kircho s matrix-tree theorem Deinition (Spanning tree) A subgraph T o a graph G(V, E) is a spanning tree i it is a tree that contains every vertex in

More information

Lecture 21 November 11, 2014

Lecture 21 November 11, 2014 CS 224: Advanced Algorithms Fall 2-14 Prof. Jelani Nelson Lecture 21 November 11, 2014 Scribe: Nithin Tumma 1 Overview In the previous lecture we finished covering the multiplicative weights method and

More information

Definition: Let f(x) be a function of one variable with continuous derivatives of all orders at a the point x 0, then the series.

Definition: Let f(x) be a function of one variable with continuous derivatives of all orders at a the point x 0, then the series. 2.4 Local properties o unctions o several variables In this section we will learn how to address three kinds o problems which are o great importance in the ield o applied mathematics: how to obtain the

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 22 Maximum Flow Applications Image segmentation Project selection Extensions to Max Flow Sofya Raskhodnikova 11/07/2016 S. Raskhodnikova; based on slides by E. Demaine,

More information

CS 170 DISCUSSION 10 MAXIMUM FLOW. Raymond Chan raychan3.github.io/cs170/fa17.html UC Berkeley Fall 17

CS 170 DISCUSSION 10 MAXIMUM FLOW. Raymond Chan raychan3.github.io/cs170/fa17.html UC Berkeley Fall 17 7 IUION MXIMUM FLOW Raymond han raychan.github.io/cs7/fa7.html U erkeley Fall 7 MXIMUM FLOW Given a directed graph G = (V, E), send as many units of flow from source node s to sink node t. Edges have capacity

More information

Algorithms and Complexity Results for Exact Bayesian Structure Learning

Algorithms and Complexity Results for Exact Bayesian Structure Learning Algorithms and Complexity Results or Exact Bayesian Structure Learning Sebastian Ordyniak and Stean Szeider Institute o Inormation Systems Vienna University o Technology, Austria Abstract Bayesian structure

More information

CS675: Convex and Combinatorial Optimization Fall 2016 Combinatorial Problems as Linear and Convex Programs. Instructor: Shaddin Dughmi

CS675: Convex and Combinatorial Optimization Fall 2016 Combinatorial Problems as Linear and Convex Programs. Instructor: Shaddin Dughmi CS675: Convex and Combinatorial Optimization Fall 2016 Combinatorial Problems as Linear and Convex Programs Instructor: Shaddin Dughmi Outline 1 Introduction 2 Shortest Path 3 Algorithms for Single-Source

More information

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018 CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Recap Network Flow Problems Max-Flow Min Cut Theorem Ford Fulkerson Augmenting Paths Residual Flow Graph Integral Solutions

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LETURE 28 Network Flow hoosing good augmenting paths apacity scaling algorithm A. Smith /4/2008 A. Smith; based on slides by K. Wayne and S. Raskhodnikova Pre-break: Ford-Fulkerson

More information

Friday, September 21, Flows

Friday, September 21, Flows Flows Building evacuation plan people to evacuate from the offices corridors and stairways capacity 10 10 5 50 15 15 15 60 60 50 15 10 60 10 60 15 15 50 For each person determine the path to follow to

More information

CSC2420: Algorithm Design, Analysis and Theory Fall 2017

CSC2420: Algorithm Design, Analysis and Theory Fall 2017 CSC2420: Algorithm Design, Analysis and Theory Fall 2017 Allan Borodin and Nisarg Shah October 11, 2017 1 / 32 Lecture 5 Announcements: The first assignment is due next week, October 18, at 1:00 PM The

More information

CS 361 Meeting 28 11/14/18

CS 361 Meeting 28 11/14/18 CS 361 Meeting 28 11/14/18 Announcements 1. Homework 9 due Friday Computation Histories 1. Some very interesting proos o undecidability rely on the technique o constructing a language that describes the

More information

ACO Comprehensive Exam March 17 and 18, Computability, Complexity and Algorithms

ACO Comprehensive Exam March 17 and 18, Computability, Complexity and Algorithms 1. Computability, Complexity and Algorithms (a) Let G(V, E) be an undirected unweighted graph. Let C V be a vertex cover of G. Argue that V \ C is an independent set of G. (b) Minimum cardinality vertex

More information

Cographs; chordal graphs and tree decompositions

Cographs; chordal graphs and tree decompositions Cographs; chordal graphs and tree decompositions Zdeněk Dvořák September 14, 2015 Let us now proceed with some more interesting graph classes closed on induced subgraphs. 1 Cographs The class of cographs

More information

6. Linear Programming

6. Linear Programming Linear Programming 6-1 6. Linear Programming Linear Programming LP reduction Duality Max-flow min-cut, Zero-sum game Integer Programming and LP relaxation Maximum Bipartite Matching, Minimum weight vertex

More information