diff --git a/lemon/bellman_ford.h b/lemon/bellman_ford.h --- a/lemon/bellman_ford.h +++ b/lemon/bellman_ford.h @@ -23,6 +23,7 @@ /// \file /// \brief Bellman-Ford algorithm. +#include #include #include #include @@ -775,7 +776,7 @@ /// This function gives back a directed cycle with negative total /// length if the algorithm has already found one. /// Otherwise it gives back an empty path. - lemon::Path negativeCycle() { + lemon::Path negativeCycle() const { typename Digraph::template NodeMap state(*_gr, -1); lemon::Path cycle; for (int i = 0; i < int(_process.size()); ++i) {