How to store multiple solutions with the same objVal in my SolPool?
回答済みI have set the solution params according to online tutorial as follow.
model_handler.build_sp(data)
model_handler.SP.Params.PoolSolutions = 30
model_handler.SP.Params.PoolSearchMode = 2
model_handler.SP.optimize()
model_handler.SP.Params.PoolSolutions = 30
model_handler.SP.Params.PoolSearchMode = 2
model_handler.SP.optimize()
However, the SolPool is still 1, seen as follow:
model_handler.SP.SolCount
Python 3.9.6 (default, Dec 7 2023, 05:42:47)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.6.0 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 8.6.0
Out[1]: 1
Python 3.9.6 (default, Dec 7 2023, 05:42:47)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.6.0 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 8.6.0
Out[1]: 1
When I add a constraint to avoid the same solution to the model and solved it, another solution comes with the same objVal. This told the model has other good solution. I want k of them stored in the solution pool.
0
-
正式なコメント
This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support. -
Do the solutions you found, only differ in the value of continuous variables or also in binary/integer variables? See this article for some limitations, e.g. how we consider whether two solutions are equal or not. Let me know if that helps!
1 -
THANKS. The variables are all continuous type, and comes out to be 0 or 1 in the solution. I can't find the article, is there any link?
0 -
Apologies, something went wrong there - I just added the link above.
1 -
MANY THANKS! Turning the type to binary works.
0
投稿コメントは受け付けていません。
コメント
5件のコメント