Hi,
I have a couple of questions in regards to "copy a model" and reuse it. I am working with Java interface.
1. what is the difference between the following scenarios if I want to reuse a built model. I haven't benchmarked these two scenarios thoroughly but according to some tests, they seem the same.
I am wondering if they are the same and if so, which one is better in terms of performance?
*******************************************************************************
GRBModel solver = new GRBModel(env);
...
create model using the solver API.
...
solver.optimize();
// reuse the created model
// scenario 1
solver.reset();
...
change the model and other parameters
...
solver.optimize();
// scenario 2
GRBModel newSolver = new GRBModel(solver);
...
change the model and other parameters
...
newSolver.optimize();
******************************************************************************
2. if I remove some constraints from a model but without calling solver.update(), i.e. just mark the constraints as "removed", what would be happened if I use the newSolver = new GRBModel(solver).
I mean the constraints which marked as "removed" will be copied or not, or I have to call the solver.update() before creating the second solver (newSolver).
In my preliminary tests, it seems the marked constraints will be copied. I am wondering whether it is true. What is the best practice about copying a model and reuse it several times?
3. And my third question which is not related to the first two questions: Is there any parameters or practices to improve the performance of the solver in order to get the relaxed objective function in an IP setting? In other words,
I have a very big Integer Programming model. I want to just get the relaxed objective function. But it takes a long time to solve. How can I improve it and get the relaxed objective value sooner?
Many thanks,
Eric