With solve times shorter than ever and more supported model types, including non-convex MINLP, Gurobi is increasingly considered for applications with very short runtime requirements (sub-second) or non-linear formulations. This article discusses the use of Gurobi for applications requiring short solve times and the consideration of deploying Gurobi on hardware with limited resources (limited memory, low CPU clock speeds).
Types of applications
From a theoretical standpoint, mathematical optimization is capable of solving several interesting operational and planning optimization problems, such as:
Energy management Optimal scheduling in energy management, including consideration of flexible loads such as storage and thermal units.
Robot control Autonomous systems (robots, cars, drones, etc.) may have many optimization problems for tasks such as path planning or powertrain management.
Industrial automation Industrial processes have many opportunities to optimize operational variables to improve efficiency.
There are many more …
Hardware and operating systems
The physical devices that run these optimization applications might have special hardware requirements for different reasons. Limited RAM and low CPU clock speeds often result from requirements such as low device volume, low energy consumption, and low cost. Because performance has always been the main focus, Gurobi is optimized to run on powerful hardware, with high CPU clock speeds and the assumption that there is sufficient RAM. To check if Gurobi is compatible with your system, you can review Gurobi’s platform compatibility table. If your platform is compatible but you do reach the limits of your available RAM, please read How do I avoid an out-of-memory condition?, which contains ideas on how to reduce Gurobi's memory consumption. Ideally, you have enough memory in the first place.
If your hardware or operating system is not part of our supported platforms we’d like to learn which platform you intended to use and what requirements motivated this choice. Often, we can learn from these conversations and can help by discussing suitable deployment architectures. For specific technical questions, please submit a ticket at support.gurobi.com.
Real-time compatibility
Real-time systems pose strict requirements not to exceed a certain time window for computational tasks, which sometimes might be just a fraction of a second. Gurobi offers several options to developers in order to terminate Gurobi based on a variety of conditions, which can increase the robustness of their systems:
Termination criteria Parameters such as TimeLimit, WorkLimit, SolutionLimit, IterationLimit, MIPGap, can be used to terminate Gurobi and then retrieve the most recent / best solution available.
Callbacks Custom callback functions are another way to retrieve intermediate solutions without interrupting the optimization.
Parameter tuning Gurobi’s performance can often be improved by tuning solver parameters on a representative set of model instances. The focus of this exercise can take different forms, such as “minimize the time to the first feasible solution”, “minimize the time to reach a 1% gap”, “don’t focus on the MIP gap too much, instead reach the highest solution quality in a given time window.” If you are a commercial customer, we can support you with this exercise if you provide us with a set of representative model files.
Model formulation While parameter tuning can certainly help, large performance gains can sometimes be achieved by improving the model formulation. Note that the goal here is not to reduce the problem size but to find a formulation that is solved more quickly with Gurobi; formulations with more variables and constraints sometimes outperform more compact formulations. The winning recipe is to try different variants and see how they perform before drawing premature conclusions based on properties such as the number of variables or constraints. We have a short article on this topic that links to two webinars discussing strong formulations.
Runtime guarantee When implementing a global solver such as Gurobi into your application, you should conduct thorough tests on a wide variety of model instances and use sensible termination criteria. It is technically not possible to give an exact runtime guarantee for feasibility or optimality. Implementing custom heuristics to compute feasible yet sub-optimal solutions in a guaranteed time that run prior to or in parallel to running Gurobi could improve your system’s robustness further.
Network configuration
Your system's network configuration influences your flexibility in licensing and running Gurobi. Some Gurobi licenses require access to a self-hosted license Token Server or our Web License Service, while others are installed locally and tied to a machine. Furthermore, Gurobi optimizations could be offloaded to a dedicated machine with appropriate hardware using Client-Server Optimization, which communicates the results back via a network connection. This approach does come with some communication overhead, which should be considered.
Comments
0 comments
Article is closed for comments.