Ticket #1700: floyd_warshall_shortest.hpp.patch
File floyd_warshall_shortest.hpp.patch, 966 bytes (added by , 15 years ago) |
---|
-
floyd_warshall_shortest.hpp
old new 59 59 60 60 for (tie(k, lastk) = vertices(g); k != lastk; k++) 61 61 for (tie(i, lasti) = vertices(g); i != lasti; i++) 62 for (tie(j, lastj) = vertices(g); j != lastj; j++) 63 { 64 d[*i][*j] = 65 detail::min_with_compare(d[*i][*j], 66 combine(d[*i][*k], d[*k][*j]), 67 compare); 68 } 62 if(d[*i][*k] != inf) 63 for (tie(j, lastj) = vertices(g); j != lastj; j++) 64 if(d[*k][*j] != inf) 65 d[*i][*j] = 66 detail::min_with_compare(d[*i][*j], 67 combine(d[*i][*k], d[*k][*j]), 68 compare); 69 69 70 70 71 71 for (tie(i, lasti) = vertices(g); i != lasti; i++) 72 72 if (compare(d[*i][*i], zero)) 73 73 return false;