gurobi solution modeling #1374
Replies: 23 comments 21 replies
-
So how do you know the solution isn't optimal? And what do you mean with gurobi+. If you selected 'gurobi' as solver, and yalmip told you it cannot use 'gurobi', and you then selected 'gurobi+', it just means you asked yalmip to create a nonsense model for gurobi, and thus a nonsense solution will be returned |
Beta Was this translation helpful? Give feedback.
-
When calling gurobi in yalmip for solution, the objective function contains (2^x)*y, and x and y here are intvar sdpvar variables respectively. If you do not use implication, how to deal with approximation, is there any example
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply, because the data of integer x at this time is a little huge, if you use implication to find out the minimum need to simulate several times, so I want to approximate an optimal solution
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
implies is used in the model, and Gurobi is chosen to solve it. From the output lp file, implies that the default M value is 10000, is there a way to correct this value
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thank you, Sir. I opened the derivebounds.m file. Do I change the 1e4 Settings here.----------
M(isnan(M)) = inf;
M(isinf(M)) = 1e4; M = M+b;%+0.01;
m(isnan(m)) = -inf;
m(isinf(m)) = -1e4;m = m+b;%-0.01;
|
Beta Was this translation helpful? Give feedback.
-
Hello teacher, I have two models, one is a general model, whose optimization variables are represented by intvar, for verification; the other is a deterministic model, whose corresponding variables are input by the optimization result value of the first general model intvar variable, all of which call gurobi, and the solver parameters and other information of both are consistent. The difference is only that the value of a variable is intvar, and the value of a variable is input with the value of the optimization. The optimal value of the output of the two variables is all the same, but there are differences in some decision variables, which will not affect the target result. Can we consider these two models consistent, or what causes them
|
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply, do you mean the case of multiple solutions? It is indeed a bit like the case of multiple solutions. The difference between the two models is only that, in order to verify the general model, the output result of the general model optimization variable intvar is directly input to the deterministic model as the value double. The rest is the same, the objective function of both is the same. There are small differences in the remaining decision variables that run but have no effect on the objective function, or how to determine that this difference is due to multiple solutions rather than differences in optimization using intvar and double modeling respectively.
|
Beta Was this translation helpful? Give feedback.
-
Hello, the default implies in yalmip that the large M is 10000, and what about the variable, is there a limit on optimizing the variable
…------------------ 原始邮件 ------------------
发件人: "wnn2201" ***@***.***>;
发送时间: 2024年4月13日(星期六) 下午3:44
***@***.***>;
主题: 回复: [yalmip/YALMIP] gurobi solution modeling (Discussion #1374)
Thank you, Sir. I opened the derivebounds.m file. Do I change the 1e4 Settings here.----------
M(isnan(M)) = inf;
M(isinf(M)) = 1e4; M = M+b;%+0.01;
m(isnan(m)) = -inf;
m(isinf(m)) = -1e4;m = m+b;%-0.01;
|
Beta Was this translation helpful? Give feedback.
-
Teacher if the variables don't currently have upper and lower bounds set on them, then yalmip's default bounds on variables are 1e4 in derivebounds, which means the maximum value of the variable can only be taken to 1e4 here
wn
***@***.***
…------------------ 原始邮件 ------------------
发件人: "yalmip/YALMIP" ***@***.***>;
发送时间: 2024年4月13日(星期六) 下午3:35
***@***.***>;
***@***.******@***.***>;
主题: Re: [yalmip/YALMIP] gurobi solution modeling (Discussion #1374)
If YALMIP has resorted to the bound 10^4 it means you are not bounding variables sufficiently well or you have bad scaling in your model. If you against my advice would want to force a larger M and thus create even more numerically unstable and weak relaxations you will have to edit derivebounds.m
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Teacher if the variables don't currently have upper and lower bounds set on them, then yalmip's default bounds on variables are 1e4 in derivebounds, which means the maximum value of the variable can only be taken to 1e4 here,right?
wn
***@***.***
…------------------ 原始邮件 ------------------
发件人: "yalmip/YALMIP" ***@***.***>;
发送时间: 2024年4月13日(星期六) 下午3:35
***@***.***>;
***@***.******@***.***>;
主题: Re: [yalmip/YALMIP] gurobi solution modeling (Discussion #1374)
If YALMIP has resorted to the bound 10^4 it means you are not bounding variables sufficiently well or you have bad scaling in your model. If you against my advice would want to force a larger M and thus create even more numerically unstable and weak relaxations you will have to edit derivebounds.m
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
The solution found by using gurobi+ is not optimal, the output of decision variables is all upper limit, the yalmip version is 2021.03.31, and the gurobi version is 10.0.3. My problem is the same as the problem discussed before when the time is 2023,04,21. After turning off presolve, the result remains unchanged. How to solve this problem, and the installation of yalmip version and gurobi version has anything to do with it?
Beta Was this translation helpful? Give feedback.
All reactions