Fix in HaoOrlin (#264)
authorBalazs Dezso <deba@inf.elte.hu>
Sat, 18 Apr 2009 21:01:12 +0200
changeset 5892ca0cdb5f366
parent 588 293551ad254f
child 591 f63e87b9748e
Fix in HaoOrlin (#264)
lemon/hao_orlin.h
test/hao_orlin_test.cc
     1.1 --- a/lemon/hao_orlin.h	Wed Apr 15 09:37:51 2009 +0200
     1.2 +++ b/lemon/hao_orlin.h	Sat Apr 18 21:01:12 2009 +0200
     1.3 @@ -226,6 +226,7 @@
     1.4  
     1.5        for (NodeIt n(_graph); n != INVALID; ++n) {
     1.6          (*_excess)[n] = 0;
     1.7 +        (*_source_set)[n] = false;
     1.8        }
     1.9  
    1.10        for (ArcIt a(_graph); a != INVALID; ++a) {
    1.11 @@ -525,6 +526,7 @@
    1.12  
    1.13        for (NodeIt n(_graph); n != INVALID; ++n) {
    1.14          (*_excess)[n] = 0;
    1.15 +        (*_source_set)[n] = false;
    1.16        }
    1.17  
    1.18        for (ArcIt a(_graph); a != INVALID; ++a) {
     2.1 --- a/test/hao_orlin_test.cc	Wed Apr 15 09:37:51 2009 +0200
     2.2 +++ b/test/hao_orlin_test.cc	Sat Apr 18 21:01:12 2009 +0200
     2.3 @@ -111,30 +111,24 @@
     2.4      ho.run();
     2.5      ho.minCutMap(cut);
     2.6      
     2.7 -    // BUG: The cut value should be positive
     2.8 -    check(ho.minCutValue() == 0, "Wrong cut value");
     2.9 -    // BUG: It should work
    2.10 -    //check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value");
    2.11 +    check(ho.minCutValue() == 1, "Wrong cut value");
    2.12 +    check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value");
    2.13    }
    2.14    {
    2.15      HaoOrlin<SmartDigraph> ho(graph, cap2);
    2.16      ho.run();
    2.17      ho.minCutMap(cut);
    2.18 -    
    2.19 -    // BUG: The cut value should be positive
    2.20 -    check(ho.minCutValue() == 0, "Wrong cut value");
    2.21 -    // BUG: It should work
    2.22 -    //check(ho.minCutValue() == cutValue(graph, cap2, cut), "Wrong cut value");
    2.23 +
    2.24 +    check(ho.minCutValue() == 1, "Wrong cut value");
    2.25 +    check(ho.minCutValue() == cutValue(graph, cap2, cut), "Wrong cut value");
    2.26    }
    2.27    {
    2.28      HaoOrlin<SmartDigraph> ho(graph, cap3);
    2.29      ho.run();
    2.30      ho.minCutMap(cut);
    2.31      
    2.32 -    // BUG: The cut value should be positive
    2.33 -    check(ho.minCutValue() == 0, "Wrong cut value");
    2.34 -    // BUG: It should work
    2.35 -    //check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value");
    2.36 +    check(ho.minCutValue() == 1, "Wrong cut value");
    2.37 +    check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value");
    2.38    }
    2.39    
    2.40    typedef Undirector<SmartDigraph> UGraph;
    2.41 @@ -145,30 +139,24 @@
    2.42      ho.run();
    2.43      ho.minCutMap(cut);
    2.44      
    2.45 -    // BUG: The cut value should be 2
    2.46 -    check(ho.minCutValue() == 1, "Wrong cut value");
    2.47 -    // BUG: It should work
    2.48 -    //check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value");
    2.49 +    check(ho.minCutValue() == 2, "Wrong cut value");
    2.50 +    check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value");
    2.51    }
    2.52    {
    2.53      HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap2);
    2.54      ho.run();
    2.55      ho.minCutMap(cut);
    2.56      
    2.57 -    // TODO: Check this cut value
    2.58 -    check(ho.minCutValue() == 4, "Wrong cut value");
    2.59 -    // BUG: It should work
    2.60 -    //check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value");
    2.61 +    check(ho.minCutValue() == 5, "Wrong cut value");
    2.62 +    check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value");
    2.63    }
    2.64    {
    2.65      HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap3);
    2.66      ho.run();
    2.67      ho.minCutMap(cut);
    2.68      
    2.69 -    // TODO: Check this cut value
    2.70      check(ho.minCutValue() == 5, "Wrong cut value");
    2.71 -    // BUG: It should work
    2.72 -    //check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value");
    2.73 +    check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value");
    2.74    }
    2.75  
    2.76    return 0;