I try to solve a model in docplex(python) the model was stopped after a specific time limit. I want when the model stop return the best upper bound was found.

  • $\begingroup$ Are you minimizing or maximizing? Do you want the bound of the last node processed or the best bound found by the solver? $\endgroup$
    – fontanf
    Oct 8, 2021 at 10:25
  • $\begingroup$ minimizing. I want the best bound found $\endgroup$
    – Nada.S
    Oct 8, 2021 at 11:09

1 Answer 1


Once you solve a docplex model, it creates an internal SolveDetails object that contains the best bound you're looking for. You can access it in two ways:

  1. Assuming you've defined your docplex model as model (an instance of the class docplex.mp.model.Model)
  1. Assuming you've stored your model's solution in sol (an instance of the class docplex.mp.solution.SolveSolution)
sol = model.solve()

Check out the documentation for more details.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.