Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Analysis Maxflow. What is a Network? Directed connected graph Source node Sink (destination node) Arcs are weighted (costs) Represent a system.

Similar presentations


Presentation on theme: "Network Analysis Maxflow. What is a Network? Directed connected graph Source node Sink (destination node) Arcs are weighted (costs) Represent a system."— Presentation transcript:

1 Network Analysis Maxflow

2 What is a Network? Directed connected graph Source node Sink (destination node) Arcs are weighted (costs) Represent a system

3 Maxflow problem Determine the greatest flow through the network from Source to Sink. Source generates flow Sink consumes flow Intermediate nodes only pass flow Maximum capacity on each link

4 Example: Trams Network represents tram routes Weights are number of free places How many people can get from A to G?

5 Maxflow: notations n = the number of nodes node 1 = Source Node n = Sink x ij = the ammount of flow on arc from i to j u ij = capacity on arc from i to j

6 Linear Programming

7 Algorithm Simplex method Take advantage of special network structure Ford-Fulkerson labeling algorithm Based on flow-augmenting-paths = path from source to sink whose current flow is less than its capacity.

8 Ford-Fulkerson labeling algorithm 1.Use a labeling procedure to find a flow- augmenting path. If none can be found, the current flow is optimal 2.Increase the current flow as much as possible in the flow-augmenting path (until some arc reaches its capacity) Goto 1.

9 Labeling Procedure (1) 1.Label the Sourcenode 2.For any labeled node i examine: -outgoing arcs (i,j) -incoming arcs (j,i)

10 Labeling Procedure (2) Outgoing arc : label node j if the current flow is less than its capacity (u ij ) Incoming arc : label node j if the incoming flow is greater than zero

11 Example (1) Assume flow in all x ij = 0 Label nodes A,B,C,D and G Find flow-augmenting path (A,D)(D,G) Increase flow by 4 f = 4

12 Example (2) Label nodes A,B,C and E,D,F,G Find flow-augmenting path (A,B)(B,D)(D,E)(E,G) Increase flow by 4 f = 8

13 Example (3) Label nodes A,B,C and E,D,F,G Find flow-augmenting path (A,D)(D,F)(F,G) Increase flow by 2 f = 10

14 Example (4) Label nodes A,B,C,D,F and G Find flow-augmenting path A,C,D,F,G Increase flow by 4 f = 14

15 Example (5) Label all nodes except G No more flow- augmenting paths! Current flow f= 14 is optimal. Question: Why is D labeled?

16 Backward Arcs (1) Assume path 1,2,4,6 f = 4 The use of backward arcs is necesarry to find the max-flow! Why?

17 Backward Arcs (2) f = 8 due to backward labeling! Flow trough backward arcs is subtracted from total flow.

18 Max flow – Min Cut (1) A cut is a set of arcs that, when removed, make the Sink unreachable from Source. Whithout a cut, there is no flow from Source to Sink. Capacities of a cut limit the Max flow A min-cut is a cut with minimum total capacity.

19 Max flow – Min Cut (2) Ford and Fulkerson’s “Max flow-Min Cut” theorem Max flow = Min Cut If no flow-augmenting path can be found, it is proven that the maximum capacity of some cut is used.

20 Extensions to Max flow Multiple Sources : include supersource Multiple Sinks : include supersink Limited Source(s) Limited Sink(s)

21 Multiple Sources Supersource connects to all sources with unrestricted capacity. Uncapacitated links do not contibute to Min Cut!

22 Multiple Sinks All Sinks connect to Supersink with unrestricted capacity Uncapacitated links do not contribute to Min Cut!

23 Limited Sources/Sinks Include supersource/sink Place capacity on connections between supersource(s)/sink(s) and source(s)/sink(s)

24 Complexity of Max flow Depends on how the flow-augmenting paths is selected. Shortest path method: O(ne²) Blocking flows method: O(n²e) Preflow method: O(n³)


Download ppt "Network Analysis Maxflow. What is a Network? Directed connected graph Source node Sink (destination node) Arcs are weighted (costs) Represent a system."

Similar presentations


Ads by Google