demo/lp_maxflow_demo.cc
changeset 2390 8450951a8e2d
parent 1956 a055123339d5
child 2391 14a343be7a5a
equal deleted inserted replaced
10:de098d11c276 11:d44a51c4cec6
    72   
    72   
    73   //Objective function: the flow value entering 't'
    73   //Objective function: the flow value entering 't'
    74   Lp::Expr obj;
    74   Lp::Expr obj;
    75   for(InEdgeIt  e(g,t);e!=INVALID;++e) obj+=x[e];
    75   for(InEdgeIt  e(g,t);e!=INVALID;++e) obj+=x[e];
    76   for(OutEdgeIt e(g,t);e!=INVALID;++e) obj-=x[e];
    76   for(OutEdgeIt e(g,t);e!=INVALID;++e) obj-=x[e];
    77   lp.setObj(obj);
    77   lp.obj(obj);
    78 
    78 
    79 
    79 
    80   //Maximization
    80   //Maximization
    81   lp.max();
    81   lp.max();
    82 
    82