Graph2

# Graph2 - Network Flow Problems Given a directed graph G =...

This preview shows pages 1–13. Sign up to view the full content.

61 Network Flow Problems z Given a directed graph G = ( V , E ) with edge capacities c v,w . – Capacities can be the amount of water flowing through a pipe, or the amount of traffic on a street between two intersections. z Two vertices: s and t , source and sink . z Each edge ( v , w ) can pass at most c v,w units of flow.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
62 Problem z At any vertex v , not s or t , the total flow coming in must equal the total flow going out. z The maximum flow problem is to determine the maximum amount of flow that can pass from s to t .
63 Example

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
64 A Simple Maximum-Flow Algorithm ( three graphs: G, G f , G r ) z G f flow graph - It shows the flow at any stage in the algorithm. – Initially all edges in G f have no flow. G f should show a maximum flow when terminated. z G r residual graph – It tells how much more flow can be added on each edge. – It is calculated by subtracting the current flow from the capacity for each edge. – An edge in G r is known as a residual edge .
65 A Simple Maximum-Flow Algorithm ( three graphs: G, G f , G r ) z At each stage, we find a path in G r from s to t . z This path is known as an augmenting path . – The minimum edge on this path is the amount of flow that can be added to every edge on the path. – We do this by adjusting G f and recomputing G r . – When we find no path from s to t in G r , we terminate.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
66 Example Initial stages of the graph, flow graph, and residual graph
67 Example G , G f , G r after two units of flow added along s , b , d , t

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
68 Example G , G f , G r after two units of flow added along s , a , c , t
69 Example G , G f , G r after one unit of flow added along s , a , d , t -- algorithm terminates

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
70 Problem z When t is unreachable from s the algorithm terminates. z The resulting flow of 5 is the maximum. z Problem of Not Being Optimal – Suppose that with our initial graph, we chose the path s , a , d , t . – The result of this choice is that there is now no longer any path from s to t in the residual graph.
71 Example G , G f , G r if initial choice is three units of flow along s , a , d , t - - algorithm terminates with suboptimal solution

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
72 How To Make It Optimal z To make this algorithm work, we need to allow the algorithm to change its mind . z
This is the end of the preview. Sign up to access the rest of the document.

## Graph2 - Network Flow Problems Given a directed graph G =...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online