\documentclass{article}
\usepackage[noend]{algpseudocode}
\usepackage[margin=1in]{geometry}
\usepackage{enumitem}
\usepackage{cprotect}
\usepackage{listings}
\usepackage{wrapfig}
\setlength{\headsep}{0.5 in}
\setlength{\parindent}{0 in}
\setlength{\parskip}{4pt}
\addtolength\topmargin{-1cm}
\textheight 9.25in
\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 Fall 2019} }
\vspace{4mm}
\hbox to 6.28in { {\Large \hfill Homework #1 \soln{Solutions} \hfill } }
\vspace{2mm}
\hbox to 6.28in { Released 11/05/2019 \hfill Due 11/21/2019 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.
\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.
1. \textbf{(16 points) Bottleneck capacity}\
If $G$ is a flow network and $s$, $t$ its source and sink, let $b(s, t)$ be the maximum value, over all $s \leadsto t$ paths, of the minimum capacity of all edges on the path.
Design an algorithm that computes $b(s, t)$ in $O(|E|\log |V|)$ time.
2. \textbf{24 points) Unique flows and cuts}
a) Design an efficient algorithm to determine whether a given flow network contains a unique maximum $(s, t)$-flow.
b) Design an efficient algorithm to determine whether a given flow network contains a unique minimum $(s, t)$-cut.
c) Give an example of a flow network that contains a unique maximum $(s, t)$-flow but does not contain a unique minimum $(s, t)$-cut.
d) Give an example of a flow network that contains a unique minimum $(s, t)$-cut but does not contain a unique maximum $(s, t)$-flow.
3. \textbf{(20 points) Reduce flows}\
Consider a flow network with unit-capacity edges: $c_e =1$ for every edge $e$. Design a polynomial-time algorithm that, given a number $k > 0$, finds a set of $k$ edges such that by removing these edges, the maximum flow in the resulting network is as small as possible.
4. \textbf{(20 points) Evacuation routes}\
Consider a directed graph $G = (V, E)$ and two disjoint sets of nodes $X, S \subset V$.
A set of \emph{evacuation routes} is a set of paths so that (i) each node in $X$ is the start of one path, and (ii) each path ends at a node in $S$.
a) Design an algorithm that decides in polynomial time whether a set of edge-disjoint of evacuation routes exists (that is, no two routes share an edge).
b) Design an algorithm that decides in polynomial time whether a set of vertex-disjoint of evacuation routes exists (that is, no two routes share a node).
5. \textbf{(20 points) Marking paths}\ Consider a directed graph $G = (V , E)$, a set $\{P_1,P_2,\dots,P_t\}$ of directed paths in $G$, and a number $k > 0$. The path marking problem asks if it is possible to mark at most $k$ nodes of $G$ so that each path $P_i$ includes at least one marked node.
a) Prove that path marking is NP-complete.
b) Assume you have an algorithm $A$ that produces yes/no answers to arbitrary instances of the path marking problem.
Using the algorithm $A$ as a black box, design an algorithm that takes input $G$, $\{P_i\}$, and $k$ as in part (a), and does one of the following two things:
(i) Outputs a set of at most $k$ nodes in $G$ so that each path $P_i$ includes at least one of these nodes, or
(ii) Outputs (correctly) that no such set of at most $k$ nodes exists.
Your algorithm should use at most a polynomial number of steps, together with at most a polynomial number of calls to the algorithm $A$.
6. \textbf{(0 points).} How long did it take you to complete this assignment?
\end{document}