bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-glpk] LP solution returned after solving MIP successfully


From: Mritunjay Singh
Subject: [Bug-glpk] LP solution returned after solving MIP successfully
Date: Sun, 24 Aug 2003 16:30:49 -0700 (PDT)

I have a small MIP in an mps file (attached). I tried solving it using glpsol 
and got the
correct result (both the objective value and variable values were correct). 

I then tried using the java interface to read the same mps file and solve it. I 
had
logging turned on. The logs showed that it first found the correct LP solution 
and then
the correct IP solution. 

However when I use the java procedural interface to read back the solution I 
get the
solution of the LP not the IP.

With reference to the mps file, please note that C0000043, C0000044, C0000045 
are integer
(binary) variables but the solution has them with fractional values. The LP 
optimal
objective value is 104 and the IP optimal is 3839.

Here's the relevant portion of the java program:

    GlpkSolver lp = GlpkSolver.readMps("GLPK.mps");
    lp.enablePrints(true);
    lp.advBasis();
    lp.scaleProb();
    lp.simplex();
    lp.integer();

    double objective = lp.getObjVal();

    double[] solution = new double[numVars];
    GlpkSolverInfo lpSolverInfo = new GlpkSolverInfo();
    for(int i=0;i<numVars;i++)
    { 
      lp.getColInfo(i+1, lpSolverInfo);
      solution[i] = lpSolverInfo.vx;
    }


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Attachment: GLPK.mps
Description: GLPK.mps


reply via email to

[Prev in Thread] Current Thread [Next in Thread]