COIN-OR::LEMON - Graph Library

Ticket #264: 2ca0cdb5f366.patch

File 2ca0cdb5f366.patch, 3.5 KB (added by Balazs Dezso, 16 years ago)

Bug fix in HaoOrlin?

  • lemon/hao_orlin.h

    # HG changeset patch
    # User Balazs Dezso <deba@inf.elte.hu>
    # Date 1240081272 -7200
    # Node ID 2ca0cdb5f366b786af35f7a426cedf3e7268b0cb
    # Parent  293551ad254f3014636873178d16cdd084d37ad7
    Fix in HaoOrlin (#264)
    
    diff -r 293551ad254f -r 2ca0cdb5f366 lemon/hao_orlin.h
    a b  
    226226
    227227      for (NodeIt n(_graph); n != INVALID; ++n) {
    228228        (*_excess)[n] = 0;
     229        (*_source_set)[n] = false;
    229230      }
    230231
    231232      for (ArcIt a(_graph); a != INVALID; ++a) {
     
    525526
    526527      for (NodeIt n(_graph); n != INVALID; ++n) {
    527528        (*_excess)[n] = 0;
     529        (*_source_set)[n] = false;
    528530      }
    529531
    530532      for (ArcIt a(_graph); a != INVALID; ++a) {
  • test/hao_orlin_test.cc

    diff -r 293551ad254f -r 2ca0cdb5f366 test/hao_orlin_test.cc
    a b  
    111111    ho.run();
    112112    ho.minCutMap(cut);
    113113   
    114     // BUG: The cut value should be positive
    115     check(ho.minCutValue() == 0, "Wrong cut value");
    116     // BUG: It should work
    117     //check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value");
     114    check(ho.minCutValue() == 1, "Wrong cut value");
     115    check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value");
    118116  }
    119117  {
    120118    HaoOrlin<SmartDigraph> ho(graph, cap2);
    121119    ho.run();
    122120    ho.minCutMap(cut);
    123    
    124     // BUG: The cut value should be positive
    125     check(ho.minCutValue() == 0, "Wrong cut value");
    126     // BUG: It should work
    127     //check(ho.minCutValue() == cutValue(graph, cap2, cut), "Wrong cut value");
     121
     122    check(ho.minCutValue() == 1, "Wrong cut value");
     123    check(ho.minCutValue() == cutValue(graph, cap2, cut), "Wrong cut value");
    128124  }
    129125  {
    130126    HaoOrlin<SmartDigraph> ho(graph, cap3);
    131127    ho.run();
    132128    ho.minCutMap(cut);
    133129   
    134     // BUG: The cut value should be positive
    135     check(ho.minCutValue() == 0, "Wrong cut value");
    136     // BUG: It should work
    137     //check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value");
     130    check(ho.minCutValue() == 1, "Wrong cut value");
     131    check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value");
    138132  }
    139133 
    140134  typedef Undirector<SmartDigraph> UGraph;
     
    145139    ho.run();
    146140    ho.minCutMap(cut);
    147141   
    148     // BUG: The cut value should be 2
    149     check(ho.minCutValue() == 1, "Wrong cut value");
    150     // BUG: It should work
    151     //check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value");
     142    check(ho.minCutValue() == 2, "Wrong cut value");
     143    check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value");
    152144  }
    153145  {
    154146    HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap2);
    155147    ho.run();
    156148    ho.minCutMap(cut);
    157149   
    158     // TODO: Check this cut value
    159     check(ho.minCutValue() == 4, "Wrong cut value");
    160     // BUG: It should work
    161     //check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value");
     150    check(ho.minCutValue() == 5, "Wrong cut value");
     151    check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value");
    162152  }
    163153  {
    164154    HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap3);
    165155    ho.run();
    166156    ho.minCutMap(cut);
    167157   
    168     // TODO: Check this cut value
    169158    check(ho.minCutValue() == 5, "Wrong cut value");
    170     // BUG: It should work
    171     //check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value");
     159    check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value");
    172160  }
    173161
    174162  return 0;