\documentclass{article}
\usepackage[noend]{algpseudocode}
\usepackage[margin=1in]{geometry}
\usepackage{enumitem}
\setlist{wide,labelwidth=!,labelindent=0pt,topsep=0pt}
\usepackage{cprotect}
\usepackage{listings}
\usepackage{tikz-qtree}
\tikzset{every tree node/.style={minimum width=.1in,draw,circle},
blank/.style={draw=none},
edge from parent/.style=
{draw,edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}},
level distance=5mm}
\setlength{\headsep}{0.5 in}
\setlength{\parindent}{0 in}
\setlength{\parskip}{0.1 in}
\addtolength\topmargin{-1cm}
\textheight 9.4in
\usepackage{amsmath,amsfonts,graphicx,multicol, color}
\usepackage[normalem]{ulem}
\newcommand{\todo}{\textcolor{red}}
\newcommand{\red}{\textcolor{red}}
\usepackage{url}
%\def\IsSolution{1} % Uncomment to debug solutions. Note: Makefile generates both discussion and solution automatically.
%
% Define two macros
% \soln{} --- contents appear only in solution
% \notsoln{} --- contents appear only if not solution
\usepackage{etoolbox}
\ifx\IsSolution\undefined
\newcommand{\notsoln}[1]{#1}
\newcommand{\soln}[1]{}
\newcommand{\thesoln}[1]{}
\else
\newcommand{\notsoln}[1]{}
\newcommand{\soln}[1]{#1}
\newcommand{\thesoln}[1]{{\color{red}\textbf{Solution:} #1}}
\fi
%
% The following macro is used to generate the header.
%
\newcommand{\header}[1]{
\pagestyle{myheadings}
\thispagestyle{plain}
\newpage
\setcounter{page}{1}
\noindent
\begin{center}
\framebox{
\vbox{\vspace{2mm}
\hbox to 6.28in { {\bf COMPSCI 311: Introduction to Algorithms
\hfill Spring 2020} }
\vspace{4mm}
\hbox to 6.28in { {\Large \hfill Homework #1 \soln{Solutions} \hfill } }
\vspace{2mm}
\hbox to 6.28in { Released 4/2/2020 \hfill Due 4/15/2020 11:59pm in Gradescope}
\vspace{2mm}}
}
\end{center}
\markboth{Homework #1}{Homework #1}
% \vspace*{4mm}
}
\newcounter{problem}
\newcommand{\prob}{\addtocounter{problem}{1}\noindent {\bf Problem \theproblem.} ~}
\begin{document}
\header{5}
\textbf{Instructions.} You may work in groups, but you must write solutions yourself.
List collaborators on your submission. Also list any sources of help (including online
sources) other than the textbook and course staff.
If you are asked to design an algorithm, please provide: (a) the pseudocode or precise description in words of the algorithm, (b) an explanation of the intuition for the algorithm, (c) a proof of correctness, (d) the running time of your algorithm and (e) justification for your running time analysis.
%\medskip
\textbf{Submissions.} Please submit a PDF file. You may submit a scanned handwritten document, but a typed submission is preferred. Please assign pages to questions in Gradescope.
%\medskip
%\fbox{\textbf{Efficiency}. The algorithms you design should be polynomial-time, unless something else is stated.}
\begin{enumerate}[topsep=0pt]
\item (10 points) \textbf{Increasing Capacities} (K\&T 7.5) Prove the following claim or provide a counterexample:\\
Let $(A, B)$ be a minimum $s-t$ cut in a flow network. Add 1 to the capacity of every edge in the network. Then $(A, B)$ is still a minimum cut for the new network.
\item (10 points) \textbf{Greedy Flow} (Erickson 10.17) An eager student of network flow proposes the following change to the Ford-Fulkerson algorithm: instead of computing a residual graph, it looks for an augmenting path in the flow network, decreases edge capacities on the found path by the flow on this path, and repeats the process. Saturated edges just get deleted. Show that \textsc{GreedyFlow} does not compute a maximum flow.
\item (20 points) \textbf{Cold War Flow} Nation A is preparing for a potential armed conflict with Nation B. They are concerned with how many military units B could move at one time from their home base to the battlefield. They have modeled B's transportation network as a directed graph $G$, where \emph{every edge has the same capacity}, there is one source node at the base,
and one target node at the battlefield. They have computed that the maximum flow through this network is F.
A has a network of spies and saboteurs throughout B's territory. In the event of war, these agents could disable a fixed number $k$ of the edges in B's network. A's planners would like to compute which edges they should choose to reduce the capacity of B's network the most. Present an algorithm to let them do this, that takes as input $G$ and $k$ and gives a set of $k$ edges as output. Prove that your algorithm is correct, and find its big-O running time, which should be polynomial in $m$ (the number of edges in $G$).
\item (20 points) \textbf{Acyclic Flows} (Erickson 10.6) An $(s, t)$-flow in a network $G$ is \emph{acyclic} if there are no directed cycles with positive flow value on every edge; i.e., the subgraph of edges with positive flow value is a DAG.
\\(a) Describe and analyze an algorithm to compute an acyclic maximum $(s, t)$-flow in a given flow network. Your algorithm should have the same asymptotic running time as Ford-Fulkerson.
\\(b) Describe and analyze an algorithm to determine whether every maximum $(s, t)$-flow in a given flow network is acyclic.
\item \textbf{(20 points) Separating Edges} (Erickson 10.11) This problem explores defining a cut using a set of edges rather than a set of nodes.
We say that a subset $X$ of directed edges \emph{separates} $s$ and $t$ if every directed path from $s$ to $t$ contains at least one directed edge in $X$ . For any subset $S$ of vertices, let $\delta S$ denote the set of directed edges leaving $S$; that is, $\delta S := \{u \to v \mid u \in S, v \notin S\}$.
\\(a) Prove that if $(S, T)$ is an $(s, t)$-cut, then $\delta S$ separates $s$ and $t$.
\\(b) Let $X$ be any subset of edges that separates $s$ and $t$. Prove there is an $(s,t)$-cut $(S,T)$ such that $\delta S \subseteq X$.
\\(c) Let $X$ be a \emph{minimal} subset of edges that separates $s$ and $t$. (Such an edge set is sometimes called a \emph{bond}.)\linebreak Prove that there is an $(s, t)$-cut $(S,T)$ such that $\delta S = X$.
\item \textbf{(20 points) Incremental Change} (Erickson 10.14) You are given a flow network $G$ with integer edge capacities and an integer maximum flow $f^*$ in $G$. Design algorithms for the following operations:
\\(a) \textsc{Increment}($e$): Increase the capacity of edge $e$ by 1 and update the maximum flow.
\\(b) \textsc{Decrement}($e$): Decrease the capacity of edge $e$ by 1 and update the maximum flow.
\\Both algorithms should update the maximum flow in time $O(m+n)$.
\item \textbf{(0 points).} How long did it take you to complete this assignment?
\end{enumerate}
\end{document}