Stopping criteria for a solver are the predefined conditions that determine when the optimization process should halt. By defining these conditions, the solver ensures that it stops at an appropriate point, either when a satisfactory solution has been found or when further computations are unlikely to yield significant improvements. Stopping criteria help balance the need for solution quality with time and computational resources.
For information on where to specify the stopping criteria for a model, see the article, How to change and view the solver parameters.
Time
Rosepy parameter name: max_time_seconds
In the user interface, time is entered in seconds.
The time stopping criteria is a predefined limit on the maximum amount of time the solver is allowed to run before it automatically stops, regardless of whether an optimal solution has been found. When the time limit is reached, the solver halts its computations and returns the best solution it has found up to that point. This approach is useful in practice, as it allows users to balance the quality of the solution against the available time, ensuring that a viable solution is obtained even if the solver has not yet reached optimality.
Relative (percent) optimality gap
Default value: 0.01% (1e-4)
Rosepy parameter name: mip_gap_percentage
Note that in the user interface, the optimality gap is entered as a percentage. For example, if you want the optimality gap to be 0.1%, you would enter "0.1" in the interface. This value is then automatically divided by 100, so it becomes 0.001 as the actual optimality gap used by the solver. This is why even though the default value for the solver is 1e-4 you see 1e-2 (or 0.01) shown in the user interface
The relative optimality gap, also known as the relative MIP gap (mixed-integer programming gap), quantifies how close a given solution is to the best possible, optimal solution, expressed as a percentage of the optimal value. This threshold allows the solver to stop early and return the best solution early if it is close enough to optimal. Often, the solver may quickly find good-enough solutions, but finding a slightly better one may take much longer. The solver will stop and return the best solution it has found so far once the calculated optimality gap is within this specified threshold.
Even if the relative optimality gap is positive, the solution returned might still be the optimal solution. Rose simply does not have enough information to prove that yet. The reported relative optimality gap represents the worst-case scenario for how far the solution could be from the true optimal.
For more information on how the optimality gap is calculated, see the article, How is the optimality gap, or MIP gap, calculated?
Note that if you ever see just "optimality gap," this usually refers to the relative optimality gap, and not the absolute optimality gap.
Note that this parameter only applies to integer and binary decision variables. If your model does not have either of these types of decision variables, this parameter will not apply.
Absolute Optimality Gap
Default value: 1e-10
This parameter currently cannot be modified.
The absolute MIP gap is a measure of how close a given solution is to the best possible, optimal solution, expressed in terms of absolute numbers. This value is the numerator in the relative optimality gap calculation. For more information on how the optimality gap is calculated, see the article, How is the optimality gap, or MIP gap, calculated? When the absolute gap is less than this parameter, the Rose solver will stop and return the best solution it has found.
Even if the absolute optimality gap is positive, the solution returned might still be the optimal solution. Rose simply does not have enough information to prove that yet. The reported absolute optimality gap represents the worst-case scenario for how far the solution could be from the true optimal.
Note that this parameter only applies to integer and binary decision variables. If your model does not have either of these types of decision variables, this parameter will not apply.
Comments
0 comments
Please sign in to leave a comment.