COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
01/08/07 11:39:59 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3123
Message:

New path concept and path structures

TODO: BellmanFord::negativeCycle()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/all_pairs_shortest_path_test.cc

    r2269 r2335  
    2929
    3030#include <lemon/fib_heap.h>
     31
     32#include <lemon/path.h>
    3133
    3234#include <lemon/time_measure.h>
     
    9193  }   
    9294
     95  bool checked_path = false;
     96
    9397  for (NodeIt it(graph); it != INVALID; ++it) {
    9498    for (NodeIt jt(graph); jt != INVALID; ++jt) {
     
    98102            "Wrong connection in all pairs shortest path");
    99103      if (johnson.connected(it, jt)) {
     104        if (it != jt && !checked_path) {
     105          {
     106            Path<Graph> path = johnson.path(it, jt);
     107            check(checkPath(graph, path), "Wrong path.");
     108            check(pathSource(graph, path) == it, "Wrong path.");
     109            check(pathTarget(graph, path) == jt, "Wrong path.");
     110          }
     111          {
     112            Path<Graph> path = floyd.path(it, jt);
     113            check(checkPath(graph, path), "Wrong path.");
     114            check(pathSource(graph, path) == it, "Wrong path.");
     115            check(pathTarget(graph, path) == jt, "Wrong path.");
     116          }
     117          checked_path = true;
     118          std::cout << "Path checked" << std::endl;
     119        }
    100120        check(johnson.dist(it, jt) == floyd.dist(it, jt),
    101121              "Wrong distance in all pairs shortest path");
Note: See TracChangeset for help on using the changeset viewer.