heuristic parameter and speed up the solving process
AnsweredHi,
I am working on the Technician Routing and Scheduling Problem (TRSP) for my assignment. The problem involves medium-to-large-scale instances with the following parameters:
Number of technicians: 65
Number of depots: 65
Number of jobs: 490
However, after running the Gurobi solver for 5 hours, I still did not obtain any output. I attempted to use Gurobi's heuristic parameters to generate a feasible solution, but I was unsuccessful in obtaining any heuristic solution.
m.setParam("MIPFocus", 1) # Focus on finding feasible solutions quickly
m.setParam("Method", 2) # Use a specific method for solving
m.setParam("Heuristics", 0.5) # Use aggressive heuristics (50%)
m.setParam("TimeLimit", 300) # Limit the solver runtime to 300 seconds
m.setParam("MIPGap", 0.05) # Allow a 5% optimality gap
m.setParam("SolutionLimit", 1) # Stop after finding one solution
m.setParam("Presolve", 0) # Turn off presolve to test its effect
Questions:
How can I speed up the solving process?
What additional parameters or strategies can help reduce runtime?
How can I configure Gurobi to find the first (not necessarily optimal) feasible solution more quickly?
What hardware configuration would be more suitable for faster results?
I am currently using the following machine configuration:
CPU model: Apple M1
Thread count: 8 physical cores, 8 logical processors, using up to 8 threads
Would upgrading to a machine with higher computational power (e.g., more cores, higher clock speed) significantly improve performance?
Thank you so much.
Bests,
Hoda
Also here is the log:
-
Hi Hoda,
m.setParam("TimeLimit", 300) # Limit the solver runtime to 300 seconds
Allowing a time limit of only 5 minutes seems very restrictive, given the large number of binary variables. But I think you set it only to experiment with other settings right?
How can I configure Gurobi to find the first (not necessarily optimal) feasible solution more quickly?
You should try the NoRelHeurTime parameter. This executes a special feasibility heuristic before the first root node solve. You should let it run as long as possible, but you would have to try-and-error a bit with this setting.
Would upgrading to a machine with higher computational power (e.g., more cores, higher clock speed) significantly improve performance?
Yes, more cores and a stronger CPU both help in finding feasible solutions. In particular the heuristic controlled by the NoRelHeurTime parameter profits from more cores and a stronger CPU.
You could upgrade to Gurobi v12.0.0.
You could try the ImproveStartTime parameter.
If you have a good guess of what a feasible solution might look like you could provide a partial MIP Start, see How do I use MIP start?
Best regards,
Jaromił0 -
This is a pretty large problem. Upgrading your machine might help.
How long does presolve take? You might want to limit this with PrePasses=1 then go straight into NoRel by setting NoRelHeurTime to the time limit. As you can see a heuristic solution has already been found.
I would recommend removing the rest of the parameters and maybe even upgrading to v12.0.0.
Cheers,
David0
Please sign in to leave a comment.
Comments
2 comments