188 check(checkPath(gr, p), "path() found a wrong path."); |
188 check(checkPath(gr, p), "path() found a wrong path."); |
189 check(pathSource(gr, p) == s, "path() found a wrong path."); |
189 check(pathSource(gr, p) == s, "path() found a wrong path."); |
190 check(pathTarget(gr, p) == t, "path() found a wrong path."); |
190 check(pathTarget(gr, p) == t, "path() found a wrong path."); |
191 |
191 |
192 ListPath<Digraph> path; |
192 ListPath<Digraph> path; |
193 Value dist; |
193 Value dist = 0; |
194 bool reached = bellmanFord(gr,length).path(path).dist(dist).run(s,t); |
194 bool reached = bellmanFord(gr,length).path(path).dist(dist).run(s,t); |
195 |
195 |
196 check(reached && dist == -1, "Bellman-Ford found a wrong path."); |
196 check(reached && dist == -1, "Bellman-Ford found a wrong path."); |
197 check(path.length() == 3, "path() found a wrong path."); |
197 check(path.length() == 3, "path() found a wrong path."); |
198 check(checkPath(gr, path), "path() found a wrong path."); |
198 check(checkPath(gr, path), "path() found a wrong path."); |