test/hao_orlin_test.cc
changeset 871 86613aa28a0c
parent 596 293551ad254f
child 877 141f9c0db4a3
child 1007 7e368d9b67f7
equal deleted inserted replaced
2:a133dd0391e2 3:30df7fae2ffd
   109   {
   109   {
   110     HaoOrlin<SmartDigraph> ho(graph, cap1);
   110     HaoOrlin<SmartDigraph> ho(graph, cap1);
   111     ho.run();
   111     ho.run();
   112     ho.minCutMap(cut);
   112     ho.minCutMap(cut);
   113     
   113     
   114     // BUG: The cut value should be positive
   114     check(ho.minCutValue() == 1, "Wrong cut value");
   115     check(ho.minCutValue() == 0, "Wrong cut value");
   115     check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value");
   116     // BUG: It should work
       
   117     //check(ho.minCutValue() == cutValue(graph, cap1, cut), "Wrong cut value");
       
   118   }
   116   }
   119   {
   117   {
   120     HaoOrlin<SmartDigraph> ho(graph, cap2);
   118     HaoOrlin<SmartDigraph> ho(graph, cap2);
   121     ho.run();
   119     ho.run();
   122     ho.minCutMap(cut);
   120     ho.minCutMap(cut);
   123     
   121 
   124     // BUG: The cut value should be positive
   122     check(ho.minCutValue() == 1, "Wrong cut value");
   125     check(ho.minCutValue() == 0, "Wrong cut value");
   123     check(ho.minCutValue() == cutValue(graph, cap2, cut), "Wrong cut value");
   126     // BUG: It should work
       
   127     //check(ho.minCutValue() == cutValue(graph, cap2, cut), "Wrong cut value");
       
   128   }
   124   }
   129   {
   125   {
   130     HaoOrlin<SmartDigraph> ho(graph, cap3);
   126     HaoOrlin<SmartDigraph> ho(graph, cap3);
   131     ho.run();
   127     ho.run();
   132     ho.minCutMap(cut);
   128     ho.minCutMap(cut);
   133     
   129     
   134     // BUG: The cut value should be positive
   130     check(ho.minCutValue() == 1, "Wrong cut value");
   135     check(ho.minCutValue() == 0, "Wrong cut value");
   131     check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value");
   136     // BUG: It should work
       
   137     //check(ho.minCutValue() == cutValue(graph, cap3, cut), "Wrong cut value");
       
   138   }
   132   }
   139   
   133   
   140   typedef Undirector<SmartDigraph> UGraph;
   134   typedef Undirector<SmartDigraph> UGraph;
   141   UGraph ugraph(graph);
   135   UGraph ugraph(graph);
   142   
   136   
   143   {
   137   {
   144     HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap1);
   138     HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap1);
   145     ho.run();
   139     ho.run();
   146     ho.minCutMap(cut);
   140     ho.minCutMap(cut);
   147     
   141     
   148     // BUG: The cut value should be 2
   142     check(ho.minCutValue() == 2, "Wrong cut value");
   149     check(ho.minCutValue() == 1, "Wrong cut value");
   143     check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value");
   150     // BUG: It should work
       
   151     //check(ho.minCutValue() == cutValue(ugraph, cap1, cut), "Wrong cut value");
       
   152   }
   144   }
   153   {
   145   {
   154     HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap2);
   146     HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap2);
   155     ho.run();
   147     ho.run();
   156     ho.minCutMap(cut);
   148     ho.minCutMap(cut);
   157     
   149     
   158     // TODO: Check this cut value
   150     check(ho.minCutValue() == 5, "Wrong cut value");
   159     check(ho.minCutValue() == 4, "Wrong cut value");
   151     check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value");
   160     // BUG: It should work
       
   161     //check(ho.minCutValue() == cutValue(ugraph, cap2, cut), "Wrong cut value");
       
   162   }
   152   }
   163   {
   153   {
   164     HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap3);
   154     HaoOrlin<UGraph, SmartDigraph::ArcMap<int> > ho(ugraph, cap3);
   165     ho.run();
   155     ho.run();
   166     ho.minCutMap(cut);
   156     ho.minCutMap(cut);
   167     
   157     
   168     // TODO: Check this cut value
       
   169     check(ho.minCutValue() == 5, "Wrong cut value");
   158     check(ho.minCutValue() == 5, "Wrong cut value");
   170     // BUG: It should work
   159     check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value");
   171     //check(ho.minCutValue() == cutValue(ugraph, cap3, cut), "Wrong cut value");
       
   172   }
   160   }
   173 
   161 
   174   return 0;
   162   return 0;
   175 }
   163 }