%\VignetteIndexEntry{lovasz}
% JSS Article Template
\documentclass{article}


%%% Additional Packages %%%

% Algorithms
% http://tex.stackexchange.com/questions/229355/algorithm-algorithmic-algorithmicx-algorithm2e-algpseudocode-confused
\usepackage{algorithm}% http://ctan.org/pkg/algorithms
\usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx


% Font stuff
\usepackage[T1]{fontenc}% for correct hyphenation and T1 encoding
%\usepackage{lmodern}% latin modern font
\usepackage[american]{babel}% for American English

% Math fonts/symbols
\usepackage{amsmath}% sophisticated mathematical formulas with amstex (includes \text{})
\usepackage{mathtools}% fix amsmath deficiencies
\usepackage{amssymb}% sophisticated mathematical symbols with amstex
\usepackage{amstext}% ams mathematical fonts
\usepackage{amsfonts}% ams mathematical fonts

% Figures
\usepackage{graphicx}% for including figures

%%% Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% vetors
\newcommand{\ve}[1]{\mathbf{#1}}           % for vetors
\newcommand{\sv}[1]{\boldsymbol{#1}}   % for greek letters
\newcommand{\m}[1]{\mathbf{#1}}               % for matrices
\newcommand{\sm}[1]{\boldsymbol{#1}}   % for greek letters
\newcommand{\tr}[1]{{#1}^{\mkern-1.5mu\mathsf{T}}}              % for transpose
\newcommand{\norm}[1]{||{#1}||}              % for transpose
\newcommand*{\mve}{\operatorname{ve}}
\newcommand*{\trace}{\operatorname{trace}}
\newcommand*{\rank}{\operatorname{rank}}
\newcommand*{\diag}{\operatorname{diag}}
\newcommand*{\vspan}{\operatorname{span}}
\newcommand*{\rowsp}{\operatorname{rowsp}}
\newcommand*{\colsp}{\operatorname{colsp}}
\newcommand*{\svd}{\operatorname{svd}}
\newcommand*{\edm}{\operatorname{edm}}  % euclidean distance matrix (D * D)


% statistical
\newcommand{\widebar}[1]{\overline{#1}}  

% 
% operators
\newcommand{\Had}{\circ}
\DeclareMathOperator*{\lmin}{Minimize}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\arginf}{arg\,inf}
\DeclareMathOperator*{\argsup}{arg\,sup}
%\newcommand*{\arginf}{\operatorname*{arginf}}
%\newcommand*{\argsup}{\operatorname*{argsup}}

% Sets
\newcommand*{\intersect}{\cap}
\newcommand*{\union}{\cup}
\let\oldemptyset\emptyset
\let\emptyset\varnothing

% Fields, Reals, etc. etc
\newcommand{\field}[1]{\mathbb{#1}}
\newcommand{\Reals}{\field{R}}
\newcommand{\Integers}{\field{Z}}
\newcommand{\Naturals}{\field{N}}
\newcommand{\Complex}{\field{C}}
\newcommand{\Rationals}{\field{Q}}

% Hyphenation
\hyphenation{Ar-chi-me-dean}

% Editorial
\newcommand*{\TODO}[1]{\textcolor{red}{TODO: #1}}
\newcommand*{\NOTE}[1]{\textcolor{blue}{Note: #1}}
\newtheorem{theorem}{Theorem}
\newtheorem{Proof}{Proof}

\usepackage[total={6.5in,8.75in}, top=0.9in, left=0.7in, right=0.7in, includefoot]{geometry}


% Misc
%\makeatletter
%\newcommand\myisodate{\number\year-\ifcase\month\or 01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 10\or 11\or 12\fi-\ifcase\day\or 01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 10\or 11\or 12\or 13\or 14\or 15\or 16\or 17\or 18\or 19\or 20\or 21\or 22\or 23\or 24\or 25\or 26\or 27\or 28\or 29\or 30\or 31\fi}% create iso date
\makeatother
%\newcommand*{\abstractnoindent}{}% define abstract such that it has no indent
%\let\abstractnoindent\abstract
%\renewcommand*{\abstract}{\let\quotation\quote\let\endquotation\endquote
%  \abstractnoindent}
%\deffootnote[1em]{1em}{1em}{\textsuperscript{\thefootnotemark}}% setting for footnote

\author{Adam Rahman}
\title{Finding the Lovasz Number}


%% need no \usepackage{Sweave.sty}

\begin{document}
\SweaveOpts{concordance=FALSE}

\maketitle

The Lovasz Number of a graph $\m{G}$, denoted $\vartheta(\m{G})$, is the upper bound on the Shannon capacity of the graph (\cite{lovasz1979shannon}). For an adjacency matrix $\m{B} = [B_{ij}]$ the problem of finding the Lovasz number is given by the following primal SQLP problem

\[
\begin{array}{ll}
\underset{\m{X}}{\text{minimize}} & tr(\m{C}\m{X}) \\
\text{subject to} & \\
& \begin{array}{rl}
tr(\m{X}) & = ~~1 \\
X_{ij} &=~~ 0 \quad \text{if $B_{ij}$ = 1} \\
\m{X} &\in~~ \mathcal{S}^{n}
\end{array}
\end{array}
\]

The function \verb!lovasz! takes as input an adjacency matrix \verb!B!, and returns the the optimal Lovasz number using \verb!sqlp!.

\begin{verbatim}
R> out <- lovasz(B)
\end{verbatim}

\section*{Numerical Example}

To compute the Lovasz number using \verb!sqlp!, we need only the (weighted) adjacency matrix representing a graph object.

\begin{verbatim}
R> data(Glovasz)

      V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
 [1,]  0  0  0  1  0  0  1  1  0   0
 [2,]  0  0  0  1  0  0  1  0  1   1
 [3,]  0  0  0  0  0  0  0  1  0   0
 [4,]  1  1  0  0  0  0  0  1  0   1
 [5,]  0  0  0  0  0  0  1  1  1   1
 [6,]  0  0  0  0  0  0  0  0  1   0
 [7,]  1  1  0  0  1  0  0  1  1   1
 [8,]  1  0  1  1  1  0  1  0  0   0
 [9,]  0  1  0  0  1  1  1  0  0   1
[10,]  0  1  0  1  1  0  1  0  1   0
\end{verbatim}

The Lovasz number for the associated graph is the value of the primal objective function. Again, since the objective function was negated to make the primal problem a minimization, we negate the value of the objective function.

\begin{verbatim}
R> out <- lovasz(Glovasz)

R> -out$pobj

[1] 5
\end{verbatim}

\bibliographystyle{plain}
\bibliography{sdpt3r}

\end{document}