
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage[colorlinks = true,
            linkcolor = blue,
            urlcolor  = blue,
            citecolor = blue,
            anchorcolor = blue]{hyperref}
\newcounter{lecnum}

\newcommand{\lecture}[4]{
   \newpage
   \setcounter{lecnum}{#1}
   \noindent

   \begin{center}
   \framebox{
      \vbox{\vspace{2mm}
    \hbox to 16cm { {\bf CS602 Applied Algorithms
                        \hfill 2019-20 Sem II} }
       \vspace{4mm}
       \hbox to 16cm { {\Large \hfill Lecture #1: #2  \hfill} }
       \vspace{2mm}
       \hbox to 16cm { {\it Scribe: #4  \hfill  Lecturer: #3} }
      \vspace{2mm}}
   }
   \end{center}
   \vspace*{4mm}
}


\newcommand{\R}{\mathbb{R}}
\newcommand{\transpose}{\mathtt{T}}
\newcommand\tab[1][2cm]{\hspace*{#1}}
\newtheorem{theorem}{Theorem}[lecnum]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{definition}[theorem]{Definition}




\begin{document}

%\lecture{**LECTURE-NUMBER**}{**DATE**}{**LECTURER**}{**SCRIBE**}
\lecture{7}{January 30}{Rohit Gurjar}{Tanmaya Shekhawat}

Feasibility $\in$ co-NP and Feasibility $\in$ NP. And if a problem is in NP and also co-NP, it mostly turns out to be in P.

\section*{Optimization(Duality)}

\paragraph{Example: }Consider the following linear program. Let $P$ be a polyhedron given by the following set of linear constraints 
\begin{eqnarray} 
x & \ge & 0 \label{eq:x31} \\
y & \ge & 0  \label{eq:x32}\\
x & \le & 2 \label{eq:x33} \\
y & \le & 2\label{eq:x34} \\
x + y & \le & 3\label{eq:x35} 
\end{eqnarray}

Suppose we have to maximise $ f(x,y) = 7x + 8y $ under these constraints. Let say the optimal value is $w^*$. 
%In this problem $w^*$ would be 23.
Take any point in $P$. Let's pick $(1,1) \in P$,  we can confirm that $f(1,1) = 15$. And hence, $w^* \geq 15$.
%
Similarly, any feasible point of the LP will us a lower bound
on the optimal value. 
\begin{observation}
In the LP $\max \{ w^\transpose x \mid Ax \le b \}$ if      $\alpha$ is a feasible point then  $w^* \ge w^\transpose \alpha$.
\end{observation}
For example, $(2,1)$ is a feasible point and it gives us $w^* \geq f(2,1)=22 $.
Another point $(1,2)$ gives a better lower bound: 
$w^* \geq f(1,2)=23 $.
% $\le$ $w^*$ where $w^*=23$.\\

 %
 Can we also get an upper bound on $w^*$ somehow?
 %
To upper bound $w^*$ we can try to express $f( x,y)$ as positive linear combination of given linear constraints.
%
Let us do it for the above example.
% let's try to express $f(x,y)$ as linear combination of given linear constraints.

Attempt 1: Let us multiply (\ref{eq:x33}) by 7 and (\ref{eq:x34}) by 8, and add the two inequalites.
\begin{eqnarray*}
7  \times  \quad (x &\le &  2) \\
8 \times \quad (y & \le &  2)\\
\cline{1-3} 
 7x+8y & \le & 14 + 16 \\
  \implies f(x,y) & \le & 30 
\end{eqnarray*}
This gives us an upper bound of $w^* \leq 30$ which is far from the lower bounds we saw.
Let us try another possibility.

Attempt 2: Let us multiply (\ref{eq:x35}) by 8 and (\ref{eq:x31}) by -1, and add the two.
\begin{eqnarray*}
8  \times  \quad (x+y &\le &  3) \\
-1 \times \quad \quad (x & \ge &  0)\\
\cline{1-3} 
 7x+8y & \le & 24 -0  \\
  \implies f(x,y) & \le & 24 
\end{eqnarray*}
We get $w^* \leq 24$ which is close to the lower bound of $23$, but there is still a gap.

%\begin{align*}
%f(x,y) &= 8x+8y(x+y \le 3) - x(-x \le 0) \\
%f(x,y) &\le 24 + 0 \\
%f(x,y) &\le 24
%\end{align*}

Attempt 3: Let us multiply (\ref{eq:x35}) by 7 and (\ref{eq:x33}) by 1, and add the two.
\begin{eqnarray*}
7  \times  \quad (x+y &\le &  3) \\
1 \times \quad \quad (x & \le &  2)\\
\cline{1-3} 
 7x+8y & \le & 21 +2  \\
  \implies f(x,y) & \le & 23 
\end{eqnarray*}
We get $w^* \leq 23$, which matches exactly with our best lower bound. Of course, we can not hope to further improve either the upper bound or the lower bound. Thus, it must be that $w*=23$ and $(1,2)$ must be the optimal point.


%\begin{align*}
 %   f(x,y) &= 7x+7y(x+y \le 3) + y(y \le 2) \\
  %  f(x,y) &\le 21 + 2\\
   % f(x,y) &\le 23
%\end{align*}

%From these 3 cases we could say that f(x,y) $\le$ 23
\section*{Weak Duality Theorem}
This way of upper bounding the optimal value can be expressed as another LP, which is called the dual LP.
\paragraph{Primal LP (LP)}: maximise $f(x) = w^\transpose x$ such that $Ax \le b$ where $A \in \R^{mxn}$,  $b \in \R^m$,  $w \in \R^n$. 
\paragraph{Dual LP (LP*)}: minimise $g(y) = b^\transpose y$ such that $A^\transpose y = w$, $y \ge 0$. \\

\textbf{Theorem: } if {$\displaystyle (x_{1},x_{2},....,x_{n})$} is a feasible solution for the primal maximization linear program and {$\displaystyle (y_{1},y_{2},....,y_{m})$} is a feasible solution for the dual minimization linear program, then the weak duality theorem can be stated as {$\displaystyle \sum _{j=1}^{n}w_{j}x_{j}\leq \sum _{i=1}^{m}b_{i}y_{i}$}. \\

\textbf{Proof:} Suppose $\alpha$ is feasible for LP and $\beta$ is feasible for LP* \\
% \begin{eqnarray} 
\begin{align*}
A\alpha &\le b \\
\beta^\transpose A \alpha &\le \beta^\transpose b \tab (because \ \beta \ge 0)\\
w^\transpose \alpha &\le \beta^\transpose b \tab (A^\transpose \beta = w) \\
\therefore f(\alpha) &\le g(\beta) \\
\end{align*}

\section*{Strong Duality Theorem}
If the LP is feasible and optimal value $w^*$ is bounded then $\exists \beta^* \in \R^m$ such that $A^\transpose \beta^* = w$ and $\beta^* \ge 0$ with $b^\transpose \beta^* = w^*$, i.e., OPT(LP) = OPT(LP*).

\end{document}