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