> Thanks for your reply. Yes, I know the latest version is 4.32. But > since version 4.8 has Java API provided by Bjoern > (http://bjoern.dapnet.de/glpk/index.htm), my Java programs used the > API.
> I tried other coefficients. It turns out for larger values, I got > strange results as well. This may be because I'm trying to solve > feasibility problem, so I modified my subject a bit. > Below is an example of the feasibility problem (I don't need objective > function. In my implementation, I use a fake objective function z = x1 > + x2): > The LP is as follows: > Maximize > z = x1 + x2 > 0.04600662731785218 x1 - 1 x2 <= 0 > 0.0036805289240121435 x1 - 1 x2 <= 0 > 0.08833272571169222 x1 - 1 x2 <= 0 > x1 + x2 = 1 > We can see that (x1 = 0, x2 =1) is a feasible solution. > The glpk tells me that the problem is feasible, but the values of x1 > and x2 are both 0, which contradicts with my constraint x1 + x2 = 1. > I figured that if I change my problem to the follows, glpk works. > Maximize > z = x1 + x2 > 0.04600662731785218 x1 <= 0 > 0.0036805289240121435 x1 <= 0 > 0.08833272571169222 x1 <= 0 > x1 + x2 = 1 > glpk tells me that: (x1 = 0, x2 =1) is a feasible solution. This is > what I expected. > Can you explain why glpk gives me strange results in the first problem? I cannot reproduce the error. In all cases I tried using various options that might affect the mip solver the solution is the same: x1 = 0 and x2 = 1. Could you include a call to lpx_print_mip and lpx_write_mps and post me the output files corresponding to incorrect solution? Thanks. (If you are searching for an integer feasible solution, minimizing the sum of infeasibilities would be more reasonable; see example model sat.mod included in the glpk distribution.) _______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
