help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] [Fwd: Difference between glpsol and C-API]


From: Andrew Makhorin
Subject: Re: [Help-glpk] [Fwd: Difference between glpsol and C-API]
Date: Sun, 02 Mar 2014 18:32:27 +0400

> 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.






reply via email to

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