help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Re: Different results for the same problem


From: Andrew Makhorin
Subject: [Help-glpk] Re: Different results for the same problem
Date: Mon, 4 Dec 2006 03:56:38 +0300

> I have a 0-1 MIP formulation of a scheduling problem. I employ the
> GLPK
> C API to represent my problem and use two function calls in the end
> to
> generate two input files in the CPLEX LP and fixed MPS format
> respectively
> for the same problem.
> 
> The calls I use are :
> 
>  lpx_write_mps(lp,"test.mps");
>   and
>  lpx_write_cpxlp(lp,"test.lpt");
> 
> I run them using the following commands.
> 
> ./glpsol --intopt --mps test.mps -o out2
> 
> and
> 
> ./glpsol --intopt --cpxlp test.lpt -o out1
> 
> Even though they represent the same problem, but I seem to be giving
> different results in the two cases. The file test.lpt seems to be
> give the
> correct value of the objective function=3 while test.mps gives an
> objective function value of zero.
> 
> I have attached the two files. Could you help me out with this
> problem?

This happens because your instance has free (unbounded) rows.
By default lpx_write_mps writes the objective function row only if
the instance has no free rows. To avoid the error you need to set
the control parameter LPX_K_MPSOBJ as follows:

   lpx_set_int_parm(lp, LPX_K_MPSOBJ, 1);

before a call to lpx_write_mps.





reply via email to

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