Skip to content

Commit

Permalink
network flow part 4
Browse files Browse the repository at this point in the history
  • Loading branch information
CaveNightingale committed May 6, 2024
1 parent a4c1a90 commit 3d9e022
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/component/content/Proof.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<span class="child">
<slot />
</span>
<span class="qed"></span>
<span class="qed"></span>
</div>

<style>
Expand Down
12 changes: 11 additions & 1 deletion src/routes/note/network-flow/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,17 @@ Dinic's Algorithm can terminate in $O(\sqrt{|V|}|E|)$ time for bipartite matchin

</State>

To be continued.
<Proof>

Since $c$ is constant $1$ for all edges, a visit to an edge either clear the capacity or find it has capacity $0$. Therefore, in a DFS between two BFS operations, the number of edges visited is at most $|E|$. Therefore, the time complexity for each DFS is $O(|E|)$.

Meanwhile, the flow in arbitrary iteration is integer-valued, it gives that the flow can be divide into several vertices-disjoint paths except the source $s$ and sink $t$ because if two paths share a vertex, there every vertices either only an in-degree (from the source $s$) or only an out-degree (to the sink $t$) with capacity $1$ and two paths violate the capacity constraint.

Consider we have relabeled the vertices $\sqrt{|V|}$ times, the number of vertices-disjoint paths is at least $\sqrt{|V|}$. According to the strictly increasing level of the sink $t$, the length of newly-found path is at least $\sqrt{|V|}$. Therefore, there are no more than $|V| / \sqrt{|V|} = \sqrt{|V|}$ extra vertices-disjoint paths to be found. Since number of iteration is no more than this, the total number of iteration is the $\sqrt{|V|}$ done iteration plus the $\sqrt{|V|}$ extra iteration, which is $O(\sqrt{|V|})$.

Therefore, the total time complexity is $O(\sqrt{|V|}|E|)$.

</Proof>

## Min-Cost Flow

Expand Down

0 comments on commit 3d9e022

Please sign in to comment.