Dealing with repeatedly read in constraints
AnsweredHi there!
I'm trying to solve a large location-allocation problem by first find the location variable values with some metaheuristic and then use Gurobi to find allocation variable values. Thus it requires Gurobi to solve the allocation part as fast as possible.
The size of my problem is as follows:
Thread count: 8 physical cores, 16 logical processors, using up to 16 threads
Optimize a model with 7725239 rows, 1032678 columns and 13766773 nonzeros
Variable types: 18337 continuous, 1014341 integer (1014339 binary)
Coefficient statistics:
Matrix range [4e-03, 2e+05]
Objective range [1e+00, 1e+00]
Bounds range [1e+00, 1e+00]
RHS range [5e-01, 3e+05]
Presolve removed 7725233 rows and 1032673 columns (presolve time = 6s) ...
Presolve removed 7725233 rows and 1032673 columns
While the solving time is kinda fast in like around 8s, it took 5min to read in all constraints, which is not acceptable if I'm required to repeatedly run the Gurobi optimizer for each iteration in my metaheuristic.
So my question is: is there any way to repeatedly read in a large number of constraints faster in my case? Like save the structure of the entire model or constraints in memory, then just update the location variable value from the heuristic instead of reading in all constraints again, and then ask Gurobi to solve the allocation in each iteration?
Many thanks if someone could help!
-
Official comment
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?. -
Hi Lin,
You should definitely try to avoid reading the instance data from your hard drive multiple times. Please have a look at our different APIs - you should be able to find the appropriate methods you need for any common programming language.
You did not share any details about your metaheuristic or your code so it is difficult to help you in a more specific way.
Cheers,
Matthias0
Post is closed for comments.
Comments
2 comments