COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
01/31/05 18:00:12 (19 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1509
Message:

new functions for changing lower and upper bounds of variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/lp/max_flow_expression.cc

    r1104 r1110  
    5050  typedef Graph::EdgeMap<ColIt> EdgeIndexMap;
    5151  EdgeIndexMap edge_index_map(g);
    52   PrimalMap<Edge, EdgeIndexMap> lp_flow(lp, edge_index_map);
     52  PrimalMap<Edge, EdgeIndexMap> flow(lp, edge_index_map);
    5353
    5454  // capacity function
     
    5656    ColIt col_it=lp.addCol();
    5757    edge_index_map.set(e, col_it);
    58     if (cap[e]==0)
    59       lp.setColBounds(col_it, LPSolver::FIXED, 0, cap[e]);
    60     else
    61       lp.setColBounds(col_it, LPSolver::DOUBLE, 0, cap[e]);
     58    // interesting property in GLPK:
     59    // if you change the order of the following two lines, the
     60    // two runs of GLPK are extremely different
     61      lp.setColUpperBound(col_it, cap[e]);
     62      lp.setColLowerBound(col_it, 0);
    6263  }
    6364 
     
    8081  }
    8182  lp.solveSimplex();
    82   //std::cout << lp.colNum() << std::endl;
    83   //std::cout << lp.rowNum() << std::endl;
    84   //std::cout << "flow value: "<< lp.getObjVal() << std::endl;
    85   for (Graph::EdgeIt e(g); e!=INVALID; ++e)
    86     flow.set(e, lp_flow[e]);
     83  cout << "elapsed time: " << ts << endl;
    8784}
Note: See TracChangeset for help on using the changeset viewer.