# Should I provide the hessian matrix, hessian structure, and Jacobian structure if I use cyipopt (IPOPT) if I am concerned about computation time?

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?

• 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. Dec 13, 2022 at 16:31
• 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. Dec 14, 2022 at 0:50
• 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 Dec 14, 2022 at 0:51
• coin-or.github.io/Ipopt/SPECIALS.html#QUASI_NEWTON Dec 14, 2022 at 2:14
• 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. Dec 14, 2022 at 23:17