2

I am using this approach to have a for all ... do in parallel using the algcompatible package.

\documentclass{article}
\usepackage{algorithm}
\usepackage{algcompatible}

\algblockdefx{FORALLP}{ENDFAP}[1]%
  {\textbf{for all }#1 \textbf{do in parallel}}%
  {\textbf{end for}}

\begin{document}

\begin{algorithm}
\caption{A test algorithm}
\begin{algorithmic}[1]
\FORALL {$v \in V(G)$}
\STATE $l(v) \leftarrow \infty$
\ENDFOR
\FORALLP{$v \in V(G)$}
\STATE $l(v) \leftarrow \infty$
\ENDFAP
\end{algorithmic}
\end{algorithm}

\end{document}

How can I get rid of the end for at the end of the block?

0 Answers0