2
0
mirror of https://github.com/boostorg/graph.git synced 2026-02-02 21:02:15 +00:00

Merge fix for infinite weights in Floyd-Warshall

[SVN r48612]
This commit is contained in:
Douglas Gregor
2008-09-05 14:00:40 +00:00
parent 415b79eabc
commit 8cbf7d89aa

View File

@@ -59,15 +59,15 @@ namespace boost
for (tie(k, lastk) = vertices(g); k != lastk; k++)
for (tie(i, lasti) = vertices(g); i != lasti; i++)
for (tie(j, lastj) = vertices(g); j != lastj; j++)
{
d[*i][*j] =
detail::min_with_compare(d[*i][*j],
combine(d[*i][*k], d[*k][*j]),
compare);
}
if(d[*i][*k] != inf)
for (tie(j, lastj) = vertices(g); j != lastj; j++)
if(d[*k][*j] != inf)
d[*i][*j] =
detail::min_with_compare(d[*i][*j],
combine(d[*i][*k], d[*k][*j]),
compare);
for (tie(i, lasti) = vertices(g); i != lasti; i++)
if (compare(d[*i][*i], zero))
return false;