Fix bug in EdmonsKarp algorithm.
The VertexAndFlow type was defined as std::pair<Vertex,double>, when a previous bug fix changes INFINITY to ~0UL instead of ~0U, the conversion from unsigned int to double then back to unsigned int will overflow and set to 0 ((unsigned int)(double)(~0UL) = 0).
Also in this fix, a clangd configuration file is added to warn this case by adding bugprone-* to ClangTidy.
Fix bug in EdmonsKarp algorithm. The
VertexAndFlow
type was defined asstd::pair<Vertex,double>
, when a previous bug fix changesINFINITY
to~0UL
instead of~0U
, the conversion from unsigned int to double then back to unsigned int will overflow and set to 0 ((unsigned int)(double)(~0UL) = 0
).Also in this fix, a clangd configuration file is added to warn this case by adding
bugprone-*
to ClangTidy.