Design and Analysis of Algorithms

CSE 421, Autumn 2009, University of Washington

Class exercise solution recap

Posted by James Lee on November 9, 2009

In class today, the exercise was to prove that the flow out of s equals to the flow into t in any valid flow network. Someone cleverly proposed the following solution.

First, let A be the set of all nodes except s and t. Then by the flow conversation constraint, we have

\displaystyle \sum_{v \in A} \sum_{e \textrm{ out of } v} f(e) = \sum_{v \in A} \sum_{e \textrm{ into } v} f(e).

But notice that for every edge e which does not have s or t as an endpoint, f(e) appears on both sides (since it goes into one node and comes out of one node). Canceling off all these terms, on the left hand side we are left with the flow into t, and on the right hand side, the flow out of s, proving that the two are equal.

In the next class (on Friday), we’ll see a generalization of this lemma, which will be the basis of our algorithms for computing minimum s-t cuts.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.