\documentclass[10pt]{article}
\newtheorem{define}{Definition}
%\newcommand{\Z}{{\mathbb{Z}}}
%\usepackage{psfig}
\usepackage{graphicx}

\oddsidemargin=0.15in
\evensidemargin=0.15in
\topmargin=-.5in
\textheight=9in
\textwidth=6.25in

\begin{document}
\input{preamble.tex}

%{lecture number}{lecture date}{Ronitt Rubinfeld}{Your name}
\lecture{3}{February 15, 2012}{Ronitt Rubinfeld}{Alan Guo}

%%%% body goes in here %%%%

Today we will give a constructive proof of the Lov\'asz Local Lemma (LLL),
i.e.\ an efficient algorithm for finding a hypergraph coloring. Note that the
original proof was non-constructive. We will prove the statement
about hypergraph coloring, noting that the same proof technique applies
to the LLL.  For convenience, we restate the Lemma.

\begin{lemma}
Let $S_1,\ldots,S_m \subseteq S$ be sets such that each $S_i$ intersects
at most $d$ other $S_j$, and $|S_i| = \ell$. If $ep(d+1) < 1$, where $p = 2^{-\ell-1}$,
then there exists a $2$-coloring of $S$ such that no $S_i$ is monochromatic.
\end{lemma}
In this lecture, we prove a weaker version, which assumes $ep(d+1) < \frac12$.
The algorithm, due to Moser and Tardos, is as follows:
\begin{itemize}
\item%
Start with a random coloring of the set $S$

\item%
While there is a monochromatic (``violated'') set:
	\begin{itemize}
	\item%
	Pick an arbitrary violated $S_i$
	
	\item%
	Randomly reassign colors to elements of $S_i$
	\end{itemize}

\end{itemize}

Clearly, if this algorithm terminates, it gives us a coloring with no monochromatic
sets. The question is, then, does it terminate, and if so, after how long? To analyze
this, we look at ``logs of execution'' and bound their length.

\begin{define}
A \emph{log of execution} is a sequence of ordered pairs $(1,S_{i_1}), (2,S_{i_2}),\ldots$
where $S_{i_j}$ is the set chosen to be resampled in step $j$ of the algorithm above.
\end{define}

\begin{define}
A \emph{witness tree for step $j$} ($j > 0$) is a rooted labeled tree constructed
as follows:
\begin{itemize}
\item%
root vertex labeled by $S_{i_j}$

\item%
For $t = j$ down to $1$:
	\begin{itemize}
	\item%
	If $S_{i_t}$ intersects any sets in the witness tree, then add
	$S_{i_t}$ to the witness tree by pointing it to an arbitrary vertex
	of lowest level (max distance from root)
	\end{itemize}
\end{itemize}
\end{define}

The idea is to bound the expect length of the log of execution after the algorithm runs.
If the expectation is finite, then there is some run which terminates in finite time,
hence there is some coloring which results in no monochromatic sets. To bound the
length of logs of execution, we will bound the number and size of witness trees.

\section{Bounding Probability of a Specific Witness Tree}
We will denote the witness tree by $\tau$. Our goal is to define a procedure
``$\tau$-check'' and then we will upper bound $\Pr[\mbox{$\tau$-check passes}]$.

We now define $\tau$-check:
\begin{enumerate}
\item%
Visit vertices of $\tau$ in reverse BFS order (max depth first)
\item%
For each vertex, recolor the corresponding set as done in the algorithm
\item%
Check that set is monochromatic
\item%
Pass if all checks violated (monochromatic)
\end{enumerate}

There are two important points to note:
\begin{itemize}
\item%
If two sets are at the same level in $\tau$, they cannot intersect, by construction
\item%
If two sets are at different levels, then even though they may share elements,
all shared elements get randomly recolored before the second set is evaluated
by the algorithm
\end{itemize}
If $\tau$ appears in the log of execution, then it must pass the $\tau$-check,
hence
$$
\Pr[\mbox{$\tau$-check passes}] \ge \Pr[\mbox{$\tau$ appears in log}].
$$



What's the probability that $\tau$-check passes? Well, the probability that
a single set is monochromatic is $p \equiv 2^{-(\ell-1)}$. By the observations
we made above, the event that each set in the witness tree is monochromatic
is independent of the others, so
$$
\Pr[\mbox{$\tau$-check passes}] = p^{|\tau|}
$$
where $|\tau|$ denotes the number of vertices in $\tau$.

\section{Bounding number of witness trees of a given size}

Since each witness tree (with a  fixed root) is a rooted labeled subtree of a $d$-ary tree,
it suffices to bound the number of such trees of size $s$.
We give a one-to-one map from rooted
labeled trees of size $s$ with max degree $d$ to the set of binary strings of length $sd$
with $s-1$ ones. This will imply that the number of witness trees of size $s$ is
at most ${sd \choose s-1}$.

To map a rooted labeled tree with a fixed root to a binary string, perform the following
algorithm: perform a DFS of the tree beginning with the root, and write a $1$
for each child visited and a $0$ for each child not there.

For example, suppose the sets are $A,B,C,D,E,F \subseteq S$, and $d = s = 3$.
Suppose $\tau_1$
has root $A$ which has children $B$ and $C$, suppose
$\tau_2$ has root $A$ with child $B$, which has child $E$,
and suppose $\tau_3$ has root $A$
with children $B$ and $D$. The algorithm run on $\tau_1$ runs as follows:

\begin{figure}[htbp]
\centering
\includegraphics[scale=0.5]{tree1.pdf}
\caption{$\tau_1$}
\label{tree1}
\end{figure}

\begin{enumerate}
\item%
Starting from $A$, visit $B$ (write $1$)
\item%
From $B$, no children (write $000$, one zero per non-existing child)
\item%
Starting from $A$, visit $C$ (write $1$)
\item%
From $C$, no children (write $000$)
\item%
From $A$, no third child (write $0$)
\item%
The resulting string is \textbf{100010000}
\end{enumerate}

\begin{figure}[htbp]
\centering
\includegraphics[scale=0.5]{tree2.pdf}
\caption{$\tau_2$}
\label{tree2}
\end{figure}

The algorithm run on $\tau_2$ runs as follows:
\begin{enumerate}
\item%
Starting from $A$, visit $B$ (write $1$)
\item%
Starting from $B$, visit $E$ (write $1$)
\item%
From $E$, no children (write $000$)
\item%
From $B$, no other children (write $00$)
\item%
From $A$, no other children (write $00$)
\item%
The resulting string is \textbf{110000000}
\end{enumerate}

\begin{figure}[htbp]
\centering
\includegraphics[scale=0.5]{tree3.pdf}
\caption{$\tau_3$}
\label{tree3}
\end{figure}

The algorithm run on $\tau_3$ runs as follows:
\begin{enumerate}
\item%
Starting from $A$, visit $B$ (write $1$)
\item%
From $B$, no children (write $000$)
\item%
Starting from $A$, child $C$ is missing (write $0$)
\item%
Starting from $A$, visit $D$ (write $1$)
\item%
From $D$, no children (write $000$)
\item%
The resulting string is \textbf{100001000}
\end{enumerate}

In general, the string length is $sd$ since there are $s$ nodes, and $d$ children
per node. There are $s-1$ ones since, from the root, $s-1$ descendants will be visited.
It is straightforward to see that distinct labeled trees map to distinct binary strings.

\section{Bounding the expected length of log}

We note that the expected length of the log of execution is equal to the
expected number of witness trees that occur. Moreover, \textbf{no tree occurs
twice}. Therefore
$$
\mbox{length of log} = \sum_{\tau} 1_\tau
$$
where $1_\tau$ is an indicator variable which is $1$ if $\tau$ occurs in the log,
otherwise $0$.

Then
\begin{eqnarray*}
E[\mbox{length of log}] &=& E\left[ \sum_\tau 1_\tau \right] \\
&=& \sum_\tau E[1_\tau] \\
&=& \sum_{\mbox{roots $r$}} \sum_{\mbox {$\tau$ rooted at $r$}}E[1_\tau]\\
&=& \sum_r \sum_{s=1}^\infty \sum_{\mbox{$|\tau|=s$ rooted at $r$}} E[1_\tau] \\
&=& \sum_r \sum_{s=1}^\infty \sum_{\mbox{$|\tau|=s$ rooted at $r$}} p^s \\
&\le& m \sum_{s=1}^\infty {sd \choose s-1} p^s
	\mbox{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ by Section 2}\\
&\le& m \sum_{s=1}^\infty ((d+1)ep)^s 
	\mbox{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  by Stirling's approximation}\\
&\le& m \sum_{s=1}^\infty \left(\frac12\right)^s
	\mbox{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ by assumption}\\
&=& O(m). \\
\end{eqnarray*}

In particular, the expected running time of the hypergraph coloring algorithm is
polynomial, so there exists a sequence of colorings such that the algorithm terminates,
hence there exists a coloring of $S$ such that no $S_i$ is monochromatic.

\end{document}
