COIN-OR::LEMON - Graph Library

Changeset 630:9ea585de06ea in lemon-0.x for src


Ignore:
Timestamp:
05/13/04 12:29:19 (21 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@821
Message:

I modified mincostflows_test.cc a little.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/test/mincostflows_test.cc

    r611 r630  
    5959  length.set(v2_v4, 5);
    6060  length.set(v2_v5, 1);
    61   length.set(v3_v5, 5);
     61  length.set(v3_v5, 4);
    6262  length.set(v4_t, 8);
    6363  length.set(v5_t, 8);
    6464
    65   ConstMap<Edge, int> const1map(1);
     65  ListGraph::EdgeMap<int> capacity(graph);
     66
     67  capacity.set(s_v1, 2);
     68  capacity.set(v1_v2, 2);
     69  capacity.set(s_v3, 1);
     70  capacity.set(v2_v4, 1);
     71  capacity.set(v2_v5, 1);
     72  capacity.set(v3_v5, 1);
     73  capacity.set(v4_t, 1);
     74  capacity.set(v5_t, 2);
     75
     76  //  ConstMap<Edge, int> const1map(1);
    6677  std::cout << "Mincostflows algorithm test..." << std::endl;
    6778
    68  
    69   int k=3;
    70   MinCostFlows< ListGraph, ListGraph::EdgeMap<int>, ConstMap<Edge, int> >
    71     surb_test(graph, length, const1map);
     79  MinCostFlows< ListGraph, ListGraph::EdgeMap<int>, ListGraph::EdgeMap<int> >
     80    surb_test(graph, length, capacity);
    7281
    73   check(  surb_test.run(s,t,k) == 2 && surb_test.totalLength() == 46,"Two paths, total length should be 46");
     82  int k=1;
    7483
    75   check(surb_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?");
    76 
    77   k=1;
    7884  check(  surb_test.run(s,t,k) == 1 && surb_test.totalLength() == 19,"One path, total length should be 19");
    7985
    8086  check(surb_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?");
    8187 
     88  k=2;
     89 
     90  check(  surb_test.run(s,t,k) == 2 && surb_test.totalLength() == 41,"Two paths, total length should be 41");
     91
     92  check(surb_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?");
     93 
     94 
     95  k=4;
     96
     97  check(  surb_test.run(s,t,k) == 3 && surb_test.totalLength() == 64,"Three paths, total length should be 64");
     98
     99  check(surb_test.checkComplementarySlackness(), "Is the primal-dual solution pair really optimal?");
     100
    82101
    83102  cout << (passed ? "All tests passed." : "Some of the tests failed!!!")
Note: See TracChangeset for help on using the changeset viewer.