{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

DS-chapter9(graph -2)

# DS-chapter9(graph -2) - 9.4 Network Flow Problems Example...

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

9.4 Network Flow Problems . Example . Consider the following network of pipes: s d c b a t 3 3 3 2 2 2 1 4 source sink Note: Total coming in ( v ) Total going out ( v ) where v { s , t } Determine the maximum amount of flow that can pass from s to t .

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

View Full Document
Network Flow Problems 1. A Simple Algorithm s d c b a t 3 3 3 2 2 2 1 4 G s d c b a t Flow G f s d c b a t Residual G r Step 1: Find any path s t in G r ; augmenting path Step 2: Take the minimum edge on this path as the amount of flow and add to G f ; Step 3: Update G r and remove the 0 flow edges; Step 4: If (there is a path s t in G r ) Goto Step 1 ; Else End.
Network Flow Problems s d c b a t 3 3 3 2 2 2 1 4 G It is simple indeed. But I bet that you will point out some problems here… You are right! What if I pick up the path s a d t first? Uh-oh… Seems we cannot be greedy at this point.

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

View Full Document
Network Flow Problems 2. A Solution – allow the algorithm to undo its decisions For each edge ( v , w ) with flow f v , w in G f , add an edge ( w , v ) with flow f v , w in G r . s d c b a t Flow G f s d c b a t 3 3 3 2 2 2 1 4 G s d c b a t Residual G r 3 3 3 2 2 2 1 4 3 3 3 3 3 1 3 2 2 2 2 2 2 2 1 3 2 2 1 . Proposition . If the edge capabilities are rational numbers , this algorithm always terminate with a maximum flow. Note: The algorithm works for G with cycles as well.
Network Flow Problems 3. Analysis ( If the capacities are all integers ) An augmenting path can be found by an unweighted shortest path algorithm. T = O( ) where f is the maximum flow. f · | E | s t a b 1 000 000 1 000 000 1 000 000 1 000 000 1 Always choose the augmenting path that allows the largest increase in flow.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 15

DS-chapter9(graph -2) - 9.4 Network Flow Problems Example...

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

View Full Document
Ask a homework question - tutors are online