athos@2146: #include athos@2146: //#include athos@2146: athos@2146: using namespace lemon; athos@2146: athos@2146: int main(){ athos@2146: athos@2146: //MipGlpk ilp; athos@2146: athos@2146: Mip ilp; athos@2146: athos@2148: athos@2146: typedef Mip::Row Row; athos@2146: typedef Mip::Col Col; athos@2146: athos@2146: ilp.max(); athos@2146: athos@2146: Col x1 = ilp.addCol(); athos@2146: Col x2 = ilp.addCol(); athos@2146: Col x3 = ilp.addCol(); athos@2146: athos@2146: ilp.integer(x1,true); athos@2146: ilp.integer(x2,true); athos@2146: ilp.integer(x3,true); athos@2146: athos@2146: ilp.addRow(x1+x2+x3 <=100); athos@2146: ilp.addRow(10*x1+4*x2+5*x3<=600); athos@2146: ilp.addRow(2*x1+2*x2+6*x3<=300); athos@2146: athos@2146: ilp.colLowerBound(x1, 0); athos@2146: ilp.colLowerBound(x2, 0); athos@2146: ilp.colLowerBound(x3, 0); athos@2146: //Objective function deba@2369: ilp.obj(10*x1+6*x2+4*x3); athos@2146: athos@2146: //Call the routine of the underlying LP solver athos@2146: ilp.solve(); athos@2146: athos@2146: //Print results athos@2146: if (ilp.primalStatus()==LpSolverBase::OPTIMAL){ athos@2146: std::cout<<"Optimal solution found!"<