\documentclass[11pt]{article}
    \usepackage{amsmath,amssymb,amsthm,bbm}
    \usepackage{tkz-berge}
    
    \DeclareMathOperator*{\E}{\mathbb{E}}
    \let\Pr\relax
    \DeclareMathOperator*{\Pr}{\mathbb{P}}
    
    \newcommand{\eps}{e}
    \newcommand{\inprod}[1]{\left\langle #1 \right\rangle}
    \newcommand{\R}{\mathbb{R}}
    
    \newcommand{\handout}[5]{
      \noindent
      \begin{center}
      \framebox{
        \vbox{
          \hbox to 5.78in { {\bf CS 388R: Randomized Algorithms } \hfill #2 }
          \vspace{4mm}
          \hbox to 5.78in { {\Large \hfill #5  \hfill} }
          \vspace{2mm}
          \hbox to 5.78in { {\em #3 \hfill #4} }
        }
      }
      \end{center}
      \vspace*{4mm}
    }
    
    \newcommand{\lecture}[4]{\handout{#1}{#2}{#3}{Scribe: #4}{Lecture #1}}
    
    \newtheorem{theorem}{Theorem}[subsection]
    \newtheorem{corollary}[theorem]{Corollary}
    \newtheorem{lemma}[theorem]{Lemma}
    \newtheorem{observation}[theorem]{Observation}
    \newtheorem{proposition}[theorem]{Proposition}
    \newtheorem{definition}[theorem]{Definition}
    \newtheorem{property}[theorem]{Property}
    \newtheorem{claim}[theorem]{Claim}
    \newtheorem{fact}[theorem]{Fact}
    \newtheorem{rules}[theorem]{Rule}
    \newtheorem{assumption}[theorem]{Assumption}
    
    % 1-inch margins, from fullpage.sty by H.Partl, Version 2, Dec. 15, 1988.
    \topmargin 0pt
    \advance \topmargin by -\headheight
    \advance \topmargin by -\headsep
    \textheight 8.9in
    \oddsidemargin 0pt
    \evensidemargin \oddsidemargin
    \marginparwidth 0.5in
    \textwidth 6.5in
    
    \parindent 0in
    \parskip 1.5ex
    
    \begin{document}
    
    \lecture{23 --- November 21, 2017}{Fall 2017}{Prof.\ Eric Price}{Changyong Hu, Andrew Russell}
    
    \section{Overview}
    
    This lecture continues our discussion on Markov chains; specifically, chains where 
    
    \begin{equation*}
        P_{uv} = \begin{cases}
        \frac{1}{d(u)} & (u,v) \in E\\
        0 & \mbox{Otherwise.}
        \end{cases}
        \end{equation*} for all edges $(u,v)$. That is, we cover random walks on graphs.
    
    
    \section{Definitions}

    Here we recall a few definitions from last time. 
    
    \begin{itemize}
        \item The hitting time $h_{u,v}$ is the expected number of steps to go from vertex $u$ to a vertex $v$.
        \item The commute time $C_{u,v} = h_{u,v} + h_{v,u}$ is the expected number of steps to return to a vertex $u$ after hitting vertex $v$.
        \item $C_u(G)$ is the expected time to tour the entire graph $G$ starting at $u$.
        \item $C(G) = \max_u C_u(G)$ is the graph's cover time.
    \end{itemize}

    In this lecture we are interested in proving some bounds about these properties.
    
    \section{Motivating Example: The Lollipop Graph}
    \begin{figure}[h]
            \caption{The Lollipop Graph on 14 Vertices}
            \centering
            \begin{tikzpicture}[%
                            VertexStyle/.style={shape=circle, shading=ball, ball color=blue!60,
                            minimum size=16pt, inner sep=0pt, draw}]
                            \SetVertexNoLabel
                            \grComplete[RA=1]{7}
                            \grPath[x=1,RA=1]{8}
                    \end{tikzpicture}
            \end{figure}
    
            The lollipop graph on $n$ vertices is a clique of $\frac{n}{2}$ vertices connected to a path of $\frac{n}{2}$ vertices. Let $u$ be any vertex in the clique that does not neighbour a vertex in the path, and $v$ be the vertex at the end of the path that does not neighbour the clique. Then $h_{u,v} = \theta(n^3)$ while $h_{v,u} = \theta(n^2)$. This is because it takes $\theta(n)$ time to go from one vertex in the clique to another, and $\theta(n^2)$ time to successfully proceed up the path, but when travelling from $u$ to $v$ the walk will fall back into the clique $\theta(1)$ times as often as it makes it a step along the path to the right, adding an extra factor of $n$ to the hitting time.\\

            We now wish to prove this formally.
    
    \section{Electrical Resistance and Commute Time of a Graph}
    View graph $G$ as an electrical network with unit resistors as edges. Let $R_{u,v}$ be the effective resistance between vertices $u$ and $v$. 
    Then the commute time between $u$ and $v$ in a graph is related to $R_{u,v}$ by $$C_{u,v} = 2mR_{u,v}$$ We get the following inequalities assuming this relation. 
    
    If $(u,v) \in E$,
    \begin{equation*}
    R_{u,v} \leq 1 \therefore  C_{u,v} \leq 2m
    \end{equation*}
    
    In general, $\forall\ u,v \in V$,
    \begin{equation*}
    R_{u,v} \leq n-1 \therefore C_{u,v} \leq 2m(n-1) < n^3
    \end{equation*}
    
    Here is the high level idea behind the proof:
    We inject $d(v)$ amperes of current into all vertices $v \in V$. Now fix some vertex $u \in V$ and remove $2m$ current from $u$ leaving net $d(u) - 2m$ current at $u$. Now we get voltages $x_v$  $\forall v \in V$. We will show that $x_v -x_u = h_{v,u}$ $\forall v \neq u \in V$ which will give us a relation between
    commute time and resistance. 
    
    \subsection{Lollipop Graph}
    Let us revisit the lollipop graph with the electrical network view and compute $h_{u,v}$ and $h_{v,u}$ with $u$ and $v$ as before. To compute $h_{u,v}$. Let $u'$ be the vertex common to the clique and the path. Clearly, the path has resistance $\theta(n)$. $\theta(n)$ current is injected in the path and $\theta(n^2)$ current is injected in the clique.
    
    Consider draining current from $v$. The current in the path is $\theta(n^2)$ as $2m -1 = \theta(n^2)$ current is drained from $v$ which enters $v$ through the path implying $x_u' - x_v = \theta (n^3)$ using Ohm's law ($V=IR$). Now consider draining current from $u$ instead. The current in the path is now $\theta(n)$ implying $x_v - x_u' = \theta(n^2)$ by the same argument.
    
    Since the effective resistance between any edge in the clique is less than 1 and $\theta(n^2)$ current is injected, there can be only $\theta(n^2)$ voltage gap between any 2 vertices in the clique. We get $h_{u,v} = x_u - x_v = \theta(n^3)$ in the former case and $h_{v,u} = x_v - x_u = \theta(n^2)$ in the latter.
    
    \subsection{Proof of Relation}

    Recall that the Laplacian of $G$ is defined by:

    \begin{equation*}
        L_{uv} = \begin{cases}
        d(u) & v = u\\
        -1 & v \neq u
        \end{cases}
        \end{equation*}

    and the degree matrix $D$ is:

    \begin{equation*}
        D_{uv} = \begin{cases}
        d(u) & v = u\\
        0 & v \neq u
        \end{cases}
        \end{equation*}
    
    Consider adding $d(v)$ amps of current to every vertex $v$, and then removing $2m$ amps from a vertex $u$. Let $x$ be the voltage vector for the resulting graph. Then we have
    \begin{equation*}
    L x = i_u = D - 2m \mathbbm{1}_u
    \end{equation*}
    \begin{equation}
    \forall v \in V, \sum_{(u,v) \in E} x_v - x_u = d(v)
    \end{equation}

    Define $h_{v,u} = 0$ when $v = u$. We can then write
    \begin{align*}
    h_{v,u} &= 1 + \sum_{(v,w) \in E} \frac{1}{d(v)} h_{w,u}
    \end{align*}
    because we take one step in our random walk out of $v$ to another vertex $h_{w,u}$ with probability $\frac{1}{d(v)}$ and then have $h_{w,u}$ expected time to reach $u$. Multiplying through by $d(v)$, we get:
    \begin{equation}
    d(v) = \sum_{(v,w) \in E} h_{v,u} - h_{w,u}
    \end{equation}
    
    Equations 1 and 2 are linear systems with unique solutions and are identical under $x_v - x_u = h_{v,u}$ (up to same additive shift to each entry). $x_v = h_{v,u}$ if $x_u = 0$.
    
    We have shown that for $i_u = D - 2m \mathbbm{1}_u$ with $x = L^{+}i_u$ that $x_v - x_u = h_{v,u}$. For $u'$, we have $x' = L^{+}i_{u'}$. Now, we have,
    \begin{equation*}
    x - x' = L^{+}(i_u - i_{u'}) = 2m L^{+}(e_{u'} - e_u)
    \end{equation*}

    where $e_v$ is $1$ at the entry corresponding to $v$ and $0$ elsewhere.
    The above is equivalent to $2m$ times voltage obtained if you inject 1 ampere at $u'$ and remove 1 ampere from $u$. Using Kirchoff's law and our previously proven equality that
    $x_v - x_u = h_{v,u}$ we get
    \begin{align*}
    2m R_{u,u'} &= (x-x')_{u'} - (x-x')_{u} \\
                &= (x_{u'} - x_u) - (x'_u - x'_{u'}) \\
                &= h_{u',u} + h_{u,u'} = C_{u,u'}
    \end{align*}
    
    \section{Cover Time of a Graph}
    We define $C_u(G)$ as the expected time for a random walk starting at $u$ to visit all vertices in a graph. $C(G)$ is the maximum of $C_u(G)$ over all $u \in V$. 
    
    \subsection{Bound for $C(G)$}

    We have $\forall u \in V$,
    \begin{equation*}
    C_u(G) \leq 2m(n-1)
    \end{equation*}
    
    Consider the spanning tree $T$ of graph $G$. The cover time is bounded by traversing the edges of the tree in both directions (as we could just do a DFS on the spanning tree), and hitting time gives the expected time of moving along an edge, we get
    \begin{align*}
    C_u(G)	&\leq \sum_{(u,v) \in E(T)} h_{u,v} + h_{v,u}\\
            &= \sum_{(u,v) \in E(T)} C_{u,v} \\
            & \leq (n-1) \max_u C_{u,v} \\
            & \leq 2m(n-1)
    \end{align*}
    This above inequality is tight for lollipop ($\theta(n^3)$) but not for cliques which has $O(n\log n)$ as we can model it as a coupon collector problem.

    \subsection{Using resistance for a better bound}
    
    Let $R_{max} = \max_{u,v \in V} R_{u,v}^{eff}$. Then:
    \begin{equation*}
    mR_{max} \leq C(G) \lesssim mR_{max}\log n
    \end{equation*}

	Let $(u,v)$ have $R_{u,v}^{eff} = R_{max}$
	\begin{equation*}
	C(G) \geq \max(h_{uv}, h_{vu}) \geq \frac{h_{uv} + h_{vu}}{2} = \frac{C_{uv}}{2} = M\cdot R_{uv}^{eff} = M\cdot R_{max}
	\end{equation*}
	
	\subsection{Expected time from node $u$ to any node $v$}
	\begin{equation*}
	h_{uv} \leq C_{uv} = 2M\cdot R_{uv}^{eff} \leq 2M\cdot R_{max}
	\end{equation*}	  
	So after $8M\cdot R_{max}$ steps, you will be reached $v$ $w.p. 3/4$
	
	Let's repeat the process $log(n)$ times,
	\begin{equation*}
	Pr(never\ reach\ v) \leq (\frac{1}{4})^{log(n)} = \frac{1}{n^2}
	\end{equation*}
	\begin{equation*}
	Pr(any\ v not reached) \leq \frac{1}{n^2} \cdot n = \frac{1}{n}
	\end{equation*}
	
	\begin{align*}
	E[T] &\leq Pr(T \leq B) \cdot B + Pr(T \geq B) \cdot E[T|T\geq B]\\
		 &\leq 8M\cdot R_{max}log(n) + \frac{1}{n^2} \cdot (2Mn + MR_{max}log(n))\\
		 & = \Theta(MR_{max}log(n))
	\end{align*}
    
    \begin{thebibliography}{42}
    
     \bibitem[MR]{MR}
     Rajeev~Motwani, Prabhakar~Raghavan
     \newblock Randomized Algorithms.
     \newblock {\em Cambridge University Press}, 0-521-47465-5, 1995. %pub - isbn - year
    
    %@book{Motwani:1995:RA:211390,
    % author = {Motwani, Rajeev and Raghavan, Prabhakar},
    % title = {Randomized Algorithms},
    % year = {1995},
    % isbn = {0-521-47465-5, 9780521474658},
    % publisher = {Cambridge University Press},
    % address = {New York, NY, USA},
    %}
    \end{thebibliography}
    
    \end{document}