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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
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 .
Background image of page 2
63 Example
Background image of page 3

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

View Full DocumentRight Arrow Icon
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 .
Background image of page 4
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.
Background image of page 5

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

View Full DocumentRight Arrow Icon
66 Example Initial stages of the graph, flow graph, and residual graph
Background image of page 6
67 Example G , G f , G r after two units of flow added along s , b , d , t
Background image of page 7

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

View Full DocumentRight Arrow Icon
68 Example G , G f , G r after two units of flow added along s , a , c , t
Background image of page 8
69 Example G , G f , G r after one unit of flow added along s , a , d , t -- algorithm terminates
Background image of page 9

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

View Full DocumentRight Arrow Icon
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.
Background image of page 10
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
Background image of page 11

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

View Full DocumentRight Arrow Icon
72 How To Make It Optimal z To make this algorithm work, we need to allow the algorithm to change its mind . z
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 44

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 Right Arrow Icon
Ask a homework question - tutors are online