If I use IPOPT (cyipopt) to solve nonlinear problems of large scale. It is optional to provide or not provide the hessian matrix, hessian structure, and Jacobian structure.

The question is which one is faster, to provide them or to let the solver calculate them numerically? and which of them is more accurate?

  • 4
    $\begingroup$ If the Jacobian and/or Hessian are sparse, providing the (sparsity) structure can greatly speed up the computation. The other option is to have IPOPT use L-BFGS for the Hessian. $\endgroup$ Commented Dec 13, 2022 at 16:31
  • $\begingroup$ Yes. They are sparse and I used coo-matrix to store them. Howerver, I found it will be faster not to provide them and let the solver calculate them. I am not sure maybe every problem is different. I heard for some large problem it is not good to let the solver calcaute them as the solution will not be optimal. $\endgroup$ Commented Dec 14, 2022 at 0:50
  • $\begingroup$ If I do not provide them does the solver use L-BFGS to calcaute the hessian matrix itself? or I should inform the IPOPT solver about that?? Please let me know @ Mark L. Stone $\endgroup$ Commented Dec 14, 2022 at 0:51
  • 1
    $\begingroup$ coin-or.github.io/Ipopt/SPECIALS.html#QUASI_NEWTON $\endgroup$ Commented Dec 14, 2022 at 2:14
  • 2
    $\begingroup$ Use of "exact" Hessian probably makes IPOPT more robust and likely decreases number of iterations vs. L-BFGS.. It might be faster or slower though. If the problem dimension is not so high that Hessian can't fit in memory, it's a shame and unnecessarily decreases performance to use L-BFGS rather than BFGS - really just a stupid design decision in IPOPT. if you can supply exact Hessian, I'd try that first. BTW, that's Hessian of the Lagrangian, which is different than Hessian of the objective function if there are any nonlinear constraints. $\endgroup$ Commented Dec 14, 2022 at 23:17

1 Answer 1


To solve nonlinear optimization problems with IPOPT, it is most probably better to provide the exact hessian matrix and its structure as well as Jacobian structure, especially for large problems. That would make the solver faster and coverage to a better candidate solution.

However, it is not difficult to compare this solution with the solution you will get if you solve with not providing them; just comment the matrix and the structures out!

Thanks to Mark L. Stone. As he mentioned Try the exact hessian first.


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.