3.8. Solver Options¶
ADMM exposes many solver options, but most first models should be solved with the defaults. Treat tuning as a second pass:
solve once
read
Model.StatusStringchange the smallest option that matches the status or debugging need
In practice, the first knobs worth touching are the iteration budget, time limit, and verbosity. Leave the more specialized settings alone until the default run tells you why you need them.
Iteration and time budget
admm_max_iteration· default1000Raise this first if the status is
SOLVE_OVER_MAX_ITER. A common next try is5000–10000.solver_max_time_limit· default1000 sRaise this if the model is otherwise reasonable but is stopping on wall-clock time.
Output control
solver_verbosity_level· default2(SUMMARY)Set to
1(INFO) or0(DETAIL) when diagnosing a stubborn solve. Use3(SILENT) to suppress output entirely.
Note
The numbering is: 0 = most verbose (DETAIL), 3 = silent. This is the opposite convention of some other solvers.
Convergence tolerances
termination_absolute_error_threshold· default1e-6Loosen to
1e-4for faster approximate answers, or tighten only when you truly need more accuracy.termination_relative_error_threshold· default1e-6Usually move this together with the absolute threshold rather than changing only one of them.
Penalty parameter
initial_penalty_param_value· default1.0Leave this alone at first; try
0.1or10.0only when convergence is slow or numerically awkward.penalty_param_auto· default1(enabled)Keep automatic penalty adjustment on for routine runs. Disable it only for deliberate manual rho tuning.
Constraint handling
strict_constraint_tol· default1e-8Usually leave this at the default unless your formulation explicitly relies on strict constraints.
As a beginner rule, do not guess at options before you have a status to react to. If the solve succeeds, you may not need any tuning at all. If it stops on an iteration or time limit, raise the corresponding budget first. If the logs are not informative enough, increase verbosity. Only after that should you reach for tighter tolerances or manual penalty tuning.
model.optimize()
print("status:", model.StatusString)
if model.StatusString == "SOLVE_OVER_MAX_ITER":
model.setOption(admm.Options.admm_max_iteration, 5000)
model.optimize()
elif model.StatusString == "SOLVE_OVER_MAX_TIME":
model.setOption(admm.Options.solver_max_time_limit, 5000)
model.optimize()
# If you need more logs on the next run:
model.setOption(admm.Options.solver_verbosity_level, 1)
For the full option list, see the Python API. For status interpretation after a run, see Solve the Model.