Here is a sample code for your algorithm using the package algorithm2e
as suggested by your tags:
\documentclass[12pt]{article}
\usepackage[plainruled]{algorithm2e}
\usepackage{amsmath}
\begin{document}
\begin{algorithm}[ht!]
\KwIn{%
$A, B \text{ and } C$
}%
{\bf Initialization:} $\alpha, \beta \text{ and } u$ ;
\While{$|u^{k+1}-u^k | \geq \epsilon$}{%
compute $\alpha$ as $\hat{\alpha}$ with Eq. \eqref{eq:1};
compute $\beta$ as $\hat{\beta}$ with Eq. \eqref{eq:2};
compute $u$ as $\hat{u}$ with Eq. \eqref{eq:3}.
}
\KwOut{%
$\alpha \text{ and } \beta$
}%
\caption{Some algorithm}%
\label{algo:solution}%
\end{algorithm}
\end{document}
And here is what the output looks like:
There are many different options within algorithm2e
to configure the layout of the algorithm. You can for instance replace the option plainruled
by plain
in order to remove the horizontal lines. More information is available in the package documentation here. See section 7.3.
As for the numbering of the algorithm, if you completely remove the number, you will not be able to label it and reference it in the text. Have a look at section 9.2 and the command \SetAlgoRefName
in order to customize the referencing.
There are different possibilities; it all depends on what you want. Here are some possibilities.
\documentclass[letterpaper,twocolumn,10pt]{article}
\usepackage{algorithm2e}
\begin{document}
\begin{algorithm}[]
\SetKwData{Left}{left}\SetKwData{This}{this}\SetKwData{Up}{up}%
\SetKwFunction{Union}{Union}\SetKwFunction{FindCompress}{FindCompress}%
\SetKwInOut{Input}{input}\SetKwInOut{Output}{output}%
\Input
{\begin{minipage}[t]{6cm}%
\strut
$(a_i,b_i)$, $(a_{i+1},b_{i+1})$, \dots\ tuples for
start-end etc etc etc etc etc etc etc etc
$(c_i,d_i)$, $(c_{i+1},d_{i+1})$, \dots\ tuples for
start-end etc etc etc etc etc etc etc etc
\strut
\end{minipage}%
}
\Output{A partition of the bitmap}
\BlankLine
initialization\;
\While{not at end of this document}%
{read current\;
\eIf{understand}%
{go to next section\;
current section becomes this one\;
}%
{go back to the beginning of current section\;
}
}
\caption{How to write algorithms}
\end{algorithm}
\end{document}
\Input
{\begin{itemize}
\item $(a_i,b_i)$, $(a_{i+1},b_{i+1})$, \dots\ tuples for
start-end etc etc etc etc etc etc etc etc
\item $(c_i,d_i)$, $(c_{i+1},d_{i+1})$, \dots\ tuples for
start-end etc etc etc etc etc etc etc etc
\end{itemize}%
}
\Input
{\begin{itemize}
\item[] $(a_i,b_i)$, $(a_{i+1},b_{i+1})$, \dots\ tuples for
start-end etc etc etc etc etc etc etc etc
\item[] $(c_i,d_i)$, $(c_{i+1},d_{i+1})$, \dots\ tuples for
start-end etc etc etc etc etc etc etc etc
\end{itemize}%
}
\Input
{\par
$(a_i,b_i)$, $(a_{i+1},b_{i+1})$, \dots\ tuples for
start-end etc etc etc etc etc etc etc etc
\par
$(c_i,d_i)$, $(c_{i+1},d_{i+1})$, \dots\ tuples for
start-end etc etc etc etc etc etc etc etc
}
Best Answer
For not too sophisticated algorithms this is pretty straightforward with a normal table.