[Ipopt] Would it be possible / useful to use a sparse gradient in Ipopt ?

Tony Kelman kelman at berkeley.edu
Sat Mar 30 06:41:54 EDT 2013


Pierre,

Not really. Have a look at the Ipopt implementation paper, you'll see that 
the gradient of the objective function only ever appears on the 
right-hand-side of the KKT system. Once the sparse KKT matrix is factorized, 
the step direction is solved for by back-substitution with the triangular 
factors and the right-hand-side vector. This will in general destroy any 
sparsity of that right-hand-side vector, a sparse gradient (and other 
quantities on that RHS) and a sparse KKT matrix can turn into a dense step 
direction.

The memory requirements of Ipopt are typically dominated by the matrices 
involved, not the vectors. One thing you might be able to get away with as a 
performance optimization though is writing your gradient callback taking 
into account the known sparsity, only changing the non-zero gradient values 
as the x vector changes. You'd need to set all the zeros in the dense vector 
gradient at the start, but I believe (would have to check this to make sure 
it works, I haven't tried it myself so I'm not 100% sure you can do this) 
you can leave the zeros alone for all future iterations. Worth a try, but 
you should have a look at the detailed timing breakdown by setting the 
option print_timing_statistics to yes. Unless evaluating the objective 
gradient is taking a significant chunk of the time, you wouldn’t gain much.

-Tony



-----Original Message----- 
From: Pierre Martinon <martinon at cmap.polytechnique.fr>
Date: Fri, 29 Mar 2013 16:22:09 +0100
To: ipopt at list.coin-or.org
Subject: [Ipopt] Would it be possible / useful to use a sparse gradient in 
Ipopt ?

Hi everyone,

The question is simple: Ipopt uses a sparse format for the jacobian
matrix of the constraints.
On the other hand, the gradient of the objective is a standard array.
I happen to have extremely sparse gradients in my applications,
typically less than 10
non-zeros elements for a size of several thousands.
Would it make sense to use a sparse gradient in this case ?

Best regards,
Pierre

-- 
Pierre Martinon
Inria and Ecole Polytechnique
www.cmap.polytechnique.fr/~martinon



More information about the Ipopt mailing list