[Tex/LaTex] Different line numbers for two procedures in similar algorithm

algorithmicalgorithms

I have following algorithm with two different procedures (i.e., phases) and want to give separate line numbers to both of them. Can any body help me out please? Thanks…

\documentclass[10pt,a4paper]{IEEEtran}
\usepackage{algorithmic}
\usepackage{algorithm}
\begin{document}

\begin{algorithm}
\caption{Boundaries calculation and rank computation}
\label{abc}
\begin{algorithmic}[1]

\STATE Phase 1: Compute boundaries
\STATE computer abc
\STATE calculate bcd

\STATE Phase 2: rank computation
\STATE compute wxy
\STATE calculate xyz

\end{algorithmic}
\end{algorithm}
\end{document}

Best Answer

Something like this. Wrap each phase with different/independent alogrithmic environment.

Update: To add a blank line without being numbered between two phases, add \item[] at the end of the phase 1 environment.

enter image description here

enter image description here

Code

\documentclass[10pt,a4paper]{IEEEtran}
\usepackage{algorithmic}
\usepackage{algorithm}
\begin{document}

\begin{algorithm}
\caption{Boundaries calculation and rank computation}
\label{abc}
\begin{algorithmic}[1]
\STATE Phase 1: Compute boundaries
\STATE computer abc
\STATE calculate bcd
\end{algorithmic}
\begin{algorithmic}[1]
\STATE Phase 2: rank computation
\STATE compute wxy
\STATE calculate xyz
\end{algorithmic}
\end{algorithm}
\end{document}