Gurobi dosen't find all possible solution

174 views
Skip to first unread message

baptiste...@gmail.com

unread,
May 23, 2017, 1:35:02 PM5/23/17
to Gurobi Optimization
Hi,

I'm currently trying to modelize something in a MILP problem and want to check if my modelization is correct.
To do so, I generate a MILP system (system_test.lp) for which I know all solutions.

The variables in which I'm interested in this system are : a,b,m0,m1,m2,m3,n0,n1,n2,n3
I know that there are 720 solutions in those variables, listed in theoricSolution.txt, in the previous order.

However, when I try to search for all those solutions (Params.PoolSearchMode = 2 and Params.PoolSolutions = 720), Gurobi only find 691 solutions, listed in foundSolution.txt. The missing solutions are in missingSolution.txt.
I checked that each missing solution is however a valid solution of the model (by adding constrain like "a == value_of_a_in_a_solution") and check feasibility of the model.

Is there any reason why Gurobi would "miss" some solutions ? Did I forgot to set some parameters to a specific value ?

Thanks in advance for your answer,

Cheers,

Baptiste Lambin
system_test.lp
foundSolution.txt
missingSolution.txt
theoricSolution.txt

Daniel Espinoza

unread,
May 24, 2017, 7:51:53 AM5/24/17
to Gurobi Optimization
Hi Baptiste,

Did you set PoolSearchMode=2 ? If I do so I get them all.

Best
Daniel

baptiste...@gmail.com

unread,
May 24, 2017, 8:12:18 AM5/24/17
to Gurobi Optimization
Hi Daniel,
Yes definitely, I joined the gurobi.log. This is odd..
gurobi.log

baptiste...@gmail.com

unread,
May 24, 2017, 8:19:09 AM5/24/17
to Gurobi Optimization
Double answer, but I tried to read the model from the .lp file rather than directly create the model.
So when I do :

m = read("system_test.lp")
m.Params.PoolSearchMode = 2
m.Params.PoolSolutions = 1000
m.optimize()

Gurobi find all the 720 solutions.

Bu when I generate the system with my script (with m.addVar(...) etc.), and ask Gurobi to optimize it, it only find 691 solutions... I joined the script I used, but this is really odd since the .lp file was obtained with m.write..
system_test.py

Tobias Achterberg

unread,
May 24, 2017, 9:01:50 AM5/24/17
to gur...@googlegroups.com
Please use .mps file format for tasks like this. The .lp file format is
human-readable, but it does not preserve the exact structure of the model.
Namely, some decimal places of coefficients may be truncated and the order of
the columns in the problem will change.

The .mps format makes sure that you get a bit-wise identical problem when you
read it back in.

Regards,

Tobias

baptiste...@gmail.com

unread,
May 24, 2017, 9:21:07 AM5/24/17
to Gurobi Optimization
Hi Tobias,

Sorry about that, I joined the .mps file.
This time indeed, when I read back the file, Gurobi still only find 691 solutions.
system_test.mps

Daniel Espinoza

unread,
May 24, 2017, 12:50:37 PM5/24/17
to Gurobi Optimization
Hi Baptiste,

Thanks for sending both mps and lp file... I can reproduce the issue and will take a look

Thanks,
Daniel

Daniel Espinoza

unread,
May 25, 2017, 6:59:06 AM5/25/17
to Gurobi Optimization
Hi Baptiste,

We found the issue and it will be fixed in the next release, unfortunately, there is no work-around to ensure that it will not happen with v7.0.2

Best regards,
Daniel

baptiste...@gmail.com

unread,
May 27, 2017, 4:48:26 PM5/27/17
to Gurobi Optimization
Hi Daniel,

Thanks for your quick answer. Do you have any idea when the next release would come out ?

Regards,
Baptiste

Daniel Espinoza

unread,
May 29, 2017, 8:50:15 AM5/29/17
to Gurobi Optimization
Hi Baptiste,

I can't give you an exact date, sorry about it

Best
Daniel

baptiste...@gmail.com

unread,
Jun 6, 2017, 1:17:20 PM6/6/17
to Gurobi Optimization
Hi again,

I post here as the issue is the same, but on another model.
Gurobi find 217 solutions instead of 243 (over 256 total possible vectors of values for the variables x), while when manually checked, all the 243 theoritical solutions leads to a feasible model (and the 13 remaining leads to an infeasible model)
I joined a .tar.gz archive containing :
- gensys.py : python script to generate the system, as well as the other remaining files (if needed for any reason)
- model.lp and model.mps : model in .lp and .mps format (indeed)
- as before, 3 .txt files containing the theoritical solutions (243 vectors), the solutions that Gurobi found (217) and the missing solutions (26), as tuple representing the values of (x[0],...,x[7]) (the variables c[i] are only here for the OR GenConstr)

This may be the result of the same issue as for the previous model I posted, but anyway still worth mentioning I guess.

Regards,

Baptiste Lambin
multipleSol_listColorCover.tar.gz

Michael Winkler

unread,
Jun 6, 2017, 1:49:11 PM6/6/17
to Gurobi Optimization
Thank you for your second example, I just confirmed that this issue is fixed for this one. Sorry for the inconvenience.

Best,
Michael
Reply all
Reply to author
Forward
0 new messages