Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Flow & Linear Programming Jeff Edmonds York University Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt.

Similar presentations


Presentation on theme: "Network Flow & Linear Programming Jeff Edmonds York University Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt."— Presentation transcript:

1 Network Flow & Linear Programming Jeff Edmonds York University Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

2 Instance: A Network is a directed graph G Edges represent pipes that carry flow Each edge has a maximum capacity c A source node s in which flow arrives A sink node t out which flow leaves Goal: Max Flow Network Flow Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

3 Instance: A Network is a directed graph G Edges represent pipes that carry flow Each edge has a maximum capacity c A source node s in which flow arrives A sink node t out which flow leaves Network Flow Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

4 Solution: The amount of flow F through each edge. Flow can’t exceed capacity i.e. F  c. Unidirectional flow F  0 and F = 0 or F = 0 and F  0 Some texts: F = -F Network Flow Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

5 Solution: The amount of flow F through each edge. Flow F can’t exceed capacity c. Unidirectional flow No leaks, no extra flow. Network Flow Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

6 Solution: The amount of flow F through each edge. Flow F cant exceed capacity c. Unidirectional flow No leaks, no extra flow. For each node v: flow in = flow out  u F =  w F Except for s and t. Network Flow Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

7 Value of Solution: Flow from s into the network minus flow from the network back into s. rate(F) =  u F = flow from network into t minus flow back in. =  u F -  v F -  v F What about flow back into s? Goal: Max Flow Network Flow Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

8 Network flow problem is a linear program Taken from www.infosun.fim.uni-passau.de/br/lehrstuhl/Kurse/Proseminar_ss01/Network_flow_problems.ppt

9 Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

10 A network with its edge capacities Network Flow What is the maximum that can flow from s to t? Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

11 A network with its edge capacities Network Flow The max total rate of the flow is 1+2-0 = 3. flow/capacity = 2/5 Can prove that total cannot be higher. Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

12 No more flow can be pushed along the top path because the edge is at capacity. Similarly, the edge. No flow is pushed along the bottom path because this would decrease the total from s to t. Network Flow Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

13 is a minimum cut Its capacity is the sum of the capacities crossing the cut = 1+2 = 3. is not included in because it is going in the wrong direction. Network Flow Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

14 The edges crossing forward across the cut are at capacity those crossing backwards have zero flow. This is always true. Network Flow Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

15 The maximum flow is 1+2=3 The minimum cut is 1+2=3. These are always equal. Maxflow = Mincut Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt

16 An Application: Matching SamMary BobBeth JohnSue FredAnn Who loves whom. Who should be matched with whom so as many as possible matched and nobody matched twice? 3 matches Can we do better? 4 matches Adapted from www.cse.yorku.ca/~jeff/notes/3101/0 3.5-NetworkFlow.ppt

17 An Application: Matching st c = 1 Total flow out of u  flow into u  1 Boy u matched to at most one girl. 1 c = 1 Total flow into v = flow out of v  1 Girl v matched to at most one boy. 1 u v Adapted from www.cse.yorku.ca/~jeff/notes/3101/0 3.5-NetworkFlow.ppt

18 Instance: A Network is a directed graph G Special nodes s and t. Edges represent pipes that carry flow Each edge has a maximum capacity c Partition into two regions so that the cut between the two is minimized Min Cut s t Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt


Download ppt "Network Flow & Linear Programming Jeff Edmonds York University Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt."

Similar presentations


Ads by Google