help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Cannot get integer case to work


From: Andrew Makhorin
Subject: Re: [Help-glpk] Cannot get integer case to work
Date: Tue, 25 Aug 2009 16:41:38 +0400

> As a first-time user of glpk, I tried an example from an old university
> text book.  The model is given in comments in the enclosed C source code
> below.

> I am using a Fedora 11 machine;  uname gives this output:
> 2.6.29.6-217.2.3.fc11.x86_64 #1 SMP Wed Jul 29 16:02:42 EDT 2009 x86_64
> x86_64 x86_64 GNU/Linux
> The gcc version is 4.4.0, and the glpk version is 4.36 according to the
> header file.

> I don't know if I have found a bug or just need advice on correct usage
> of the library.  When I asked for a regular LP solution, it gave me the
> correct answer of
> z==55.083333333333328596, x==4.25, y==3.1666666666666665186

> However when I asked for an integer solution, I got
> z==0, x==0, y==0

> which is incorrect.  The correct optimal integer solution is x=3, y=4,
> giving an objective value of z=53.

> I only went by the API description in the documentation.  Did I set up
> the problem incorrectly?  Is there a way to get this to work in the 
> integer case?

Glp_intopt requires an optimal solution to lp relaxation, i.e. in case
of mip you need to call glp_simplex first and then call glp_intopt.






reply via email to

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