Gurobi returns strange output from .sol file

159 views
Skip to first unread message

lahlou aziz

unread,
Oct 18, 2017, 4:31:25 PM10/18/17
to Gurobi Optimization
Hi,

After solving my optimization model for some inputs and constraints, the result is recorded in ""solution.sol"".

When looking into that file, it shows that it contains this snapshot and does not show the values of the decision variables obtained. This behaviour is observed only when changing the sign of a constraint I have from <= to == :
# Objective value = 0.092
B0(6) 1
B1(7) 0
B2(9) 0
B3(6) 0
B4(6) 0
B5(7) 0
B6(5) 0
B7(8) 0
B8(10) 0
B9(14) 0
B10(8) 1
B11(8) 0
B12(10) 0
B13(6) 0
B14(6) 0
B15(7) 0
B16(9) 0
B17(6) 0
B18(6) 0
B19(7) 0
B20(5) 1

Could you please shed some lights on this issue.

Thanks

Tobias Achterberg

unread,
Oct 18, 2017, 4:51:36 PM10/18/17
to gur...@googlegroups.com
What exactly is the issue? I guess you are refering to the names of the variables that are
not the ones that you used. Did you specify names? Did you set the "IgnoreNames"
parameter? These are automatically generated names that you get when you do not specify
names or when you write out the model to an *.rew or *.rlp file.

Tobias

lahlou aziz

unread,
Oct 18, 2017, 5:11:34 PM10/18/17
to Gurobi Optimization
Yes I specified names for the variables.
However, I did not set the "IgnoreNames" parameter. I wrote out the model to an *.lp and *.sol files.

Aziz

Tobias Achterberg

unread,
Oct 18, 2017, 5:12:35 PM10/18/17
to gur...@googlegroups.com
This will also happen if you have duplicate or invalid names in your model. Watch out for
a log message that says something like "using default names".

Tobias

lahlou aziz

unread,
Oct 18, 2017, 6:50:53 PM10/18/17
to Gurobi Optimization
As a log output I get this :

Warning: linear constraint 40 and linear constraint 42 have the same name "const1"
Warning: linear constraint 40 and linear constraint 42 have the same name "const1"
Warning: default constraint names used to write mps file


Do you mean in that case I need to set IgnoreNames parameter ?

Regards
Aziz

Tobias Achterberg

unread,
Oct 18, 2017, 6:52:11 PM10/18/17
to gur...@googlegroups.com
No. You need to make sure to avoid duplicate names. Only if there are no duplicates you
will get *your* names in the mps/lp/sol files.

Tobias

lahlou aziz

unread,
Oct 19, 2017, 12:26:52 AM10/19/17
to Gurobi Optimization
I see, thanks.
Aziz
Reply all
Reply to author
Forward
0 new messages