%\documentstyle[10pt,twoside]{article}
%\documentstyle[twoside]{article}
\documentclass[twoside]{article}
\setlength{\oddsidemargin}{0 in}
\setlength{\evensidemargin}{0 in}
\setlength{\topmargin}{-0.6 in}
\setlength{\textwidth}{6.7 in}
\setlength{\textheight}{8.5 in}
\setlength{\headsep}{0.75 in}
\setlength{\parindent}{0 in}
\setlength{\parskip}{0.1 in}
\usepackage{amsmath,amssymb,enumerate,algorithm,ifthen,algorithmic}

% The following commands sets up the lecnum (lecture number)
% counter and make various numbering schemes work relative
% to the lecture number. Don't edit them!
%
\newcounter{lecnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\renewcommand{\thesection}{\thelecnum.\arabic{section}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thefigure}{\thelecnum.\arabic{figure}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}

\newtheorem{theorem}{Theorem} 
\newtheorem{lemma}{Lemma} 
\newtheorem{claim}{Claim} 
\newtheorem{proposition}{Proposition} 
\newtheorem{prob}{Problem} 
\newtheorem{corollary}{Corollary} 
\newtheorem{question}{Question} 
\newtheorem{conjecture}{Conjecture} 
\newtheorem{example}{Example} 
\newtheorem{definition}{Definition} 
\newtheorem{remarka}{Remark} 

\def\P{\mathop{\rm P}\nolimits}
\def\NP{\mathop{\rm NP}\nolimits}
\def\DTIME{\mathop{\rm DTIME}\nolimits}
\def\BPTIME{\mathop{\rm BPTIME}\nolimits}
\def\ZPTIME{\mathop{\rm ZPTIME}\nolimits}
\def\polylog{\mathop{\rm polylog}\nolimits}

\newenvironment{remark}{\begin{remarka}\rm}{\end{remarka}} 
\newenvironment{proof}{{\bf Proof.}}{\hfill\rule{2mm}{2mm}} 
\newenvironment{pproof}[1]{\noindent{\textbf{Proof of #1.}}}{\hfill\rule{2mm}{2mm}} 
\newcommand{\calI}{{\cal I}}
\newcommand{\calT}{{\cal T}}
\newcommand{\calP}{{\cal P}}
\newcommand{\opt}{\mbox{\sc opt}}
\newcommand{\OPT}{\mbox{\sc OPT}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\ie}{\emph{i.e. }}
% \newcommand{\si_ti}{$s_i \rightarrow t_i$}



%
% The following macro is used to generate the header.
%
\newcommand{\lecture}[5]{
   \pagestyle{myheadings}
   \thispagestyle{plain}
   \newpage
   \setcounter{lecnum}{#1}
   \setcounter{page}{1}
   \noindent
   \begin{center}
   \framebox{
      \vbox{\vspace{2mm}
    \hbox to 6.28in { {\bf CMPUT 675: Approximation Algorithms
                        \hfill Fall 2014} }
       \vspace{4mm}
       \hbox to 6.28in { {\Large \hfill Lecture #1 (#2): #3 \hfill} }
       \vspace{2mm}
       \hbox to 6.28in { {\it Lecturer: #4 \hfill Scribe: #5} }
      \vspace{2mm}}
   }
   \end{center}
   \markboth{Lecture #1: #3}{Lecture #1: #3}
   \vspace*{4mm}
}

%
% Convention for citations is authors' initials followed by the year.
% For example, to cite a paper by Leighton and Maggs you would type
% \cite{LM89}, and to cite a paper by Strassen you would type \cite{S69}.
% (To avoid bibliography problems, for now we redefine the \cite command.)
%
\renewcommand{\cite}[1]{[#1]}

\input{epsf}

%Use this command for a figure; it puts a figure in wherever you want it.
%usage: \fig{NUMBER}{FIGURE-SIZE}{CAPTION}{FILENAME}
\newcommand{\fig}[4]{
			\vspace{0.2 in}
			\setlength{\epsfxsize}{#2}
			\centerline{\epsfbox{#4}}
			\begin{center}
			Figure \thelecnum.#1:~#3
			\end{center}
	}

% Use these for theorems, lemmas, proofs, etc.

% Some useful equation alignment commands, borrowed from TeX
\makeatletter
\def\eqalign#1{\,\vcenter{\openup\jot\m@th
  \ialign{\strut\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil
      \crcr#1\crcr}}\,}
\def\eqalignno#1{\displ@y \tabskip\@centering
  \halign to\displaywidth{\hfil$\displaystyle{##}$\tabskip\z@skip
    &$\displaystyle{{}##}$\hfil\tabskip\@centering
    &\llap{$##$}\tabskip\z@skip\crcr
    #1\crcr}}
\def\leqalignno#1{\displ@y \tabskip\@centering
  \halign to\displaywidth{\hfil$\displaystyle{##}$\tabskip\z@skip
    &$\displaystyle{{}##}$\hfil\tabskip\@centering
    &\kern-\displaywidth\rlap{$##$}\tabskip\displaywidth\crcr
    #1\crcr}}
\makeatother

% **** IF YOU WANT TO DEFINE ADDITIONAL MACROS FOR YOURSELF, PUT THEM HERE:

% NOW START EDITING
\begin{document}
%FILL IN THE RIGHT INFO.
%\lecture{**LECTURE-NUMBER**}{**DATE**}{**LECTURER**}{**SCRIBE**}
\lecture{13}{Oct 1}{\textsc{Multicut} (Part 1)}{Zachary Friggstad}{Chris Martin}

% **** YOUR NOTES GO HERE:

\section{\textsc{Multicut}}

The \textsc{Multicut} problem given as follows. We are given an \emph{undirected} graph \(G = (V, E)\) with edge costs \(c_e \geq 0\), \(e \in E\), and \(k\) pairs of nodes \((s_1, t_1), \cdots (s_k, t_k)\) where \(s_i \neq t_i\) for all \(i\). The goal is to find the cheapest set of edges \(F \subseteq E\) such that all \((s_i, t_i)\) pairs are disconnected in the graph \((V, E - F)\) (\ie there is no \(s_i - t_i\) path in the new graph).
The problem can be solved in polynomial time when $k = 1$. For example, compute a maximum $s_1-t_1$ flow with edge capacities $c_e$ and find the set $S$ of all vertices reachable from $s_1$ in the residual graph;
the set $\delta(S)$ is a minimum-cost $s_1-t_1$ cut. For larger values of $k$, the problem is NP-hard.

This problem can be formulated as an integer program as follows. Let the binary variables \(x_e \in \{0,1\}\) denote whether edges \(e \in E\) are cut, and let
\(\mathcal{P}_i\) denote the set of all \(s_i - t_i\) paths. Note that the size of \(\mathcal{P}_i\) can be exponential in the worst case. The integer program is:

\begin{alignat}{3}
	\text{minimize:} & ~~\sum_{e \in E} c_e \cdot x_e \tag{\bf MC-IP}\label{ip:multicut}\\
	\text{subject to:} & ~~\sum_{e \in P} x_e \geq 1, \text{ for all } 1 \leq i \leq k, P \in \mathcal{P}_i\label{cnst1}\\
		& ~~x_e \in \{0,1\}, \text{ for all } e \in E.\label{cnst2}
\end{alignat}

Constraint \ref{cnst1} ensures that each \(s_i - t_i\) path has at least one edge cut, while the minimization objective function ensures that the minimum cost cut is obtained. The LP relaxation of this problem simply allows the variables \(x_e\) to be within the range [0,1]:

\begin{alignat}{3}
	\text{minimize:} & ~~\sum_{e \in E} c_e \cdot x_e \tag{\bf MC-LP}\label{lp:multicut}\\
	\text{subject to:} & ~~\sum_{e \in P} x_e \geq 1, \text{ for all } 1 \leq i \leq k, P \in \mathcal{P}_i\label{cnst3}\\
		& ~~x_e \in [0,1], \text{ for all } e \in E.\label{cnst4}
\end{alignat}

Since the \ref{lp:multicut} problem has exponentially many constraints, we cannot just use any polynomial-time LP solver to efficiently compute an optimum solution.
Instead, we must use a different approach.

\section{Separation Oracles}

\begin{definition}
Let \(\calP\) be the set of feasible solutions to an LP on \(n\) variables. A \textbf{separation oracle} for \(\calP\) is an algorithm that takes as input a potential LP solution \(\bar{x} \in \QQ^n\) and in time poly(\(n\), bit complexity of \(\bar{x}\)) either:
\begin{enumerate}
\item Correctly determines \(\bar{x} \in \mathcal{P}\), or
\item Produces a constraint separating \(\bar{x}\) from \(\calP\) (\ie a constraint that \(\bar{x}\) violates).
\end{enumerate}
\end{definition}

For example, a separation oracle for \ref{lp:multicut} is given by Algorithm \ref{alg:oracle}.

\begin{algorithm}
\caption{Oracle for \ref{lp:multicut}}
{\bf Input}: Undirected graph $G = (V,E)$, LP constraints $\mathcal{P}$ , and potential LP solution $\bar{x}$. \\
{\bf Output}: Accepts or provides a constraint that $\bar{x}$ violates.
\begin{algorithmic}[1]\label{alg:oracle}
\STATE{Check $\bar{x} \in [0,1]^E$}
\STATE{$G' \gets$ the graph $G$ with edge lengths $\bar{x}$}
\FOR{each $1 \leq i \leq k$}
\IF{the shortest $s_i - t_i$ path $P$ has length $< 1$}
\RETURN{The constraint corresponding to $P$}
\ENDIF
\ENDFOR
\RETURN ACCEPT
\end{algorithmic}
\end{algorithm}

This algorithm is correct: if the shortest \(s_i - t_i\) path has length $\geq 1$ then all constraints corresponding to paths from \(s_i\) to \(t_i\) must be satisfied since they are all longer.
If the shortest \(s_i-t_i\) path has length $< 1$ then such a shortest path $P$ corresponds to a violated constraint.

It turns out that having such a separation oracle is all that is needed for solving a linear program in polynomial time.
\begin{theorem}\label{thm:oracle}
A linear program $\min\{c^Tx : A \cdot x \geq b, x \geq 0\}$ with maximum bit complexity $\Delta$ and $x \in \QQ^n$ can be solved in time poly($n, \Delta$) if the feasible solutions admit a separation oracle.
Furthermore, if the linear program has an optimal solution then an extreme point optimum solution is returned.
\end{theorem}

The algorithm is known as the {\em Ellipsoid method}.
A full proof of this theorem, including the bit complexity analysis, can be found in the book {\em Combinatorial Optimization: Theory and Algorithms} by Korte and Vygen~\cite{KV00}.

Note that the running time does not depend on the number of constraints. Theorem \ref{thm:oracle} says that it is enough to efficiently separate over the constraints in order to solve a linear
program in polynomial time. Therefore, the \ref{lp:multicut} problem can be solved in polynomial time using the oracle given in Algorithm \ref{alg:oracle}.


\section{Solving \textsc{Multicut} Using \ref{lp:multicut} (Part 1)}

The algorithm for converting a solution to \ref{lp:multicut} into a solution for \textsc{Multicut} was given and proven correct in the lecture. However, the proofs of the integrality gap in Theorem \ref{thm:main} and the crucial Lemma \ref{lem:star} were delayed until the next lecture, so they will be assumed true for the time being.

Assume that an optimal solution ${\bf x}^*$
to the \ref{lp:multicut} problem has been computed. For vertices $u,v \in V$, let $d(u,v)$ be the shortest-path distance from $u$ to $v$ in $G$ where each edge $e \in E$ has length $x_e^*$.
Note that $d$ satisfies the triangle inequality since it is a shortest path metric.

\begin{definition}
Consider a subgraph $G'$ of $G$, a vertex $v$ in $G'$ and a {\em radius} $r \geq 0$.
The \textbf{ball} $B_{G'}(v,r)$ is the set of all vertices $u$ of $G'$ such that $d(u,v) \leq r$.
\end{definition}
Note that the balls $B_{G'}(v,r)$ are defined with respect to the distances $d(u,v)$ in the original graph $G$. This is ok.

We note the following properties of these balls.
\begin{lemma}\label{lem:ball}
For any subgraph $G'$ of $G$, any $1 \leq i \leq k$ such that $s_i, t_i$ both lie in $G'$, any vertex $v$ of $G'$, and any a radius $r \in [0,1/2)$,
$|B_{G'}(v,r) \cap \{s_i,t_i\}| \leq 1$.
\end{lemma}
\begin{proof}
If both $s_i, t_i \in B_{G'}(v,r)$ then by the triangle inequality $d(s_i, t_i) \leq d(s_i, v) + d(v, t_i) \leq r+r < 1$, again contradicting Constraints (\ref{cnst3}).
\end{proof}

\begin{definition}
Let $G'$ be a subgraph of $G$, $v$ be a vertex of $G'$, and, $r \geq 0$, and ${\bf x}^*$ be the optimal solution to \ref{lp:multicut}. The \textbf{volume} $V_{G'}(v,r)$ is given by:
\[
	V_{G'}(v,r) = \frac{OPT_{\text{LP}}}{k} + \sum_{\substack{e = (u,w)\\u,w \in B_{G'}(v,r)}} c_e \cdot x_e^* + \sum_{\substack{e = (u,w) \in G'\\u \in B_{G'}(v,r)\\w \notin B_{G'}(v,r)}} c_e \cdot (r - d(v,u)).
\]
\end{definition}

The term $OPT_{\text{LP}}/k$ might seem a bit arbitrary, but it is carefully chosen to make the analysis of the integrality gap (next lecture) work correctly. It will be discussed
in a bit more detail then. The second term is the contribution to the objective function of all edges completely contained in the ball $B_{G'}(v,r)$. For an edge $e=(u,w)$ contributing to
the third term, the value $r-d(v,u) \in [0, x^*_e)$ (so if $r$ is increased to $r' := d(u,v) + x^*_e$ then surely $w \in B_G'(v,r')$).

Recall the standard notation that for a subset of vertices \(S \subseteq V\) of a graph $G$, $\delta_G(S)$ denotes the edges in $G$ that join a vertex in $S$ to a vertex in $V-S$.
Using these definitions, the process to convert a \ref{lp:multicut} solution to a \textsc{Multicut} solution is given as Algorithm \ref{alg:solve}.

\begin{algorithm}
\caption{Conversion to \textsc{Multicut}}
{\bf Input}: Undirected graph $G = (V,E)$. \\
{\bf Output}: The cut $F$.
\begin{algorithmic}[1]\label{alg:solve}
\STATE $G' \leftarrow G$
\STATE{${\bf x}^* \gets$ the optimum solution to \ref{lp:multicut}}
\STATE{$F \gets \emptyset$}
\WHILE{some $(s_i, t_i)$ pair is connected in $G'$}\label{alg:solve:loop}
\STATE{Let $r \in [0, \frac{1}{2})$ be as promised by Lemma \ref{lem:star} (below).}
\STATE{$F \gets F \cup \delta_{G'}(B_{G'}(s_i, r))$}
\STATE{Remove the vertices $B_{G'}(s_i, r)$ and their incident incident edges from $G'$.}
\ENDWHILE
\RETURN $F$
\end{algorithmic}
\end{algorithm}

\begin{claim}\label{cl:feasible}
The result $F$ computed by Algorithm \ref{alg:solve} separates all $s_i-t_i$ pairs.
\end{claim}
\begin{proof}
First, note that for any subgraph $G'$ considered in any iteration with vertex set, say, $\delta_G(S) \subseteq F$. This is easy to prove by induction.

Consider any pair $(s_j, t_j)$. Since the algorithm terminates only when there is no $(s_i, t_i)$ pair left in the subgraph $G'$ then there was some iteration where at least
one of the two nodes was in the ball that was removed. Consider the earliest iteration where one of these nodes was in such a ball and suppose this vertex is $s_j$ (without loss of generality).
Say that the pair $(s_i,t_i)$ is the pair considered in this iteration (it may or may not be that $i = j$)
and now say that $G'$ is subgraph of $G$ in this iteration just before the ball $B_{G'}(s_i, r)$ is removed. That is, we are assuming $s_j \in B_{G'}(s_i, r)$.
By Lemma \ref{lem:ball}, we cannot have $t_j \in B_{G'}(s_i,r)$.

Now consider any $s_j-t_j$ path $P$ in the original graph. If $P$ is not contained entirely in the graph $G'$ just before $B_{G'}(s_i, r)$ is removed
then the observation in the first sentence shows that $P$ already contained some edge in $F$.
If $P$ is contained entirely in this subgraph $G'$,
then because it starts in $B_{G'}(s_i,r)$ and ends at $t_j \not\in B_{G'}(s_i,r)$ it must use some edge in $\delta(B_{G'}(s_i,r))$. This edge is added to $F$.

In either case, $P$ contains an edge from $F$. Since this is true for all $s_j-t_j$ paths, the pair $(s_j, t_j)$ is disconnected in the graph $(V, E-F)$.
\end{proof}

The remaining Theorem and Lemma will be stated here but not proven until the next lecture.

\begin{lemma}\label{lem:star}
Consider an iteration of the algorithm, let $G'$ be the current graph in that iteration, and let $v$ be any vertex of $G'$.
There exists some $r \in [0,1/2)$ such that $c(\delta_{G'}(B_{G'}(v, r))) \leq 2 \cdot \ln (k+1) \cdot V_{G'}(v, r)$.
\end{lemma}

\begin{theorem}\label{thm:main}
The integrality gap of \ref{lp:multicut} is at most $4 \cdot \ln (k+1)$.
\end{theorem}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section*{References}

\begin{itemize}
\item[KV00]
B.~Korte and J.~Vygen,
{\em Combinatorial Optimization: Theory and Algorithms},
Springer-Verlag, Berlin, 2000.
\end{itemize}

\end{document}
