\documentclass[10pt]{article}
\usepackage{times,graphicx,epstopdf,fancyhdr,amsfonts,amsthm,amsmath,url,algorithm,algorithmic,xspace}
\usepackage[left=.75in,top=.75in,right=.75in,bottom=.75in]{geometry}
\usepackage{tweaklist} % to tweak list spacings


\textwidth 7in
\textheight 9.5in

\pagestyle{fancy}

\begin{document}

\newtheorem{claim}{Claim}
\newtheorem{definition}{Definition}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{observation}{Observation}
\newtheorem{question}{Question}

\renewcommand{\itemhook}{\setlength{\topsep}{5pt}%
 \setlength{\itemsep}{0pt}}

% Comment out for single spacing
%\baselineskip 20pt

\lhead{Williams College}
\chead{Homework 6}
\rhead{Brent Heeringa}
\cfoot{Algorithm Design and Analysis - CS 256}
\lfoot{Due: 09.00,  13 April 2013}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\headwidth}{\textwidth}
\renewcommand{\footrulewidth}{0.4pt}

\begin{question}[KT 7.7] \label{q:7.7}
Consider a set of mobile computing clients in a certain town who each need to be connected to one of several possible {\em base stations.}  We'll suppose there are $n$ clients, with the position of each client specified by its $(x,y)$ coordinates in the plane.  There are also $k$ base stations; the position of each of these is specified by $(x,y)$ coordinates as well.

For each client, we wish to connect it to exactly one of the base stations.  Our choice of connections is constrained in the following ways.

\begin{itemize}
	\item There is a range parameter $r$ --- a client can only be connected to a base station that is within distance $r$.
	\item There is a load parameter $L$ --- no more than $L$ clients can be connected to any single base station.
\end{itemize}

Your goal is to design a polynomial time algorithm for the following problem.  Given the positions of a set of clients and a set of base stations, as well as the range and load parameters, decide whether every client can be connected simultaneously to a base station, subject to the range and load conditions in the previous paragraph.

\end{question}

\begin{quote}
{\bf Note:}  Question~\ref{q:7.7} helps you think about solving problems using the mathematical machinery of flow networks.  Notice that the problem is similar to the maximum bipartite matching problem we discussed in class:  you want to match clients to base stations subject to some constraints.  Hence, you will solve it by casting it into a maximum flow problem.  You have two opportunities to be creative.  First, you can play with network {\em topology} --- that is the arrangement and connectivity of nodes in the network.  Second, you can fiddle with edge {\em capacities}.   
\end{quote}

\begin{question}[KT 7.5]
Decide whether you think the following statement is true or false.  If it is true, give a short explanation.  If it is false, give a counterexample.
\begin{quote}
Let $G$ be an arbitrary flow network, with a source $s$, a sink $t$, and a positive integer capacity $c_{e}$ on every edge $e$; and let $(A,B)$ be a minimum s-t cut with respect to these capacities $\{c_{e} \,|\, e \in E\}$.  Now suppose we add 1 to every capacity; then $(A,B)$ is still a minimum s-t cut with respect to these new capacities $\{1+c_{e} \,|\, e \in E\}$.
\end{quote}
\end{question}

\begin{question}[KT 7.23] \label{q:7.23}
Suppose you're looking at a flow network $G$ with source $s$ and sink $t$, and you want to be able to express something like the following intuitive notion:  Some nodes are clearly on the "source side" of the main bottlenecks; some nodes are clearly on the ``sink side'' of the main bottlenecks; and some nodes are in the middle.  However, $G$ can have many minimum cuts, so we have to be careful in how we try making this idea precise.
Here's one way to divide the nodes of $G$ into three categories of this sort.
\begin{itemize}
	\item We say a node $v$ is {\em upstream} if, for all minimum $s$-$t$ cuts $(A,B)$, we have $v \in A$---that is, $v$ lies on the source side of every minimum cut.
	\item We say a node $v$ is {\em downstream} if, for all minimum $s$-$t$ cuts $(A,B)$, we have $v \in B$---that is, $v$ lies on the sink side of every minimum cut.
	\item We say a node $v$ is {\em central} if it is neither upstream nor downstream; there is at least one minimum $s$-$t$ cut $(A',B')$ for which $v \in A$, and at least one minimum $s$-$t$ cut $(A',B')$ for which $v \in B'$.
\end{itemize}
Give an algorithm that takes a flow network $G$ and classifies each of its nodes as being upstream, downstream, or central.  The running time of your algorithm should be within a constant factor of the time required to compute a {\em single} maximum flow.  {\em Hint:  think about running a BFS on the residual graph.}
\end{question}

\begin{question}[KT 7.24]
Let $G=(V,E)$ be a directed graph with source $s \in V$, sink $t \in V$, and non-negative edge capacities $\{c_{e}\}$.  Give a polynomial-time algorithm to decide whether $G$ has a {\em unique} minimum $s$-$t$ cut ({\em i.e.,} an $s$-$t$ cut of capacity strictly less than that of all other $s$-$t$ cuts).  {\em Hint:  Use your result from Question~\ref{q:7.23}}.
\end{question}

\begin{question}[KT 7.51 (extra credit)]
Some friends of yours have grown tired of the game ``Six Degrees of Kevin Bacon'' (after all, they ask, isn't it just breadth-first search?) and decide to invent a game with a little more punch, algorithmically speaking.  Here's how it works.

You start with a set $X$ of $n$ actresses and a set $Y$ of $n$ actors, and two players $P_{0}$ and $P_{1}$.  Player $P_{0}$ names an actress $x_{1} \in X$, player $P_{1}$ names an actor $y_{1}$ who has appeared in a movie with $x_{1}$, player $P_{0}$ names an actress $x_{2}$ who has appeared in a movie with $y_{1}$, and so on.  Thus, $P_{0}$ and $P_{1}$ collectively generate a sequence $x_{1}, y_{1}, x_{2}, y_{2}, \ldots$ such that each actor/actress in the sequence has costarred with the actress/actor immediately preceding.  A player $P_{i} (i=0,1)$ loses when it is $P_{i}$'s turn to move, and she cannot name a member of her set who hasn't been named before.

Suppose you are given a specific pair of such sets $X$ and $Y$, with complete information on who has appeared in a movie with whom.  A {\em strategy} for $P_{i}$ in our setting is an algorithm that takes a current sequence $x_{1}, y_{1}, x_{2}, y_{2}, \ldots$ and generates a legal next move for $P_{i}$ (assuming it's $P_{i}$'s turn to move).  Give a polynomial time algorithm that, given some instance of the game, decides at the start of the the game which of the two players can force a win.  {\em Hint: think about this problem as a maximum bipartite matching problem.  What happens when there is a perfect matching?  What if there is not a perfect matching?}
\end{question}

\end{document}




