> I have a question concerning the difference between glpsol and the C-API 
> of glpk.
> 
> The attached C source code file test.c contains a very tiny linear 
> optimization problem, the problem gets solved by glp_simplex and the 
> value of the objective function and of the primary variables after 
> optimization are printed out.  Before the optimization, the problem will 
> be written to an lp file test.lp.
> 
> Using this file with glpsol, gives another result than the C-API 
> (objective value stays the same, but the values of the variables differ 
> in some cases).
> 
> glpsol --lp test.lp -o test.sol
> 
> I am using glpk version 4.45 on debian wheezy (stable).

Please note that the most recent version is 4.53.

> 
> Is there any explanation for this behavior?
> 

This usually happens when the lp is dual degenerate, in which case it
has multiple optima. (Imagine that the objective function is zero; then
every feasible solution would be optimal.) If, for example, you don't
use the lp presolver and/or scaling while glpsol does (by default), you
may obtain different optimal solutions.




_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to