Re-optimizing using Gurobi Callback
回答済みHi Guys,
I am working on Vehicle Platooning Problem and I would like to use Gurobi Callback function. I have a set of n vehicles, and I want to find the optimal solution for the first n-1 vehicles. Then using callback function, I would like to keep the solution for n-1 vehicles, add the last vehicle and reoptimize at this point. The vehicles are defined under certain constraints, so I try for the last vehicle to define its constraints as Lazy and replace them in the callback function.
Do I have to set the constraints of the last vehicle in the model before replacing them in the callback function?
In the callback function, do I need to do anything before setting lazy constraints?
Is there another way to find a solution to this problem?
Thank you in advance for your answers. NB: Please note that I am new to Gurobi.
-
正式なコメント
This post is more than three 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 why not try our AI Gurobot?. -
I don't understand why you want to use a callback function here. Inside a callback, you cannot modify or extend the model that you are currently solving. It sounds more like you want to have an outer loop around optimize() calls like this (pseudo code):
1. Create model for 1 vehicle
2. Solve model
3. For i = 2,...,n:
(a) Get solution for previous solve for i-1 vehicles
(b) Add variables and constraints to model to extend model to i vehicles
(c) Construct a MIP start for new model based on solution for i-1 vehicles
(d) Solve modelBest regards,
Tobias
0
投稿コメントは受け付けていません。
コメント
2件のコメント