Algorithm 2

\(O(\Gamma _d|{\mathcal {P}}||E|)\) time algorithm to compute D(last2reach(v, i), v) for all \(v\in V\) and \(i \in [1,|{\mathcal {P}}|]\)
\(O(\Gamma _d|{\mathcal {P}}||E|)\) time algorithm to compute D(last2reach(v, i), v) for all \(v\in V\) and \(i \in [1,|{\mathcal {P}}|]\)