Huge MIP model never finishes for certain input
回答済みDear Community,
I have a huge Pyomo MILP model (6,307,518 continuous vars and 350,400 integer vars). For a certain set of inputs (only for that one so far) I always run into a memory error. Either directly after the presolving, or sometimes after a very long time of root relaxation, when the model already found a sub-optimal solution.
Now I have two questions:
- Is there any way that I can save these sub-optimal solutions in case I ran into an error so I can at least use that one afterwards?
- I am slightly overwhelmed with all the parameters. I made some changes here and there but nothing seems to work to make the solving faster and most importantly more stable (not running into memory issues)
Many thanks and all the best
Axel
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Axel, Let me see if I can help with your questions:
Is there any way that I can save these sub-optimal solutions in case I ran into an error so I can at least use that one afterwards?
To store the sub-optimal solution, you can store the latest incumbent solution via Callbacks. Unfortunately, Pyomo does not allow for callbacks, so you would have to use another Gurobi interface (python, C, etc.). For example uses of callbacks, see Example Tour > More advanced features > Callbacks.
I am slightly overwhelmed with all the parameters. I made some changes here and there but nothing seems to work to make the solving faster and most importantly more stable (not running into memory issues)
To address the memory error, please review the recommendations in How do I avoid an out-of-memory condition? In particular, it is helpful to set NodeFileStart to 0.5. This tells Gurobi to compress the branch and bound tree and write to disk. I recommend starting here.
Once you are able to solve without a memory error, then you can move on to performance improving parameters. For this, I recommend checking out Gurobi's automatic Parameter Tuner. This can help you sift through Gurobi's many parameters.
0 -
Hi Alison,
thanks heaps for the help.
I use Pyomo in the Python consol but I guess it would still not work.
Thanks for tip regarding the memory issue. I will give it try and see what the model will give me the next day. Can it be that the problem is close to infeasible? Because I do not have this with the other cases a did. It cannot be infeasible I guess since I get a sub-obtimal solution.
All the best
Axel
0 -
Update: I changed the NodeFilestart parameter to 0.5 but I would still run into memory issues during the relaxation process. I got a bit further regarding number of nodes explored. If I go even lower, lets say 0.3, would that save me even more RAM?
Thanks ahead
0 -
I recommend checking out the other tips here: How do I avoid an out-of-memory condition?
0 -
Hey Axel, it looks like you can print out incumbent solutions using the SolFiles parameter. This can simplify the process I had mentioned with callbacks --- AND should it be useable in Pyomo.
If you set this parameter to a filename, Gurobi will print out solutions as they are found (in .sol format). For example, setting the parameter to value
solutions/mymodelwill create filesmymodel_0.sol,mymodel_1.sol, etc., in directorysolutions.0 -
Thanks Alison I will give that a try. I jus made it to 3493 nodes before running into an error.
0
投稿コメントは受け付けていません。
コメント
7件のコメント