Why couldn't I check my input starting point ?

71 views
Skip to first unread message

b Yang4869

unread,
Aug 23, 2016, 12:18:36 AM8/23/16
to Gurobi Optimization
Hi Gurobi community,

I'm using gurobi to solve a LP. I know a feasible solution which is very near optimal, so I want to set this solution as the starting point by using the paremeter "GRB_DoubleAttr_Start". 

The code I write is:
coeff_vars[i][k][j].set(GRB_DoubleAttr_Start, coefficient[i][k][j]);

However, when I try to check whether I input the correct starting point, I find I can't output the value of the variable by using

cout << coeff_vars[i][k][j].get(GRB_DoubleAttr_X)<<" ";

Does it mean I don't input the starting point successfully? How could I output the value of the variables in this case?

Thanks

Bo


Sonja Mars

unread,
Aug 23, 2016, 6:05:46 AM8/23/16
to gur...@googlegroups.com
Hi Bo,

Do you call update() after setting the start values? Gurobi will not process any changes immediately. It will wait until a call to optimize() or update() Please see here for more details: http://www.gurobi.com/documentation/6.5/refman/cpp_grbmodel_update.html

Additionally, please take a look at FAQ #16 on this page: http://www.gurobi.com/support/faqs


Furthermore, with cout << coeff_vars[i][k][j].get(GRB_DoubleAttr_X)<<" "; you cannot see the values of the MIP Start, i.e. GRB_DoubleAttr_Start. In GRB_DoubleAttr_X Gurobi stores the values of the optimal solution, after the optimization is done. If you are interested in the MIP Start values, you will have to print GRB_DoubleAttr_Start.


Best regards,
Sonja


----
Dr. Sonja Mars
Gurobi Optimization - Technical Support






b Yang4869

unread,
Aug 29, 2016, 12:15:42 AM8/29/16
to Gurobi Optimization
Thanks for your reply !

在 2016年8月23日星期二 UTC-4上午6:05:46,Sonja Mars写道:
Reply all
Reply to author
Forward
0 new messages