I'm using a solution suggested by C. Fiorio in Want Knuth style line numbering in algorithm2e algorithms. The suggestion was to use the algonl option for algorithm2e to achieve Knuth style algorithm line numbering; i.e. Algorithm #3 should have lines numbered 3.1, 3.2, 3.3, etc. However it seems the line number overflow the bounding box if I use the boxed option.
Can someone suggest a good way to fix this so that the algorithm box does not clash with the line numbering?
Here is a minimum working example.
\documentclass{article}
\usepackage[noend,boxed,linesnumbered,algonl]{algorithm2e}
\SetKwProg{Fn}{Function}{}{end}
\begin{document}
\begin{algorithm}[H]\label{algo.find.augmenting.path}
\caption{Implementation of function to find an augmenting path if one exists.}
\DontPrintSemicolon
\Fn{find-augmenting-path-or-none$(adj,E,M)$}{
\SetKwInOut{Input}{Input}\SetKwInOut{Output}{Output}
\Input{$adj$ adjacency list of simple graph}
\Input{$E$ set of edges}
\Input{$M$ a matching}
\BlankLine
$free \gets $ generate-free-vertices() \;
\If{$|free| < 2$}{
\Return None \;
}
\tcp*[l]{Find set of length=2 paths starting at a free vertex}
$paths \gets \{[u,v] \mid u\in free, \{u,v\} \in E \}$\label{algo.line.paths.1b}\;
$k \gets 1$ \tcp*{index of 2nd element of 0-index-based array}
\While{$paths \neq \emptyset$}{
\If{odd$(k)$}{
\For{$p \in paths$}{
\If{ $p_k \in free$ }{
\Return p\;
}
}
}
$paths \gets$ extend-alternating-path$(adj,M,k,free,paths)$ \;
$k \gets k+1$ \;
}
\Return None
}
\end{algorithm}
\end{document}