Added "applications" section
This commit is contained in:
@ -1,128 +1,123 @@
|
||||
\documentclass[../main.tex]{subfiles}
|
||||
|
||||
\section{The Ford-Fulkerson Algorithm}
|
||||
We now have all the tools we need to construct an algorithm that finds a maximal flow. \\
|
||||
It works as follows:
|
||||
\begin{enumerate}
|
||||
\item[\texttt{00}] Take a weighted directed graph $G$.
|
||||
\item[\texttt{01}] Find any flow $F$ in $G$
|
||||
\item[\texttt{02}] Calculate $R$, the residual of $F$.
|
||||
\item[\texttt{03}] ~~~~If $S$ and $T$ are not connected in $R$, $F$ is a maximal flow. \texttt{HALT}.
|
||||
\item[\texttt{04}] Otherwise, find another flow $F_0$ in $R$.
|
||||
\item[\texttt{05}] Add $F_0$ to $F$
|
||||
\item[\texttt{06}] \texttt{GOTO 02}
|
||||
\end{enumerate}
|
||||
|
||||
\begin{document}
|
||||
\problem{}
|
||||
Run the Ford-Fulkerson algorithm on the following graph. \\
|
||||
There is extra space on the next page.
|
||||
|
||||
\section{The Ford-Fulkerson Algorithm}
|
||||
We now have all the tools we need to construct an algorithm that finds a maximal flow. \\
|
||||
It works as follows:
|
||||
\begin{enumerate}
|
||||
\item[\texttt{00}] Take a weighted directed graph $G$.
|
||||
\item[\texttt{01}] Find any flow $F$ in $G$
|
||||
\item[\texttt{02}] Calculate $R$, the residual of $F$.
|
||||
\item[\texttt{03}] ~~~~If $S$ and $T$ are not connected in $R$, $F$ is a maximal flow. \texttt{HALT}.
|
||||
\item[\texttt{04}] Otherwise, find another flow $F_0$ in $R$.
|
||||
\item[\texttt{05}] Add $F_0$ to $F$
|
||||
\item[\texttt{06}] \texttt{GOTO 02}
|
||||
\end{enumerate}
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
% Nodes
|
||||
\begin{scope}[layer = nodes]
|
||||
\node[main] (S) at (-5mm, 0mm) {$S$};
|
||||
\node[main] (A) at (20mm, 20mm) {$A$};
|
||||
\node[main] (B) at (20mm, 0mm) {$B$};
|
||||
\node[main] (C) at (20mm, -20mm) {$C$};
|
||||
\node[main] (D) at (50mm, 20mm) {$D$};
|
||||
\node[main] (E) at (50mm, 0mm) {$E$};
|
||||
\node[main] (F) at (50mm, -20mm) {$F$};
|
||||
\node[main] (T) at (75mm, 0mm) {$T$};
|
||||
\end{scope}
|
||||
|
||||
\problem{}
|
||||
Run the Ford-Fulkerson algorithm on the following graph. \\
|
||||
There is extra space on the next page.
|
||||
% Edges
|
||||
\draw[->]
|
||||
(S) edge node[label] {$8$} (A)
|
||||
(S) edge node[label] {$7$} (B)
|
||||
(S) edge node[label] {$4$} (C)
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
% Nodes
|
||||
\begin{scope}[layer = nodes]
|
||||
\node[main] (S) at (-5mm, 0mm) {$S$};
|
||||
\node[main] (A) at (20mm, 20mm) {$A$};
|
||||
\node[main] (B) at (20mm, 0mm) {$B$};
|
||||
\node[main] (C) at (20mm, -20mm) {$C$};
|
||||
\node[main] (D) at (50mm, 20mm) {$D$};
|
||||
\node[main] (E) at (50mm, 0mm) {$E$};
|
||||
\node[main] (F) at (50mm, -20mm) {$F$};
|
||||
\node[main] (T) at (75mm, 0mm) {$T$};
|
||||
\end{scope}
|
||||
(A) edge node[label] {$2$} (B)
|
||||
(B) edge node[label] {$5$} (C)
|
||||
|
||||
% Edges
|
||||
\draw[->]
|
||||
(S) edge node[label] {$8$} (A)
|
||||
(S) edge node[label] {$7$} (B)
|
||||
(S) edge node[label] {$4$} (C)
|
||||
(A) edge node[label] {$3$} (D)
|
||||
(A) edge node[label] {$9$} (E)
|
||||
(B) edge node[label] {$6$} (E)
|
||||
(C) edge node[label] {$7$} (E)
|
||||
(C) edge node[label] {$2$} (F)
|
||||
|
||||
(A) edge node[label] {$2$} (B)
|
||||
(B) edge node[label] {$5$} (C)
|
||||
(E) edge node[label] {$3$} (D)
|
||||
(E) edge node[label] {$4$} (F)
|
||||
|
||||
(A) edge node[label] {$3$} (D)
|
||||
(A) edge node[label] {$9$} (E)
|
||||
(B) edge node[label] {$6$} (E)
|
||||
(C) edge node[label] {$7$} (E)
|
||||
(C) edge node[label] {$2$} (F)
|
||||
(D) edge node[label] {$9$} (T)
|
||||
(E) edge node[label] {$5$} (T)
|
||||
(F) edge node[label] {$8$} (T)
|
||||
;
|
||||
|
||||
(E) edge node[label] {$3$} (D)
|
||||
(E) edge node[label] {$4$} (F)
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
(D) edge node[label] {$9$} (T)
|
||||
(E) edge node[label] {$5$} (T)
|
||||
(F) edge node[label] {$8$} (T)
|
||||
;
|
||||
\begin{solution}
|
||||
The maximum flow is $17$.
|
||||
\end{solution}
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
\vspace{5mm}
|
||||
|
||||
\begin{solution}
|
||||
The maximum flow is $17$.
|
||||
\end{solution}
|
||||
\pagebreak
|
||||
|
||||
\vspace{5mm}
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
% Nodes
|
||||
\begin{scope}[layer = nodes]
|
||||
\node[main] (S) at (-5mm, 0mm) {$S$};
|
||||
\node[main] (A) at (20mm, 20mm) {$A$};
|
||||
\node[main] (B) at (20mm, 0mm) {$B$};
|
||||
\node[main] (C) at (20mm, -20mm) {$C$};
|
||||
\node[main] (D) at (50mm, 20mm) {$D$};
|
||||
\node[main] (E) at (50mm, 0mm) {$E$};
|
||||
\node[main] (F) at (50mm, -20mm) {$F$};
|
||||
\node[main] (T) at (75mm, 0mm) {$T$};
|
||||
\end{scope}
|
||||
|
||||
\pagebreak
|
||||
% Edges
|
||||
\draw[->]
|
||||
(S) edge node[label] {$8$} (A)
|
||||
(S) edge node[label] {$7$} (B)
|
||||
(S) edge node[label] {$4$} (C)
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
% Nodes
|
||||
\begin{scope}[layer = nodes]
|
||||
\node[main] (S) at (-5mm, 0mm) {$S$};
|
||||
\node[main] (A) at (20mm, 20mm) {$A$};
|
||||
\node[main] (B) at (20mm, 0mm) {$B$};
|
||||
\node[main] (C) at (20mm, -20mm) {$C$};
|
||||
\node[main] (D) at (50mm, 20mm) {$D$};
|
||||
\node[main] (E) at (50mm, 0mm) {$E$};
|
||||
\node[main] (F) at (50mm, -20mm) {$F$};
|
||||
\node[main] (T) at (75mm, 0mm) {$T$};
|
||||
\end{scope}
|
||||
(A) edge node[label] {$2$} (B)
|
||||
(B) edge node[label] {$5$} (C)
|
||||
|
||||
% Edges
|
||||
\draw[->]
|
||||
(S) edge node[label] {$8$} (A)
|
||||
(S) edge node[label] {$7$} (B)
|
||||
(S) edge node[label] {$4$} (C)
|
||||
(A) edge node[label] {$3$} (D)
|
||||
(A) edge node[label] {$9$} (E)
|
||||
(B) edge node[label] {$6$} (E)
|
||||
(C) edge node[label] {$7$} (E)
|
||||
(C) edge node[label] {$2$} (F)
|
||||
|
||||
(A) edge node[label] {$2$} (B)
|
||||
(B) edge node[label] {$5$} (C)
|
||||
(E) edge node[label] {$3$} (D)
|
||||
(E) edge node[label] {$4$} (F)
|
||||
|
||||
(A) edge node[label] {$3$} (D)
|
||||
(A) edge node[label] {$9$} (E)
|
||||
(B) edge node[label] {$6$} (E)
|
||||
(C) edge node[label] {$7$} (E)
|
||||
(C) edge node[label] {$2$} (F)
|
||||
(D) edge node[label] {$9$} (T)
|
||||
(E) edge node[label] {$5$} (T)
|
||||
(F) edge node[label] {$8$} (T)
|
||||
;
|
||||
|
||||
(E) edge node[label] {$3$} (D)
|
||||
(E) edge node[label] {$4$} (F)
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
(D) edge node[label] {$9$} (T)
|
||||
(E) edge node[label] {$5$} (T)
|
||||
(F) edge node[label] {$8$} (T)
|
||||
;
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
\problem{}
|
||||
You are given a large network. How would you quickly find an upper bound for the number of iterations the Ford-Fulkerson algorithm will need to find a maximum flow?
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
\begin{solution}
|
||||
Each iteration adds at least one unit of flow. So, we will find a maximum flow in at most $\min(\text{flow out of } S,~\text{flow into } T)$ iterations.
|
||||
|
||||
\problem{}
|
||||
You are given a large network. How would you quickly find an upper bound for the number of iterations the Ford-Fulkerson algorithm will need to find a maximum flow?
|
||||
\vspace{2ex}
|
||||
|
||||
\begin{solution}
|
||||
Each iteration adds at least one unit of flow. So, we will find a maximum flow in at most $\min(\text{flow out of } S,~\text{flow into } T)$ iterations.
|
||||
A simpler answer could only count the flow on $S$.
|
||||
|
||||
\vspace{2ex}
|
||||
\end{solution}
|
||||
|
||||
A simpler answer could only count the flow on $S$.
|
||||
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
\end{document}
|
||||
\vfill
|
||||
\pagebreak
|
Reference in New Issue
Block a user