COIN-OR::LEMON - Graph Library

Changeset 887:ec6a528dafd2 in lemon-0.x for src/test/preflow_test.cc


Ignore:
Timestamp:
09/20/04 10:27:34 (20 years ago)
Author:
jacint
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1195
Message:

new test graph

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/test/preflow_test.cc

    r880 r887  
    7272  std::string f_name;
    7373  if( getenv("srcdir") ) {
    74     f_name = std::string(getenv("srcdir")) + "/preflow_graph.inp";
     74    f_name = std::string(getenv("srcdir")) + "/preflow_graph.dim";
    7575  }
    7676  else {
    77     f_name = "preflow_graph.inp";
     77    f_name = "preflow_graph.dim";
    7878  }
    7979 
     
    8888
    8989  FlowMap flow(G,0);
     90
    9091 
     92
    9193  PType preflow_test(G, s, t, cap, flow);
    9294  preflow_test.run(PType::ZERO_FLOW);
    93  
    94    
     95   
    9596  CutMap mincut(G,false);
    9697  preflow_test.minCut(mincut);
     
    113114
    114115
     116
    115117  for(EdgeIt e(G); e!=INVALID; ++e) cap[e]=2*cap[e];
    116118  preflow_test.setCap(cap); 
    117 
    118   NodeIt tmp_node(G,t);
    119   ++tmp_node;
    120   t=tmp_node;
    121  
    122   preflow_test.setTarget(t); //the max flow value remains 2*flow_value
    123   //warning: ++t must be a valid node. In preflow_graph, it is.
    124119
    125120  preflow_test.phase1(PType::PRE_FLOW);
     
    142137  preflow_test.minMinCut(minmincut2);
    143138  min_min_cut_value=cut_value(G,minmincut2,cap);
    144 
    145139 
    146140  preflow_test.maxMinCut(maxmincut);
    147  
    148141  max_min_cut_value=cut_value(G,maxmincut,cap);
    149142
     
    154147        "The max flow value or the three min cut values were not doubled");
    155148
     149
     150
    156151  EdgeIt e(G);
    157   for( int i=1; i==1000; ++i ) {
    158     flow[e]=0;
     152  for( int i=1; i==10; ++i ) {
     153    flow.set(e,0);
    159154    ++e;
    160155  }
    161156
    162157  preflow_test.setFlow(flow);
     158
     159  NodeIt tmp1(G,s);
     160  ++tmp1;
     161  if ( tmp1 != INVALID ) s=tmp1;
     162
     163  NodeIt tmp2(G,t);
     164  ++tmp2;
     165  if ( tmp2 != INVALID ) t=tmp2;
     166
    163167  preflow_test.setSource(s);
    164 
     168  preflow_test.setTarget(t);
     169 
    165170  preflow_test.run();
    166171
Note: See TracChangeset for help on using the changeset viewer.