\documentstyle[12pt]{article}
\textheight=9.5in
\topmargin=-0.5in
\oddsidemargin=0in
\evensidemargin=0in
\textwidth=6.5in
\newcommand{\grad}{\nabla}
\newcommand{\spone}{1.02}
\newcommand{\sptwo}{1.59}
\newcommand{\spmed}{1.28}
\newcommand{\singlespace}{\edef\baselinestretch{\spone}\Large\normalsize}
\newcommand{\doublespace}{\edef\baselinestretch{\sptwo}\Large\normalsize}
\newcommand{\mediumspace}{\edef\baselinestretch{\spmed}\Large\normalsize}
\newcommand{\beq}{\begin{displaymath}}
\newcommand{\be}{\begin{equation}}
\newcommand{\eeq}{\end{displaymath}}
\newcommand{\ee}{\end{equation}}
\newcommand{\bl}{\begin{flushleft}}
\newcommand{\el}{\end{flushleft}}
\newcommand{\bc}{\begin{center}}
\newcommand{\ec}{\end{center}}
\newcommand{\La}{\Longleftarrow}
\newcommand{\la}{\langle}
\newcommand{\Ra}{\Longrightarrow}
\newcommand{\ra}{\rangle}
\newcommand{\Ba}{\Longleftrightarrow}
\newcommand{\goto}{\rightarrow}
\pagestyle{empty}
\begin{document}
\begin{center}
\fbox{\bf Breadth-first Search Algorithm for Percolation Cluster Generation}
\end{center}
\vspace{0.25in}

\begin{description}
\item[0.] Decide on a fixed $local$ search order around a site. Initialize
          all variables.

\item[1.] Occupy the starting point and put this site on the $stack$. Set both
the lower pointer $m1$ (for the site whose neighbors are being checked) and
the upper pointer $m2$ (for the top site on the $stack$) to 1.

\item[2.] Search all neighbors of site $m1$ by first testing if the neighbor
          is already on the $stack$.
 \begin{itemize}
  \item If yes, go to the next neighbor and continue searching.
  \item If not, check if any of the limits has been reached.
   \begin{itemize}
    \item If limits have been reached, then growth must be stopped. Exit.
    \item If not, check if this neighbor has been chosen empty already.
     \begin{itemize}
      \item If yes, go to the next neighbor.
      \item If not, get a random number to decide whether to occupy
            this site. Mark it as occupied, put it on the $stack$, and
            advance $m2$ $\Longrightarrow$ $m2+1$, if appropriate.
            Otherwise mark it empty and go to the next neighbor.
     \end{itemize}
   \end{itemize}
 \end{itemize}

\item[3.] Test if the two $stack$ pointers coincide ($m1 = m2$).
 \begin{itemize}
  \item If yes, the cluster is finished.
        Exit either with or without success depending on the success criteria.
  \item If no, increment $m1$ $\Longrightarrow$ $m1+1$ and repeat {\bf 2}.
 \end{itemize}

\end{description}
\end{document}
