src/work/athos/mincostflows_test.cc
changeset 528 c00f6ebbe1e6
parent 520 e4a6300616f9
child 530 d9c06ac0b3a3
equal deleted inserted replaced
1:5a4e7a2f8cf6 0:70f1cdc26479
     1 #include <iostream>
     1 #include <iostream>
     2 #include <list_graph.h>
     2 #include <list_graph.h>
     3 #include <minlengthpaths.h>
     3 #include <mincostflows.h>
     4 #include <path.h>
     4 //#include <path.h>
       
     5 #include <maps.h>
     5 
     6 
     6 using namespace std;
     7 using namespace std;
     7 using namespace hugo;
     8 using namespace hugo;
     8 
     9 
     9 
    10 
    58   length.set(v2_v5, 1);
    59   length.set(v2_v5, 1);
    59   length.set(v3_v5, 5);
    60   length.set(v3_v5, 5);
    60   length.set(v4_t, 8);
    61   length.set(v4_t, 8);
    61   length.set(v5_t, 8);
    62   length.set(v5_t, 8);
    62 
    63 
       
    64   ConstMap const1map(1);
    63   std::cout << "Minlengthpaths algorithm test..." << std::endl;
    65   std::cout << "Minlengthpaths algorithm test..." << std::endl;
    64 
    66 
    65   
    67   
    66   int k=3;
    68   int k=3;
    67   MinLengthPaths< ListGraph, ListGraph::EdgeMap<int> >
    69   MinCostFlows< ListGraph, ListGraph::EdgeMap<int> >
    68     surb_test(graph, length);
    70     surb_test(graph, length, const1map);
    69 
    71 
    70   check(  surb_test.run(s,t,k) == 2 && surb_test.totalLength() == 46,"Two paths, total length should be 46");
    72   check(  surb_test.run(s,t,k) == 2 && surb_test.totalLength() == 46,"Two paths, total length should be 46");
    71 
    73 
    72   typedef DirPath<ListGraph> DPath;
    74   typedef DirPath<ListGraph> DPath;
    73   DPath P(graph);
    75   DPath P(graph);