SLEQP: An open-source package for nonlinear programming
Abstract
We present SLEQP, an open source C-package consisting of an active-set method capable of solving large-scale nonlinear programming (NLP) problems based on successive linear programming and equality constrained quadratic programming techniques. The method includes a feasibility restoration phase and second-order corrections (SOCs), achieving robust practical performance. It has also been adapted for the special cases of unconstrained optimization, box-constrained problems, and nonlinear least squares problems and contains interfaces to both Python and MATLAB. To demonstrate the performance of the package, we perform a computational study based on the well-known CUTest suite of NLP problems.
1 INTRODUCTION








2 ALGORITHM
To solve (NLP), we employ the algorithmic framework introduced in ref. [9]. The approach is iterative, generating a sequence based on an initial point
. It uses the (exact) penalty function
, where
is a penalty parameter and
. An iteration consist of multiple phases, used to compute a step leading to the next iterate as well as an estimate of the required multipliers for the Lagrangian.
LP phase












Working set identification










- 1.
iff both of the rows
and
are contained in
, and
- 2.
iff all three of the rows
,
, and
are contained in
.
Simple linear algebra shows that the rows of the constraint Jacobian, , defined in terms of the rows associated with
, has full (row) rank of
. As we will see later, this identification of the working set makes the subsequent identification of the multipliers substantially easier.
Cauchy direction
The Cauchy direction is obtained by optimizing a quadratic model of Φ, given by along the interval
. Here, the Hessian
of the Lagrangian can be either exact or a quasi Newton approximation, while the multipliers
will be introduced later. This one-dimensional optimization problem can be solved exactly, given that
is known to be piecewise quadratic, or based on an inexact Armijo-type line search, yielding the Cauchy direction
. Recall that a trust-region method based on Cauchy steps alone is already convergent [5, Chapter 6].
Dual estimation






EQP phase
In order to enable locally quadratic convergence, an equality-constrained quadratic programming (EQP) phase can be added to the algorithm, yielding an EQP step used to augment the Cauchy step. Its goal is two-fold: For one, we aim at finding a stationary point of the Lagrangian, for another, we want to decrease the violation of the nonlinear constraints. The classical trust-region subproblem [5, Chapter 7] is concerned with the optimization of quadratic problems subject to a trust-region constraint of the form
. The subproblem, having been studied extensively, has a rich structure which can be exploited to yield highly efficient and readily available algorithms such as refs. [13, 14], based on Krylov methods.
An obvious choice regarding the objective is the function introduced above. It is however necessary to deal with the non-smoothness of
. In particular,
has kinks whenever any
passes zero. To alleviate this problem, we fix the variables in
to their respective bounds by requiring that
. We can decompose
into
, where d0 is the orthogonal projection of the zero vector onto the set feasible set and
.





Finally, special care must be taken when the initial projection d0 is not feasible with respect to the trust region constraint. In this case the trust-region subproblem as formulated above is infeasible itself. A simple workaround is to relax the linear feasibility requirements.
Step acceptance
The step to be ultimately used is computed based on the Cauchy and EQP steps
and
using a line search as before. The step is tested against the original model, yielding the reduction ratio
. The step is accepted iff
and rejected otherwise. In the former case, we set
, in the latter we keep
. Optionally, a second-order correction (SOC) is computed based on the system (4) to avoid the Maratos effect [15]. Next, the trust-region radii
and
are updated (see ref. [9] for details). In terms of the LP trust radius, any update needs to satisfy certain conditions to ensure convergence [5, Chapter 6], while the EQP trust radius can be chosen more liberally. Similarly, the penalty parameter ν can be periodically updated in order to improve convergence speed.
3 IMPLEMENTATION
The SLEQP package1 has been implemented in the C programming language. To solve the subproblems introduced above, several dependent packages are used. Specifically, linear programs are solved using an LP solver (such as HiGHS [16], Gurobi [17], or SoPlex [18]), and the systems (4) are factorized using codes such as UMFPACK [19], MUMPS [20], or others. To solve the EQP, we use either the TRLIB [14] code or an implementation of Steihaug's truncated conjugate gradient algorithm [21]. Since both approaches are iterative, we only require the map , that is, products with the Hessian of the Lagrangian rather than the entire matrix.
In the following, we examine certain aspects of the implementation, including both those being challenges to be overcome and algorithmic improvements result in benefits with respect to running time and robustness.
Working set identification







The problem of identifying an active set has been examined and can be solved exactly using an integer program [22]. Of course, such an approach is intractable in general. A simpler enhancement of the original approach, implemented in SLEQP, consists of fixing the variables to their solutions in (LP), and to resolve the LP for the remaining variables d in order to obtain a row basis in
which can be directly turned into a working set. Of course, such a resolve is often unnecessary. An indicator for a problem such as introduced above to occur is that LP rows which are active, that is, having nonzero multipliers in the LP, are excluded during the standard working set identification.
Local infeasibility



One attempt to escape such points is to include a so-called restoration phase, used in filter–SQP algorithms [6], in which the original objective is discarded in favor of a term designed to solely reduce a measure of infeasibility, such as . Switching between restoration and optimization phases ensures convergence to a local optimum for the particular instance introduced above.
Preprocessing
Preprocessing techniques have been widely studied in the context of linear or quadratic programming problems [24], where the richer problem structure enables significant speed ups. For general nonlinear programs of type (NLP), there is less structure to be exploited during preprocessing. The general constraints c do however often include bound constraints of the type for
as well as linear constraints of the form
for
,
. If the presence of these types of constraints are made available to the solver, some forms of preprocessing, such as discarding redundant linear constraints or removing fixed variables, are possible. The test suite used in the numerical experiments in Section 4 contains several instances where a significant portion of variables is fixed, such as the A0ENDNDL instance, where 35 000 of the about 60 000 variables are fixed. Removing the fixed variables during preprocessing about halves the required solution time. Similar effects are likely to occur on computer-generated instances.
Least-squares problems







4 NUMERICAL EXPERIMENTS
We evaluate our implementation based on the CUTEst [26] suite of 1 156 optimization problems. All experiments were ran on an AMD EPYC 7742 workstation clocked at up to 3.4 GHz. We compare our implementation against Ipopt 3.11, an open-source interior point method, and Knitro 13.20, a commercial solver, using interior point or quadratic programming algorithms depending on problem structure. In our implementation, we use Gurobi 9.0.0 as LP solver and UMFPACK 5.7.8 to factorize the systems (4).




Size | #Instances | % Solved | ||
---|---|---|---|---|
SLEQP | Knitro | |||
VS | (![]() |
453 | 93.59823399558499 | 93.81898454746137 |
S | (![]() |
134 | 67.16417910447761 | 79.1044776119403 |
M | (![]() |
354 | 69.49152542372882 | 74.85875706214689 |
L | (![]() |
215 | 50.697674418604656 | 79.53488372093022 |
Notably however, some improvements are more difficult to achieve for an NLP solver. For example, we observe on several CUTEst instances that it is not possible to evaluate the objective f or the constraints c, or their respective derivatives at certain iterates . Specifically, the CUTEst library returns values of
or produces floating point errors during evaluations. Since we do not know the actual domain where objective and constraints can be successfully evaluated, our code terminates once any such errors occur.
5 CONCLUSION AND FUTURE WORK
We have presented an open-source implementation of an existing, well-known active-set based NLP algorithm. We have addressed some of the practical problems appearing in real-world problems of the CUTEst suite as well as possible solutions to increase the robustness of our code even in the absence of usual regularity assumptions. The numerical results of the implementation are promising, even though they are not quite on par with Ipopt and Knitro.
Regarding future work, we expect that significant improvements particularly with respect to robustness can be made by examining the small instances of the CUTEst suite and making suitable algorithmic adjustments. In regards to improving the performance, we plan to follow similar approaches as laid out in ref. [9]. In particular, a closer integration with existing LP solvers could significantly increase performance. In early iterations for example, solving the LP to optimality is likely unnecessary. What is more, it may be beneficial to maintain a factorization of the linear system over several iterations when iterates approach a stationary point and derivatives and active sets stabilize. Lastly, we are confident that the dual estimation presented above can be improved by computing iterative improvements to the unconstrained estimation problem rather than simply clipping the resulting multipliers to be consistent with the working set.
ACKNOWLEDGMENTS
Open access funding enabled and organized by Projekt DEAL.