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?
\FORALLcycle. Note thatalgcompatibleis just for old documents andalgpseudocodeshould be used instead. – egreg Jan 31 '15 at 18:22\algtext*{ENDFAP}after definingFORALLPandENDFAP, as suggested inalgpseudocodewithout end block text. – Werner Jan 31 '15 at 18:25