Question

I am using glpsol to solve a rather big integer optimisation problem. The Simplex algorithm runs for about 30 mins on it, and after that glpsol tries to find integer solution using MIP solver.

Question: Can I split this into two steps using only the glpsol command tool, or should I use glpk API ?

I have tried "read" and "nomip" option that according to the documentation is

-r filename, --read filename

to read the solution from the provided filename rather than to find it with the solver

in this format:

 glpsol --cpxlp WhiskasModel.lp --write WhiskasSolution.mip --nomip

and after that

 glpsol --cpxlp WhiskasModel.lp --read WhiskasSolution.mip

but I receive an error:

 Reading MIP solution from `WhiskasModel.mip'...
 WhiskasModel.mip:33702: non-integer column valueUnable to read problem solution

and it is of course true because WhiskasModel.mip is an LP solution with nonint values.

I find the glpsol toolkit rather powerful and I want to play with some MIP options but on each step to wait 30 minutes is rather boring. Can I tell it, "use this LP solution and start MIP" ?

Était-ce utile?

La solution

One thing to try: write the LP basis to a plain text file, and then when re-starting, start with that LP solution as the basis.

Try

  -w WhiskasBasis.txt

and when restarting to continue on as an IP, ask it to use that basis by adding the ini option.

--ini WhiskasBasis.txt 

Other suggestions:

  1. I wouldn't use the command-line option if you are going to be doing this often. The GLPK API (for your language of choice) and with an IDE, will give you so much more flexibility and control. This link mentions several.

  2. If you post your MIP model formulation with the objective and the constraints (maybe as a different question), you might get suggestions to speed things up. Sometimes there are relaxations and sub-problems that can help tremendously.

Hope that helps.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top