<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tcs.nju.edu.cn/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=172.21.3.81</id>
	<title>TCS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://tcs.nju.edu.cn/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=172.21.3.81"/>
	<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Special:Contributions/172.21.3.81"/>
	<updated>2026-05-03T13:46:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Flow_and_matching&amp;diff=4291</id>
		<title>Combinatorics (Fall 2010)/Flow and matching</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Flow_and_matching&amp;diff=4291"/>
		<updated>2010-12-24T12:43:13Z</updated>

		<summary type="html">&lt;p&gt;172.21.3.81: /* The augmenting paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flow ==&lt;br /&gt;
&lt;br /&gt;
=== The maximum flow problem ===&lt;br /&gt;
An instance of the maximum flow problem consists of:&lt;br /&gt;
* a directed graph &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt;;&lt;br /&gt;
* two distinguished vertices &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; (the &#039;&#039;&#039;source&#039;&#039;&#039;) and &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; (the &#039;&#039;&#039;sink&#039;&#039;&#039;), where the in-degree of &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; and the out-degree of &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; are both 0;&lt;br /&gt;
* the &#039;&#039;&#039;capacity function&#039;&#039;&#039;  &amp;lt;math&amp;gt;c:E\rightarrow\mathbb{R}^+&amp;lt;/math&amp;gt; which associates each directed edge &amp;lt;math&amp;gt;(u,v)\in E&amp;lt;/math&amp;gt; a nonnegative real number &amp;lt;math&amp;gt;c_{uv}&amp;lt;/math&amp;gt; called the &#039;&#039;&#039;capacity&#039;&#039;&#039; of the edge.&lt;br /&gt;
&lt;br /&gt;
The quadruple &amp;lt;math&amp;gt;(G,c,s,t)&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;flow network&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A function &amp;lt;math&amp;gt;f:E\rightarrow\mathbb{R}^+&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;flow&#039;&#039;&#039; (or an &#039;&#039;&#039;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; flow&#039;&#039;&#039;) in the network &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; if it satisfies:&lt;br /&gt;
* &#039;&#039;&#039;Capacity constraint:&#039;&#039;&#039; &amp;lt;math&amp;gt;f_{uv}\le c_{uv}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;(u,v)\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Conservation constraint:&#039;&#039;&#039; &amp;lt;math&amp;gt;\sum_{u:(u,v)\in E}f_{uv}=\sum_{w:(v,w)\in E}f_{vw}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;v\in V\setminus\{s,t\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;value&#039;&#039;&#039; of the flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Given a flow network, the maximum flow problem asks to find the flow of the maximum value.&lt;br /&gt;
&lt;br /&gt;
The maximum flow problem can be described as the following linear program.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{maximize} \quad&amp;amp; \sum_{v:(s,v)\in E}f_{sv}\\&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{subject to} \\&lt;br /&gt;
\\&lt;br /&gt;
\\&lt;br /&gt;
\\&lt;br /&gt;
\end{align}&lt;br /&gt;
\quad &amp;amp;&lt;br /&gt;
\begin{align} f_{uv}&amp;amp;\le c_{uv} &amp;amp;\quad&amp;amp; \forall (u,v)\in E\\&lt;br /&gt;
\sum_{u:(u,v)\in E}f_{uv}-\sum_{w:(v,w)\in E}f_{vw} &amp;amp;=0 &amp;amp;\quad&amp;amp; \forall v\in V\setminus\{s,t\}\\&lt;br /&gt;
 f_{uv}&amp;amp;\ge 0 &amp;amp;\quad&amp;amp; \forall (u,v)\in E&lt;br /&gt;
\end{align}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Cuts ===&lt;br /&gt;
{{Theorem|Definition|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;(G(V,E),c,s,t)&amp;lt;/math&amp;gt; be a flow network. Let &amp;lt;math&amp;gt;S\subset V&amp;lt;/math&amp;gt;. We call &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; an &#039;&#039;&#039;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut&#039;&#039;&#039; if &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;.&lt;br /&gt;
:The &#039;&#039;&#039;value&#039;&#039;&#039; of  the cut (also called the &#039;&#039;&#039;capacity&#039;&#039;&#039; of the cut) is defined as &amp;lt;math&amp;gt;\sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A fundamental fact in the theory of flow is that cuts always upper bound flows.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Lemma|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;(G(V,E),c,s,t)&amp;lt;/math&amp;gt; be a flow network. Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be an arbitrary flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; be an arbitrary &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\sum_{v:(s,v)}f_{sv}\le \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;,&lt;br /&gt;
:that is, the value of any flow is no greater than the value of any cut.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|By the definition of &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut, &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Due to the conservation of flow, &lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{u\in S}\left(\sum_{v:(u,v)\in E}f_{uv}-\sum_{v:(v,u)\in E}f_{vu}\right)=\sum_{v:(s,v)\in E}f_{sv}+\sum_{u\in S\setminus\{s\}}\left(\sum_{v:(u,v)\in E}f_{uv}-\sum_{v:(v,u)\in E}f_{vu}\right)=\sum_{v:(s,v)\in E}f_{sv}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
On the other hand, summing flow over edges,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v\in S}\left(\sum_{u:(u,v)\in E}f_{uv}-\sum_{u:(v,u)\in E}f_{vu}\right)=\sum_{u\in S,v\in S\atop (u,v)\in E}\left(f_{uv}-f_{uv}\right)+\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}=\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}=\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}\le\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}\le  \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}\,,&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The augmenting paths ===&lt;br /&gt;
{{Theorem|Definition (Augmenting path)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be a flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. An &#039;&#039;&#039;augmenting path to &amp;lt;math&amp;gt;u_k&amp;lt;/math&amp;gt;&#039;&#039;&#039; is a sequence of distinct vertices &amp;lt;math&amp;gt;P=(u_0,u_1,\cdots, u_k)&amp;lt;/math&amp;gt;, such that &lt;br /&gt;
:* &amp;lt;math&amp;gt;u_0=s\,&amp;lt;/math&amp;gt;;&lt;br /&gt;
:and each pair of consecutive vertices &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; corresponds to either a &#039;&#039;&#039;forward edge&#039;&#039;&#039; &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; or a &#039;&#039;&#039;reverse edge&#039;&#039;&#039; &amp;lt;math&amp;gt;(u_{i+1},u_{i})\in E&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:* &amp;lt;math&amp;gt;f(u_i,u_{i+1})&amp;lt;c(u_i,u_{i+1})\,&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; corresponds to a forward edge &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:* &amp;lt;math&amp;gt;f(u_{i+1},u_i)&amp;gt;0\,&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; corresponds to a reverse edge &amp;lt;math&amp;gt;(u_{i+1},u_{i})\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
:If &amp;lt;math&amp;gt;u_k=t\,&amp;lt;/math&amp;gt;, we simply call &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; an &#039;&#039;&#039;augmenting path&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be a flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. Suppose there is an augmenting path &amp;lt;math&amp;gt;P=u_0u_1\cdots u_k&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;u_0=s&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u_k=t&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;\epsilon&amp;gt;0&amp;lt;/math&amp;gt; be a positive constant satisfying &lt;br /&gt;
*&amp;lt;math&amp;gt;\epsilon \le c(u_{i},u_{i+1})-f(u_i,u_{i+1})&amp;lt;/math&amp;gt; for all forward edges &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;;&lt;br /&gt;
*&amp;lt;math&amp;gt;\epsilon \le f(u_{i+1},u_i)&amp;lt;/math&amp;gt; for all reverse edges &amp;lt;math&amp;gt;(u_{i+1},u_i)\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
Due to the definition of augmenting path, we can always find such a positive &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Increase &amp;lt;math&amp;gt;f(u_i,u_{i+1})&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; for all forward edges &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; and decrease &amp;lt;math&amp;gt;f(u_{i+1},u_i)&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; for all reverse edges &amp;lt;math&amp;gt;(u_{i+1},u_i)\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;. Denote the modified flow by &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt;. It is easy to see that &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt; satisfies the capacity constraint and conservation constraint thus is still a valid flow. On the other hand, the value of the new flow &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&#039;=\epsilon+\sum_{v:(s,v)\in E}f_{sv}&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Therefore, the value of the flow can be &amp;quot;augmented&amp;quot; by adjusting the flow on the augmenting path. This immediately implies that if a flow is maximum, then there is no augmenting path. Surprisingly, the converse is also true, thus maximum flows are &amp;quot;characterized&amp;quot; by augmenting paths.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Lemma|&lt;br /&gt;
:A flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is maximum if and only if there are no augmenting paths.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|We have already proved the &amp;quot;only if&amp;quot; direction above. Now we prove the &amp;quot;if&amp;quot; direction.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S=\{u\in V\mid \exists\text{an augmenting path to }u\}&amp;lt;/math&amp;gt;. Clearly &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt;, and since there is no augmenting path &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; defines an &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut. &lt;br /&gt;
&lt;br /&gt;
We claim that&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)}f_{sv}= \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;,&lt;br /&gt;
that is, the value of flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; approach the value of the cut &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; defined above. By the above lemma, this will imply that the current flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is maximum.&lt;br /&gt;
&lt;br /&gt;
To prove this claim, we first observe that&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)}f_{sv}= \sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}&amp;lt;/math&amp;gt;.&lt;br /&gt;
This identity is implied by the flow conservation constraint, and holds for any &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We then claim that &lt;br /&gt;
*&amp;lt;math&amp;gt;f_{uv}=c_{uv}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;u\in S,v\not\in S, (u,v)\in E&amp;lt;/math&amp;gt;; and &lt;br /&gt;
*&amp;lt;math&amp;gt;f_{vu}=0&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;u\in S,v\not\in S, (v,u)\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
If otherwise, then the augmenting path to &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; apending &amp;lt;math&amp;gt;uv&amp;lt;/math&amp;gt; becomes a new augmenting path to &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;, which contradicts that &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; includes all vertices to which there exist augmenting paths.&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)}f_{sv}= \sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu} = \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
As discussed above, this proves the theorem.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The max-flow min-cut theorem ===&lt;br /&gt;
&lt;br /&gt;
== Unimodularity ==&lt;br /&gt;
&lt;br /&gt;
=== Integrality of polytopes ===&lt;br /&gt;
&lt;br /&gt;
=== Unimodularity and total unimodularity ===&lt;/div&gt;</summary>
		<author><name>172.21.3.81</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Flow_and_matching&amp;diff=4290</id>
		<title>Combinatorics (Fall 2010)/Flow and matching</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Flow_and_matching&amp;diff=4290"/>
		<updated>2010-12-24T12:19:41Z</updated>

		<summary type="html">&lt;p&gt;172.21.3.81: /* The augmenting paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flow ==&lt;br /&gt;
&lt;br /&gt;
=== The maximum flow problem ===&lt;br /&gt;
An instance of the maximum flow problem consists of:&lt;br /&gt;
* a directed graph &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt;;&lt;br /&gt;
* two distinguished vertices &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; (the &#039;&#039;&#039;source&#039;&#039;&#039;) and &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; (the &#039;&#039;&#039;sink&#039;&#039;&#039;), where the in-degree of &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; and the out-degree of &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; are both 0;&lt;br /&gt;
* the &#039;&#039;&#039;capacity function&#039;&#039;&#039;  &amp;lt;math&amp;gt;c:E\rightarrow\mathbb{R}^+&amp;lt;/math&amp;gt; which associates each directed edge &amp;lt;math&amp;gt;(u,v)\in E&amp;lt;/math&amp;gt; a nonnegative real number &amp;lt;math&amp;gt;c_{uv}&amp;lt;/math&amp;gt; called the &#039;&#039;&#039;capacity&#039;&#039;&#039; of the edge.&lt;br /&gt;
&lt;br /&gt;
The quadruple &amp;lt;math&amp;gt;(G,c,s,t)&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;flow network&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A function &amp;lt;math&amp;gt;f:E\rightarrow\mathbb{R}^+&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;flow&#039;&#039;&#039; (or an &#039;&#039;&#039;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; flow&#039;&#039;&#039;) in the network &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; if it satisfies:&lt;br /&gt;
* &#039;&#039;&#039;Capacity constraint:&#039;&#039;&#039; &amp;lt;math&amp;gt;f_{uv}\le c_{uv}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;(u,v)\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Conservation constraint:&#039;&#039;&#039; &amp;lt;math&amp;gt;\sum_{u:(u,v)\in E}f_{uv}=\sum_{w:(v,w)\in E}f_{vw}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;v\in V\setminus\{s,t\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;value&#039;&#039;&#039; of the flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Given a flow network, the maximum flow problem asks to find the flow of the maximum value.&lt;br /&gt;
&lt;br /&gt;
The maximum flow problem can be described as the following linear program.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{maximize} \quad&amp;amp; \sum_{v:(s,v)\in E}f_{sv}\\&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{subject to} \\&lt;br /&gt;
\\&lt;br /&gt;
\\&lt;br /&gt;
\\&lt;br /&gt;
\end{align}&lt;br /&gt;
\quad &amp;amp;&lt;br /&gt;
\begin{align} f_{uv}&amp;amp;\le c_{uv} &amp;amp;\quad&amp;amp; \forall (u,v)\in E\\&lt;br /&gt;
\sum_{u:(u,v)\in E}f_{uv}-\sum_{w:(v,w)\in E}f_{vw} &amp;amp;=0 &amp;amp;\quad&amp;amp; \forall v\in V\setminus\{s,t\}\\&lt;br /&gt;
 f_{uv}&amp;amp;\ge 0 &amp;amp;\quad&amp;amp; \forall (u,v)\in E&lt;br /&gt;
\end{align}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Cuts ===&lt;br /&gt;
{{Theorem|Definition|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;(G(V,E),c,s,t)&amp;lt;/math&amp;gt; be a flow network. Let &amp;lt;math&amp;gt;S\subset V&amp;lt;/math&amp;gt;. We call &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; an &#039;&#039;&#039;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut&#039;&#039;&#039; if &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;.&lt;br /&gt;
:The &#039;&#039;&#039;value&#039;&#039;&#039; of  the cut (also called the &#039;&#039;&#039;capacity&#039;&#039;&#039; of the cut) is defined as &amp;lt;math&amp;gt;\sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A fundamental fact in the theory of flow is that cuts always upper bound flows.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Lemma|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;(G(V,E),c,s,t)&amp;lt;/math&amp;gt; be a flow network. Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be an arbitrary flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; be an arbitrary &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\sum_{v:(s,v)}f_{sv}\le \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;,&lt;br /&gt;
:that is, the value of any flow is no greater than the value of any cut.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|By the definition of &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut, &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Due to the conservation of flow, &lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{u\in S}\left(\sum_{v:(u,v)\in E}f_{uv}-\sum_{v:(v,u)\in E}f_{vu}\right)=\sum_{v:(s,v)\in E}f_{sv}+\sum_{u\in S\setminus\{s\}}\left(\sum_{v:(u,v)\in E}f_{uv}-\sum_{v:(v,u)\in E}f_{vu}\right)=\sum_{v:(s,v)\in E}f_{sv}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
On the other hand, summing flow over edges,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v\in S}\left(\sum_{u:(u,v)\in E}f_{uv}-\sum_{u:(v,u)\in E}f_{vu}\right)=\sum_{u\in S,v\in S\atop (u,v)\in E}\left(f_{uv}-f_{uv}\right)+\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}=\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}=\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}\le\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}\le  \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}\,,&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The augmenting paths ===&lt;br /&gt;
{{Theorem|Definition (Augmenting path)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be a flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. An &#039;&#039;&#039;augmenting path to &amp;lt;math&amp;gt;u_k&amp;lt;/math&amp;gt;&#039;&#039;&#039; is a sequence of distinct vertices &amp;lt;math&amp;gt;P=(u_0,u_1,\cdots, u_k)&amp;lt;/math&amp;gt;, such that &lt;br /&gt;
:* &amp;lt;math&amp;gt;u_0=s\,&amp;lt;/math&amp;gt;;&lt;br /&gt;
:and each pair of consecutive vertices &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; corresponds to either a &#039;&#039;&#039;forward edge&#039;&#039;&#039; &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; or a &#039;&#039;&#039;reverse edge&#039;&#039;&#039; &amp;lt;math&amp;gt;(u_{i+1},u_{i})\in E&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:* &amp;lt;math&amp;gt;f(u_i,u_{i+1})&amp;lt;c(u_i,u_{i+1})\,&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; corresponds to a forward edge &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:* &amp;lt;math&amp;gt;f(u_{i+1},u_i)&amp;gt;0\,&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; corresponds to a reverse edge &amp;lt;math&amp;gt;(u_{i+1},u_{i})\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
:If &amp;lt;math&amp;gt;u_k=t\,&amp;lt;/math&amp;gt;, we simply call &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; an &#039;&#039;&#039;augmenting path&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be a flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. Suppose there is an augmenting path &amp;lt;math&amp;gt;P=u_0u_1\cdots u_k&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;u_0=s&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u_k=t&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;\epsilon&amp;gt;0&amp;lt;/math&amp;gt; be a positive constant satisfying &lt;br /&gt;
*&amp;lt;math&amp;gt;\epsilon \le c(u_{i},u_{i+1})-f(u_i,u_{i+1})&amp;lt;/math&amp;gt; for all forward edges &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;;&lt;br /&gt;
*&amp;lt;math&amp;gt;\epsilon \le f(u_{i+1},u_i)&amp;lt;/math&amp;gt; for all reverse edges &amp;lt;math&amp;gt;(u_{i+1},u_i)\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
Due to the definition of augmenting path, we can always find such a positive &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Increase &amp;lt;math&amp;gt;f(u_i,u_{i+1})&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; for all forward edges &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; and decrease &amp;lt;math&amp;gt;f(u_{i+1},u_i)&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; for all reverse edges &amp;lt;math&amp;gt;(u_{i+1},u_i)\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;. Denote the modified flow by &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt;. It is easy to see that &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt; satisfies the capacity constraint and conservation constraint thus is still a valid flow. On the other hand, the value of the new flow &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&#039;=\epsilon+\sum_{v:(s,v)\in E}f_{sv}&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Therefore, the value of the flow can be &amp;quot;augmented&amp;quot; by adjusting the flow on the augmenting path. This immediately implies that if a flow is maximum, then there is no augmenting path. Surprisingly, the converse is also true, thus maximum flows are &amp;quot;characterized&amp;quot; by augmenting paths.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Lemma|&lt;br /&gt;
:A flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is maximum if and only if there are no augmenting paths.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|We have already proved the &amp;quot;only if&amp;quot; direction above. Now we prove the &amp;quot;if&amp;quot; direction.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S=\{u\in V\mid \exists\text{an augmenting path to }u\}&amp;lt;/math&amp;gt;. Clearly &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt;, and since there is no augmenting path &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; defines an &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut. &lt;br /&gt;
&lt;br /&gt;
We claim that&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)}f_{sv}= \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;,&lt;br /&gt;
that is, the value of flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; approach the value of the cut &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; defined above. By the above lemma, this will imply that the current flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is maximum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The max-flow min-cut theorem ===&lt;br /&gt;
&lt;br /&gt;
== Unimodularity ==&lt;br /&gt;
&lt;br /&gt;
=== Integrality of polytopes ===&lt;br /&gt;
&lt;br /&gt;
=== Unimodularity and total unimodularity ===&lt;/div&gt;</summary>
		<author><name>172.21.3.81</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Flow_and_matching&amp;diff=4289</id>
		<title>Combinatorics (Fall 2010)/Flow and matching</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Flow_and_matching&amp;diff=4289"/>
		<updated>2010-12-24T12:06:22Z</updated>

		<summary type="html">&lt;p&gt;172.21.3.81: /* The augmenting paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flow ==&lt;br /&gt;
&lt;br /&gt;
=== The maximum flow problem ===&lt;br /&gt;
An instance of the maximum flow problem consists of:&lt;br /&gt;
* a directed graph &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt;;&lt;br /&gt;
* two distinguished vertices &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; (the &#039;&#039;&#039;source&#039;&#039;&#039;) and &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; (the &#039;&#039;&#039;sink&#039;&#039;&#039;), where the in-degree of &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; and the out-degree of &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; are both 0;&lt;br /&gt;
* the &#039;&#039;&#039;capacity function&#039;&#039;&#039;  &amp;lt;math&amp;gt;c:E\rightarrow\mathbb{R}^+&amp;lt;/math&amp;gt; which associates each directed edge &amp;lt;math&amp;gt;(u,v)\in E&amp;lt;/math&amp;gt; a nonnegative real number &amp;lt;math&amp;gt;c_{uv}&amp;lt;/math&amp;gt; called the &#039;&#039;&#039;capacity&#039;&#039;&#039; of the edge.&lt;br /&gt;
&lt;br /&gt;
The quadruple &amp;lt;math&amp;gt;(G,c,s,t)&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;flow network&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A function &amp;lt;math&amp;gt;f:E\rightarrow\mathbb{R}^+&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;flow&#039;&#039;&#039; (or an &#039;&#039;&#039;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; flow&#039;&#039;&#039;) in the network &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; if it satisfies:&lt;br /&gt;
* &#039;&#039;&#039;Capacity constraint:&#039;&#039;&#039; &amp;lt;math&amp;gt;f_{uv}\le c_{uv}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;(u,v)\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Conservation constraint:&#039;&#039;&#039; &amp;lt;math&amp;gt;\sum_{u:(u,v)\in E}f_{uv}=\sum_{w:(v,w)\in E}f_{vw}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;v\in V\setminus\{s,t\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;value&#039;&#039;&#039; of the flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Given a flow network, the maximum flow problem asks to find the flow of the maximum value.&lt;br /&gt;
&lt;br /&gt;
The maximum flow problem can be described as the following linear program.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{maximize} \quad&amp;amp; \sum_{v:(s,v)\in E}f_{sv}\\&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{subject to} \\&lt;br /&gt;
\\&lt;br /&gt;
\\&lt;br /&gt;
\\&lt;br /&gt;
\end{align}&lt;br /&gt;
\quad &amp;amp;&lt;br /&gt;
\begin{align} f_{uv}&amp;amp;\le c_{uv} &amp;amp;\quad&amp;amp; \forall (u,v)\in E\\&lt;br /&gt;
\sum_{u:(u,v)\in E}f_{uv}-\sum_{w:(v,w)\in E}f_{vw} &amp;amp;=0 &amp;amp;\quad&amp;amp; \forall v\in V\setminus\{s,t\}\\&lt;br /&gt;
 f_{uv}&amp;amp;\ge 0 &amp;amp;\quad&amp;amp; \forall (u,v)\in E&lt;br /&gt;
\end{align}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Cuts ===&lt;br /&gt;
{{Theorem|Definition|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;(G(V,E),c,s,t)&amp;lt;/math&amp;gt; be a flow network. Let &amp;lt;math&amp;gt;S\subset V&amp;lt;/math&amp;gt;. We call &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; an &#039;&#039;&#039;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut&#039;&#039;&#039; if &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;.&lt;br /&gt;
:The &#039;&#039;&#039;value&#039;&#039;&#039; of  the cut (also called the &#039;&#039;&#039;capacity&#039;&#039;&#039; of the cut) is defined as &amp;lt;math&amp;gt;\sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A fundamental fact in the theory of flow is that cuts always upper bound flows.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Lemma|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;(G(V,E),c,s,t)&amp;lt;/math&amp;gt; be a flow network. Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be an arbitrary flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; be an arbitrary &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\sum_{v:(s,v)}f_{sv}\le \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;,&lt;br /&gt;
:that is, the value of any flow is no greater than the value of any cut.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|By the definition of &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut, &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Due to the conservation of flow, &lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{u\in S}\left(\sum_{v:(u,v)\in E}f_{uv}-\sum_{v:(v,u)\in E}f_{vu}\right)=\sum_{v:(s,v)\in E}f_{sv}+\sum_{u\in S\setminus\{s\}}\left(\sum_{v:(u,v)\in E}f_{uv}-\sum_{v:(v,u)\in E}f_{vu}\right)=\sum_{v:(s,v)\in E}f_{sv}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
On the other hand, summing flow over edges,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v\in S}\left(\sum_{u:(u,v)\in E}f_{uv}-\sum_{u:(v,u)\in E}f_{vu}\right)=\sum_{u\in S,v\in S\atop (u,v)\in E}\left(f_{uv}-f_{uv}\right)+\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}=\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}=\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}\le\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}\le  \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}\,,&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The augmenting paths ===&lt;br /&gt;
{{Theorem|Definition (Augmenting path)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be a flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. An &#039;&#039;&#039;augmenting path to &amp;lt;math&amp;gt;u_k&amp;lt;/math&amp;gt;&#039;&#039;&#039; is a sequence of distinct vertices &amp;lt;math&amp;gt;P=(u_0,u_1,\cdots, u_k)&amp;lt;/math&amp;gt;, such that &lt;br /&gt;
:* &amp;lt;math&amp;gt;u_0=s\,&amp;lt;/math&amp;gt;;&lt;br /&gt;
:and each pair of consecutive vertices &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; corresponds to either a &#039;&#039;&#039;forward edge&#039;&#039;&#039; &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; or a &#039;&#039;&#039;reverse edge&#039;&#039;&#039; &amp;lt;math&amp;gt;(u_{i+1},u_{i})\in E&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:* &amp;lt;math&amp;gt;f(u_i,u_{i+1})&amp;lt;c(u_i,u_{i+1})\,&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; corresponds to a forward edge &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:* &amp;lt;math&amp;gt;f(u_{i+1},u_i)&amp;gt;0\,&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; corresponds to a reverse edge &amp;lt;math&amp;gt;(u_{i+1},u_{i})\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
:If &amp;lt;math&amp;gt;u_k=t\,&amp;lt;/math&amp;gt;, we simply call &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; an &#039;&#039;&#039;augmenting path&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be a flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. Suppose there is an augmenting path &amp;lt;math&amp;gt;P=u_0u_1\cdots u_k&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;u_0=s&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u_k=t&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;\epsilon&amp;gt;0&amp;lt;/math&amp;gt; be a positive constant satisfying &lt;br /&gt;
*&amp;lt;math&amp;gt;\epsilon \le c(u_{i},u_{i+1})-f(u_i,u_{i+1})&amp;lt;/math&amp;gt; for all forward edges &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;;&lt;br /&gt;
*&amp;lt;math&amp;gt;\epsilon \le f(u_{i+1},u_i)&amp;lt;/math&amp;gt; for all reverse edges &amp;lt;math&amp;gt;(u_{i+1},u_i)\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
Due to the definition of augmenting path, we can always find such a positive &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Increase &amp;lt;math&amp;gt;f(u_i,u_{i+1})&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; for all forward edges &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; and decrease &amp;lt;math&amp;gt;f(u_{i+1},u_i)&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; for all reverse edges &amp;lt;math&amp;gt;(u_{i+1},u_i)\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;. Denote the modified flow by &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt;. It is easy to see that &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt; satisfies the capacity constraint and conservation constraint thus is still a valid flow. On the other hand, the value of the new flow &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&#039;=\epsilon+\sum_{v:(s,v)\in E}f_{sv}&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Therefore, the value of the flow can be &amp;quot;augmented&amp;quot; by adjusting the flow on the augmenting path. This immediately implies that if a flow is maximum, then there is no augmenting path. Surprisingly, the converse is also true, thus maximum flows are &amp;quot;characterized&amp;quot; by augmenting paths.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Lemma|&lt;br /&gt;
:A flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is maximum if and only if there are no augmenting paths.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|We have already proved the &amp;quot;only if&amp;quot; direction above. Now we prove the &amp;quot;if&amp;quot; direction.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S=\{u\in V\mid \exists\text{an augmenting path to }u\}&amp;lt;/math&amp;gt;. Clearly &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt;, and since there is no augmenting path &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;. Therefore, &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; defines an &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The max-flow min-cut theorem ===&lt;br /&gt;
&lt;br /&gt;
== Unimodularity ==&lt;br /&gt;
&lt;br /&gt;
=== Integrality of polytopes ===&lt;br /&gt;
&lt;br /&gt;
=== Unimodularity and total unimodularity ===&lt;/div&gt;</summary>
		<author><name>172.21.3.81</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Flow_and_matching&amp;diff=4288</id>
		<title>Combinatorics (Fall 2010)/Flow and matching</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Flow_and_matching&amp;diff=4288"/>
		<updated>2010-12-24T12:05:34Z</updated>

		<summary type="html">&lt;p&gt;172.21.3.81: /* The augmenting paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flow ==&lt;br /&gt;
&lt;br /&gt;
=== The maximum flow problem ===&lt;br /&gt;
An instance of the maximum flow problem consists of:&lt;br /&gt;
* a directed graph &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt;;&lt;br /&gt;
* two distinguished vertices &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; (the &#039;&#039;&#039;source&#039;&#039;&#039;) and &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; (the &#039;&#039;&#039;sink&#039;&#039;&#039;), where the in-degree of &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; and the out-degree of &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; are both 0;&lt;br /&gt;
* the &#039;&#039;&#039;capacity function&#039;&#039;&#039;  &amp;lt;math&amp;gt;c:E\rightarrow\mathbb{R}^+&amp;lt;/math&amp;gt; which associates each directed edge &amp;lt;math&amp;gt;(u,v)\in E&amp;lt;/math&amp;gt; a nonnegative real number &amp;lt;math&amp;gt;c_{uv}&amp;lt;/math&amp;gt; called the &#039;&#039;&#039;capacity&#039;&#039;&#039; of the edge.&lt;br /&gt;
&lt;br /&gt;
The quadruple &amp;lt;math&amp;gt;(G,c,s,t)&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;flow network&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A function &amp;lt;math&amp;gt;f:E\rightarrow\mathbb{R}^+&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;flow&#039;&#039;&#039; (or an &#039;&#039;&#039;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; flow&#039;&#039;&#039;) in the network &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; if it satisfies:&lt;br /&gt;
* &#039;&#039;&#039;Capacity constraint:&#039;&#039;&#039; &amp;lt;math&amp;gt;f_{uv}\le c_{uv}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;(u,v)\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Conservation constraint:&#039;&#039;&#039; &amp;lt;math&amp;gt;\sum_{u:(u,v)\in E}f_{uv}=\sum_{w:(v,w)\in E}f_{vw}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;v\in V\setminus\{s,t\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;value&#039;&#039;&#039; of the flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Given a flow network, the maximum flow problem asks to find the flow of the maximum value.&lt;br /&gt;
&lt;br /&gt;
The maximum flow problem can be described as the following linear program.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{maximize} \quad&amp;amp; \sum_{v:(s,v)\in E}f_{sv}\\&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{subject to} \\&lt;br /&gt;
\\&lt;br /&gt;
\\&lt;br /&gt;
\\&lt;br /&gt;
\end{align}&lt;br /&gt;
\quad &amp;amp;&lt;br /&gt;
\begin{align} f_{uv}&amp;amp;\le c_{uv} &amp;amp;\quad&amp;amp; \forall (u,v)\in E\\&lt;br /&gt;
\sum_{u:(u,v)\in E}f_{uv}-\sum_{w:(v,w)\in E}f_{vw} &amp;amp;=0 &amp;amp;\quad&amp;amp; \forall v\in V\setminus\{s,t\}\\&lt;br /&gt;
 f_{uv}&amp;amp;\ge 0 &amp;amp;\quad&amp;amp; \forall (u,v)\in E&lt;br /&gt;
\end{align}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Cuts ===&lt;br /&gt;
{{Theorem|Definition|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;(G(V,E),c,s,t)&amp;lt;/math&amp;gt; be a flow network. Let &amp;lt;math&amp;gt;S\subset V&amp;lt;/math&amp;gt;. We call &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; an &#039;&#039;&#039;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut&#039;&#039;&#039; if &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;.&lt;br /&gt;
:The &#039;&#039;&#039;value&#039;&#039;&#039; of  the cut (also called the &#039;&#039;&#039;capacity&#039;&#039;&#039; of the cut) is defined as &amp;lt;math&amp;gt;\sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A fundamental fact in the theory of flow is that cuts always upper bound flows.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Lemma|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;(G(V,E),c,s,t)&amp;lt;/math&amp;gt; be a flow network. Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be an arbitrary flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; be an arbitrary &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\sum_{v:(s,v)}f_{sv}\le \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;,&lt;br /&gt;
:that is, the value of any flow is no greater than the value of any cut.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|By the definition of &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut, &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Due to the conservation of flow, &lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{u\in S}\left(\sum_{v:(u,v)\in E}f_{uv}-\sum_{v:(v,u)\in E}f_{vu}\right)=\sum_{v:(s,v)\in E}f_{sv}+\sum_{u\in S\setminus\{s\}}\left(\sum_{v:(u,v)\in E}f_{uv}-\sum_{v:(v,u)\in E}f_{vu}\right)=\sum_{v:(s,v)\in E}f_{sv}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
On the other hand, summing flow over edges,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v\in S}\left(\sum_{u:(u,v)\in E}f_{uv}-\sum_{u:(v,u)\in E}f_{vu}\right)=\sum_{u\in S,v\in S\atop (u,v)\in E}\left(f_{uv}-f_{uv}\right)+\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}=\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}=\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}\le\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}\le  \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}\,,&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The augmenting paths ===&lt;br /&gt;
{{Theorem|Definition (Augmenting path)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be a flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. An &#039;&#039;&#039;augmenting path to &amp;lt;math&amp;gt;u_k&amp;lt;/math&amp;gt;&#039;&#039;&#039; is a sequence of distinct vertices &amp;lt;math&amp;gt;P=(u_0,u_1,\cdots, u_k)&amp;lt;/math&amp;gt;, such that &lt;br /&gt;
:* &amp;lt;math&amp;gt;u_0=s\,&amp;lt;/math&amp;gt;;&lt;br /&gt;
:and each pair of consecutive vertices &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; corresponds to either a &#039;&#039;&#039;forward edge&#039;&#039;&#039; &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; or a &#039;&#039;&#039;reverse edge&#039;&#039;&#039; &amp;lt;math&amp;gt;(u_{i+1},u_{i})\in E&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:* &amp;lt;math&amp;gt;f(u_i,u_{i+1})&amp;lt;c(u_i,u_{i+1})\,&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; corresponds to a forward edge &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:* &amp;lt;math&amp;gt;f(u_{i+1},u_i)&amp;gt;0\,&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; corresponds to a reverse edge &amp;lt;math&amp;gt;(u_{i+1},u_{i})\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
:If &amp;lt;math&amp;gt;u_k=t\,&amp;lt;/math&amp;gt;, we simply call &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; an &#039;&#039;&#039;augmenting path&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be a flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. Suppose there is an augmenting path &amp;lt;math&amp;gt;P=u_0u_1\cdots u_k&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;u_0=s&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u_k=t&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;\epsilon&amp;gt;0&amp;lt;/math&amp;gt; be a positive constant satisfying &lt;br /&gt;
*&amp;lt;math&amp;gt;\epsilon \le c(u_{i},u_{i+1})-f(u_i,u_{i+1})&amp;lt;/math&amp;gt; for all forward edges &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;;&lt;br /&gt;
*&amp;lt;math&amp;gt;\epsilon \le f(u_{i+1},u_i)&amp;lt;/math&amp;gt; for all reverse edges &amp;lt;math&amp;gt;(u_{i+1},u_i)\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
Due to the definition of augmenting path, we can always find such a positive &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Increase &amp;lt;math&amp;gt;f(u_i,u_{i+1})&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; for all forward edges &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; and decrease &amp;lt;math&amp;gt;f(u_{i+1},u_i)&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; for all reverse edges &amp;lt;math&amp;gt;(u_{i+1},u_i)\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;. Denote the modified flow by &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt;. It is easy to see that &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt; satisfies the capacity constraint and conservation constraint thus is still a valid flow. On the other hand, the value of the new flow &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&#039;=\epsilon+\sum_{v:(s,v)\in E}f_{sv}&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Therefore, the value of the flow can be &amp;quot;augmented&amp;quot; by adjusting the flow on the augmenting path. This immediately implies that if a flow is maximum, then there is no augmenting path. Surprisingly, the converse is also true, thus maximum flows are &amp;quot;characterized&amp;quot; by augmenting paths.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Lemma|&lt;br /&gt;
:A flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is maximum if and only if there are no augmenting paths.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|We have already proved the &amp;quot;only if&amp;quot; direction above. Now we prove the &amp;quot;if&amp;quot; direction.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S=\{u\in V\mid \exists\text{an augmenting path to }u\}&amp;lt;/math&amp;gt;. Clearly &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt;, and since there is no augmenting path &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;. Therefore, &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The max-flow min-cut theorem ===&lt;br /&gt;
&lt;br /&gt;
== Unimodularity ==&lt;br /&gt;
&lt;br /&gt;
=== Integrality of polytopes ===&lt;br /&gt;
&lt;br /&gt;
=== Unimodularity and total unimodularity ===&lt;/div&gt;</summary>
		<author><name>172.21.3.81</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Flow_and_matching&amp;diff=4287</id>
		<title>Combinatorics (Fall 2010)/Flow and matching</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Flow_and_matching&amp;diff=4287"/>
		<updated>2010-12-24T12:02:56Z</updated>

		<summary type="html">&lt;p&gt;172.21.3.81: /* Cuts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Flow ==&lt;br /&gt;
&lt;br /&gt;
=== The maximum flow problem ===&lt;br /&gt;
An instance of the maximum flow problem consists of:&lt;br /&gt;
* a directed graph &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt;;&lt;br /&gt;
* two distinguished vertices &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; (the &#039;&#039;&#039;source&#039;&#039;&#039;) and &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; (the &#039;&#039;&#039;sink&#039;&#039;&#039;), where the in-degree of &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt; and the out-degree of &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; are both 0;&lt;br /&gt;
* the &#039;&#039;&#039;capacity function&#039;&#039;&#039;  &amp;lt;math&amp;gt;c:E\rightarrow\mathbb{R}^+&amp;lt;/math&amp;gt; which associates each directed edge &amp;lt;math&amp;gt;(u,v)\in E&amp;lt;/math&amp;gt; a nonnegative real number &amp;lt;math&amp;gt;c_{uv}&amp;lt;/math&amp;gt; called the &#039;&#039;&#039;capacity&#039;&#039;&#039; of the edge.&lt;br /&gt;
&lt;br /&gt;
The quadruple &amp;lt;math&amp;gt;(G,c,s,t)&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;flow network&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A function &amp;lt;math&amp;gt;f:E\rightarrow\mathbb{R}^+&amp;lt;/math&amp;gt; is called a &#039;&#039;&#039;flow&#039;&#039;&#039; (or an &#039;&#039;&#039;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; flow&#039;&#039;&#039;) in the network &amp;lt;math&amp;gt;G(V,E)&amp;lt;/math&amp;gt; if it satisfies:&lt;br /&gt;
* &#039;&#039;&#039;Capacity constraint:&#039;&#039;&#039; &amp;lt;math&amp;gt;f_{uv}\le c_{uv}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;(u,v)\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Conservation constraint:&#039;&#039;&#039; &amp;lt;math&amp;gt;\sum_{u:(u,v)\in E}f_{uv}=\sum_{w:(v,w)\in E}f_{vw}&amp;lt;/math&amp;gt; for all &amp;lt;math&amp;gt;v\in V\setminus\{s,t\}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;value&#039;&#039;&#039; of the flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Given a flow network, the maximum flow problem asks to find the flow of the maximum value.&lt;br /&gt;
&lt;br /&gt;
The maximum flow problem can be described as the following linear program.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{maximize} \quad&amp;amp; \sum_{v:(s,v)\in E}f_{sv}\\&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{subject to} \\&lt;br /&gt;
\\&lt;br /&gt;
\\&lt;br /&gt;
\\&lt;br /&gt;
\end{align}&lt;br /&gt;
\quad &amp;amp;&lt;br /&gt;
\begin{align} f_{uv}&amp;amp;\le c_{uv} &amp;amp;\quad&amp;amp; \forall (u,v)\in E\\&lt;br /&gt;
\sum_{u:(u,v)\in E}f_{uv}-\sum_{w:(v,w)\in E}f_{vw} &amp;amp;=0 &amp;amp;\quad&amp;amp; \forall v\in V\setminus\{s,t\}\\&lt;br /&gt;
 f_{uv}&amp;amp;\ge 0 &amp;amp;\quad&amp;amp; \forall (u,v)\in E&lt;br /&gt;
\end{align}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Cuts ===&lt;br /&gt;
{{Theorem|Definition|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;(G(V,E),c,s,t)&amp;lt;/math&amp;gt; be a flow network. Let &amp;lt;math&amp;gt;S\subset V&amp;lt;/math&amp;gt;. We call &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; an &#039;&#039;&#039;&amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut&#039;&#039;&#039; if &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;.&lt;br /&gt;
:The &#039;&#039;&#039;value&#039;&#039;&#039; of  the cut (also called the &#039;&#039;&#039;capacity&#039;&#039;&#039; of the cut) is defined as &amp;lt;math&amp;gt;\sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A fundamental fact in the theory of flow is that cuts always upper bound flows.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Lemma|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;(G(V,E),c,s,t)&amp;lt;/math&amp;gt; be a flow network. Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be an arbitrary flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;(S,\bar{S})&amp;lt;/math&amp;gt; be an arbitrary &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\sum_{v:(s,v)}f_{sv}\le \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}&amp;lt;/math&amp;gt;,&lt;br /&gt;
:that is, the value of any flow is no greater than the value of any cut.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|By the definition of &amp;lt;math&amp;gt;s&amp;lt;/math&amp;gt;-&amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; cut, &amp;lt;math&amp;gt;s\in S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t\not\in S&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Due to the conservation of flow, &lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{u\in S}\left(\sum_{v:(u,v)\in E}f_{uv}-\sum_{v:(v,u)\in E}f_{vu}\right)=\sum_{v:(s,v)\in E}f_{sv}+\sum_{u\in S\setminus\{s\}}\left(\sum_{v:(u,v)\in E}f_{uv}-\sum_{v:(v,u)\in E}f_{vu}\right)=\sum_{v:(s,v)\in E}f_{sv}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
On the other hand, summing flow over edges,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v\in S}\left(\sum_{u:(u,v)\in E}f_{uv}-\sum_{u:(v,u)\in E}f_{vu}\right)=\sum_{u\in S,v\in S\atop (u,v)\in E}\left(f_{uv}-f_{uv}\right)+\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}=\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}=\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}-\sum_{u\in S,v\not\in S\atop (v,u)\in E}f_{vu}\le\sum_{u\in S,v\not\in S\atop (u,v)\in E}f_{uv}\le  \sum_{u\in S,v\not\in S\atop (u,v)\in E}c_{uv}\,,&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The augmenting paths ===&lt;br /&gt;
{{Theorem|Definition (Augmenting path)|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be a flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. An &#039;&#039;&#039;augmenting path to &amp;lt;math&amp;gt;u_k&amp;lt;/math&amp;gt;&#039;&#039;&#039; is a sequence of distinct vertices &amp;lt;math&amp;gt;P=(u_0,u_1,\cdots, u_k)&amp;lt;/math&amp;gt;, such that &lt;br /&gt;
:* &amp;lt;math&amp;gt;u_0=s\,&amp;lt;/math&amp;gt;;&lt;br /&gt;
:and each pair of consecutive vertices &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; corresponds to either a &#039;&#039;&#039;forward edge&#039;&#039;&#039; &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; or a &#039;&#039;&#039;reverse edge&#039;&#039;&#039; &amp;lt;math&amp;gt;(u_{i+1},u_{i})\in E&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:* &amp;lt;math&amp;gt;f(u_i,u_{i+1})&amp;lt;c(u_i,u_{i+1})\,&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; corresponds to a forward edge &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt;, and &lt;br /&gt;
:* &amp;lt;math&amp;gt;f(u_{i+1},u_i)&amp;gt;0\,&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;u_{i}u_{i+1}\,&amp;lt;/math&amp;gt; corresponds to a reverse edge &amp;lt;math&amp;gt;(u_{i+1},u_{i})\in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
:If &amp;lt;math&amp;gt;u_k=t\,&amp;lt;/math&amp;gt;, we simply call &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; an &#039;&#039;&#039;augmenting path&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; be a flow in &amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;. Suppose there is an augmenting path &amp;lt;math&amp;gt;P=u_0u_1\cdots u_k&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;u_0=s&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u_k=t&amp;lt;/math&amp;gt;. Let &amp;lt;math&amp;gt;\epsilon&amp;gt;0&amp;lt;/math&amp;gt; be a positive constant satisfying &lt;br /&gt;
*&amp;lt;math&amp;gt;\epsilon \le c(u_{i},u_{i+1})-f(u_i,u_{i+1})&amp;lt;/math&amp;gt; for all forward edges &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;;&lt;br /&gt;
*&amp;lt;math&amp;gt;\epsilon \le f(u_{i+1},u_i)&amp;lt;/math&amp;gt; for all reverse edges &amp;lt;math&amp;gt;(u_{i+1},u_i)\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
Due to the definition of augmenting path, we can always find such a positive &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Increase &amp;lt;math&amp;gt;f(u_i,u_{i+1})&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; for all forward edges &amp;lt;math&amp;gt;(u_{i},u_{i+1})\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; and decrease &amp;lt;math&amp;gt;f(u_{i+1},u_i)&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; for all reverse edges &amp;lt;math&amp;gt;(u_{i+1},u_i)\in E&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;. Denote the modified flow by &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt;. It is easy to see that &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt; satisfies the capacity constraint and conservation constraint thus is still a valid flow. On the other hand, the value of the new flow &amp;lt;math&amp;gt;f&#039;&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&#039;=\epsilon+\sum_{v:(s,v)\in E}f_{sv}&amp;gt;\sum_{v:(s,v)\in E}f_{sv}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Therefore, the value of the flow can be &amp;quot;augmented&amp;quot; by adjusting the flow on the augmenting path. This immediately implies that if a flow is maximum, then there is no augmenting path. Surprisingly, the converse is also true, thus maximum flows are &amp;quot;characterized&amp;quot; by augmenting paths.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Lemma|&lt;br /&gt;
:A flow &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is maximum if and only if there are no augmenting paths.&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|We have already proved the &amp;quot;only if&amp;quot; direction above. Now we prove the &amp;quot;if&amp;quot; direction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== The max-flow min-cut theorem ===&lt;br /&gt;
&lt;br /&gt;
== Unimodularity ==&lt;br /&gt;
&lt;br /&gt;
=== Integrality of polytopes ===&lt;br /&gt;
&lt;br /&gt;
=== Unimodularity and total unimodularity ===&lt;/div&gt;</summary>
		<author><name>172.21.3.81</name></author>
	</entry>
</feed>