Is there an algorithm package that allows one to achieve the style of the algorithms in the book Combinatorial Optimization by Korte and Vygen? I am interested specifically in the numbering of the steps by encircled numbers.


This is view of the original algorithm:

Edmond's branching algorithm

Aside from duplicating the algorithm (with heading and content), since your were particularly interested in the numbering, the following does something similar using PGF/TikZ and algorithmicx. Moreover, I've used the following two answers to obtain the desired result:

% https://tex.stackexchange.com/questions/7032/good-way-to-make-textcircled-numbers/7045#7045
            \node[shape=circle,draw,inner sep=1pt] (char) {#1};}}

% https://tex.stackexchange.com/questions/25019/how-to-place-a-program-and-a-text-side-by-side/25026#25026
\algrenewcommand{\alglinenumber}[1]{\scriptsize\circled{#1}}% circled line numbers
\begin{algorithmic}[1]% Taken from the algorithmicx package documentation
  \State $r\gets a\bmod b$
    \State $a\gets b$
    \State $b\gets r$
    \State $r\gets a\bmod b$
  \State \textbf{return} $b$


Euclid's algorithm


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.