KNITRO

Introduction

Artelys Knitro is a solver for finding local solutions of continuous (i.e., smooth) optimization problems, with or without constraints, and discrete optimization problems with integer or binary variables. Although Knitro has been designed for large-scale general nonlinear problems, it is also efficient for linear and quadratic programs, systems of nonlinear equations, least squares problems, mathematical programs with complementarity constraints (MPEC), and (convex) mixed-integer nonlinear programs (MINLP) of moderate size. See section Usage for the supported GAMS model types.

The problems solved by Knitro have the form

\[ \begin{array}{rclr} \mbox{minimize} & \qquad \qquad & f(x) & \qquad \qquad \qquad (1a) \\ \mbox{subject to} & \qquad \qquad & c^L \leq c(x) \leq c^U & \qquad \qquad \qquad (1b) \\ & \qquad \qquad & b^L \leq x \leq b^U, & \qquad \qquad \qquad (1c) \end{array} \]

where the variables \(x\) can be continuous, binary, or integer. Knitro requires that the functions \(f(x)\) and \(c(x)\) be smooth.

Knitro offers interior-point (barrier) algorithms (Interior/Direct and Interior/CG), an active-set algorithm, an SQP algorithm, and an augmented Lagrangian algorithm for continuous problems, and branch-and-bound and mixed-integer SQP algorithms for discrete problems. Further features include multi-start, the Knitro-Tuner for finding good option settings, a concurrent solver that runs several algorithms in parallel, and crossover to the active-set algorithm for obtaining more exact solutions.

Usage

Knitro can be used to solve models of type LP, RMIP, NLP, DNLP, CNS, QCP, RMIQCP, RMINLP, MIQCP, MINLP, MCP, MPEC, and RMPEC (see also section Classification of Models). The following statement can be used inside a GAMS program to select Knitro, where NLP can be replaced by any of the model types above:

Option NLP = KNITRO;

The above statement should appear before the solve statement. If Knitro was specified as the default solver during GAMS installation, the above statement is not necessary. For more details on solver usage, see Chapter Solver Usage.

Note the following:

  • Knitro solves CNS and MCP models as feasibility problems, i.e., the equations are passed to Knitro as constraints without an objective function. Complementarity conditions of MCP and MPEC models are passed to Knitro as complementarity constraints (see section Complementarity Constraints).
  • MPSGE models are not supported.
  • For discrete models, Knitro does not provide marginals.

GAMS Options

The following GAMS options are used by the GAMS/Knitro link:

  • Option ResLim = x;

    Sets the time limit in seconds. If this limit is exceeded, Knitro terminates and passes the current solution to GAMS. The Knitro option maxtime takes its default from this value, where values larger than 1e8 are reduced to 1e8. See also reslim in section GAMS options.

  • Option IterLim = n;

    Sets the iteration limit. If this option is set explicitly, the Knitro option maxit takes its default from this value. Otherwise, the Knitro default is used (currently 10000 for continuous and 3000 for discrete problems). See also iterlim in section GAMS options.

  • Option NodLim = n;

    Sets the node limit for discrete problems. The Knitro option mip_maxnodes takes its default from this value. See also nodlim in section GAMS options.

  • Option Threads = n;

    Sets the default number of threads Knitro may use. The Knitro option threads takes its default from this value. Note that the number of threads used by the MIP solver is controlled separately by the option mip_numthreads. See also threads in section GAMS options.

  • ModelName.optCA = x;

    Absolute gap stop criterion for a discrete problem. The Knitro option mip_opt_gap_abs takes its default from this value. See also optca in section GAMS options.

  • ModelName.optCR = x;

    Relative gap stop criterion for a discrete problem. The Knitro option mip_opt_gap_rel takes its default from this value. See also optcr in section GAMS options.

Specification of Knitro Options

The Knitro option file knitro.opt is used to set options that control Knitro's behavior. Options are set by specifying a keyword and a corresponding value on a line in the knitro.opt file. Lines that begin with a # character are treated as comments and blank lines are ignored. For example, the following option file sets the maximum allowable number of iterations to 500:

maxit 500

Knitro reads the option file if the model attribute optfile is set before the solve statement, e.g., mymodel.optfile = 1; (see also section The Solver Options File).

All available options are listed in section List of Knitro Options and described in detail in section Detailed Options Description.

Algorithms

The algorithm used by Knitro is selected depending on the problem class: for continuous problems by the option nlp_algorithm, for linear programs by the option lp_algorithm, and for discrete problems by the option mip_method.

Continuous Problems

The algorithm for continuous problems is selected with the option nlp_algorithm. By default (nlp_algorithm=0), Knitro automatically chooses an algorithm based on the problem characteristics. Since it is difficult to predict which algorithm works best on a given problem, it is recommended to experiment with all of them. The following table gives an overview:

nlp_algorithm Algorithm Suited for
0 automatic (default)
1 Interior/Direct ill-conditioned problems
2 Interior/CG large problems with large, dense Hessians
3 Active Set warm starts, fast detection of infeasibility
4 SQP small to medium problems with expensive function evaluations
6 Augmented Lagrangian large, degenerate problems

Interior-Point Methods

In interior-point methods (also known as barrier methods), the nonlinear programming problem is replaced by a series of barrier subproblems controlled by a barrier parameter \(\mu\). The algorithm performs one or more minimization steps on each barrier subproblem, then decreases the barrier parameter, and repeats the process until the original problem (1) has been solved to the desired accuracy. Knitro provides two procedures for computing the steps: Interior/Direct and Interior/CG.

Interior/Direct

The Interior/Direct algorithm computes each step by directly factoring the KKT (primal-dual) matrix. If this step is suspected to be of poor quality, or if negative curvature is detected, it falls back on an iterative step computed by the Interior/CG procedure. The method is described in [168] .

Interior/Direct is advisable if the Hessian of the Lagrangian is ill-conditioned or the problem does not have a large, dense Hessian. It may result in substantial improvements over Interior/CG when the problem is ill-conditioned (as evidenced by Interior/CG taking a large number of conjugate gradient iterations). Since it is difficult to predict in advance which of the two interior-point algorithms will be more effective on a given problem, it is recommended to try both. In each case, it is also worth experimenting with the bar_murule option, as it is difficult to predict which update rule will work best.

The Interior/Direct algorithm is chosen by setting nlp_algorithm=1. It can be used with the bar_feasible option.

Note
Since the Interior/Direct algorithm requires the explicit storage of a Hessian matrix, it can only be used with hessopt=0, 1, 2, 3, or 6. It cannot be used with hessopt=4 or 5, which only provide Hessian-vector products.

Interior/CG

The Interior/CG algorithm computes each step using a projected conjugate gradient iteration. This approach differs from most interior-point methods proposed in the literature in that it does not compute each step by solving a linear system involving the KKT (or primal-dual) matrix. Instead, it factors a projection matrix and uses the conjugate gradient method to approximately minimize a quadratic model of the barrier problem. For a detailed description of the method see [25] and for the global convergence theory see [26] .

Since it does not require the factorization of the Hessian matrix, Interior/CG allows Knitro to handle large problems with large, dense Hessians. This approach has proven to be efficient in most cases.

The Interior/CG algorithm is chosen by setting nlp_algorithm=2. It can use any of the Hessian options as well as the bar_feasible option.

Active Set

The Active Set algorithm is a Sequential Linear-Quadratic Programming (SLQP) method. It is similar to the SQP algorithm but uses linear programming subproblems to estimate the active set at each iteration. The linear programming subproblems are solved with Knitro's internal LP solver (COIN-OR Clp). The method is described in [28] and the global convergence theory is in [29] .

The Active Set algorithm is particularly advantageous when "warm starting" (i.e., when a good initial solution estimate can be provided, for example, when solving a sequence of closely related problems). It is also the preferred algorithm for detecting infeasible problems quickly.

The Active Set algorithm is chosen by setting nlp_algorithm=3. It can use any of the Hessian options.

SQP

The Sequential Quadratic Programming (SQP) algorithm is an active-set method that solves a sequence of quadratic programming (QP) subproblems. The QP subproblems are solved with one of the Knitro algorithms Interior/Direct, Interior/CG, or Active Set (see option act_qpalg).

The SQP algorithm is primarily designed for small- to medium-scale problems with expensive function evaluations. Each SQP iteration is expensive since it involves solving a QP subproblem. However, the method often converges in the fewest number of function and gradient evaluations.

The SQP algorithm is chosen by setting nlp_algorithm=4. Like Interior/Direct, it cannot be used with hessopt=4 or 5.

Augmented Lagrangian

Augmented Lagrangian (AL) methods minimize a sequence of subproblems whose objective consists of the Lagrangian function plus a squared 2-norm penalty term of the constraint violation. Several of these subproblems may need to be solved for increasing values of the penalty parameter to achieve feasibility. Knitro implements a nonlinearly constrained Lagrangian (NCL) variant that makes use of second derivatives.

Compared to interior-point methods, the AL algorithm is designed to better handle large-scale problems with degenerate constraints, where the Linear Independence Constraint Qualification (LICQ) is not satisfied.

The AL algorithm is chosen by setting nlp_algorithm=6. The penalty parameter is controlled by the options al_initpenalty and al_maxpenalty.

Crossover

Interior-point (or barrier) methods are a powerful tool for solving large-scale optimization problems. However, one drawback of these methods is that they do not always provide a clear picture of which constraints are active at the solution. In general, they return a less exact solution and less exact sensitivity information. For this reason, Knitro offers a crossover feature in which the interior-point method switches to the Active Set method at the interior-point solution estimate, in order to "clean up" the solution and provide more exact sensitivity and active set information. The crossover procedure is controlled by the bar_maxcrossit option. If this option is greater than 0, Knitro attempts to perform bar_maxcrossit Active Set crossover iterations after the interior-point method has finished, to see if it can provide a more exact solution. This can be viewed as a form of post-processing. If bar_maxcrossit is not positive, then no crossover iterations are attempted.

The crossover procedure will not always succeed in obtaining a more exact solution compared with the interior-point solution. If crossover is unable to improve the solution within bar_maxcrossit crossover iterations, Knitro restores the interior-point solution estimate and terminates. By default, Knitro then prints a message indicating that it was unable to improve the solution within the iterations allowed. In this case, increasing the value of bar_maxcrossit may help. If Knitro determines that the crossover procedure will not succeed, no matter how many iterations are tried, the message Crossover mode unable to improve solution. is printed.

The extra cost of performing crossover is problem dependent. For most small- or medium-scale problems, the crossover cost is a small fraction of the total solve cost. In these cases it may be worth using the crossover procedure to obtain a more exact solution. On some large-scale or difficult degenerate problems, however, the cost of performing crossover may be significant. It is recommended to experiment with this option to see whether improvement in the exactness of the solution is worth the additional cost.

Concurrent Solver

The concurrent solver runs several algorithms or several tunings of the same algorithm in parallel and stops as soon as one of them has found a solution. It is only available for continuous problems and is enabled by setting concurrent_solver = 1. By default (concurrent_solver=-1), Knitro decides automatically whether to use it. Without further settings, the concurrent solver runs one algorithm with multiple tunings. Multiple algorithms are run by setting the options concurrent_nlpalg (for nonlinear problems) and concurrent_lpalg (for linear problems). These options are bit sets, that is, the values of the algorithms to run are added. For example, concurrent_nlpalg=9 runs the Interior/Direct (1) and the SQP (8) algorithms. The number of concurrent solves is limited by concurrent_maxsolves. Since the GAMS/Knitro link sets deterministic = 1 by default, the concurrent solver returns the same solution in repeated runs on the same machine. This is not possible for concurrent LP algorithms and for a combination of barrier and active-set or SQP algorithms on nonlinear problems.

Linear Programs

For linear programs, the algorithm is selected with the option lp_algorithm. By default (lp_algorithm=-1), Knitro chooses the algorithm automatically. Besides the algorithm selected by nlp_algorithm (lp_algorithm=0), Knitro offers a primal simplex (1), a dual simplex (2), a barrier (3), and a primal-dual first-order method (PDLP, 4). PDLP has cheap iterations and a low memory footprint, but may require many iterations and struggle to achieve high accuracy.

Discrete Problems

For problems with discrete variables, the method is selected with the option mip_method:

  • Branch-and-bound (mip_method=1): This method solves a continuous relaxation at each node of the branch-and-bound tree using one of the algorithms described above (see options mip_root_nlpalg and mip_node_nlpalg). It is primarily designed for convex models. For nonconvex models, it often works well, but there is no guarantee that it converges to a global solution. In this case, enabling the MIP multi-start heuristic (mip_multistart = 1) is recommended.
  • Mixed-integer SQP (mip_method=3): This method extends the SQP algorithm to problems with integer variables. It is designed for small problems (up to about 100 variables) with expensive function evaluations. It can be applied to convex and nonconvex models, but may converge to non-global, integer feasible points.

Linear Solvers

The linear systems arising in the Knitro algorithms are solved by sparse direct linear solvers, such as the HSL routines MA27, MA57, MA86, and MA97 [83] or Intel MKL PARDISO (see option linsolver).

Termination Criteria

Continuous Problems

The first-order conditions for identifying a locally optimal solution of the problem (1) are:

\[ \tag{2} \begin{array}{rll} \displaystyle \nabla_x {\cal L}(x,\lambda) = \nabla f(x) + \sum_{i=1 \dots m} \lambda_i^c \nabla c_i(x) + \sum_{j=1 \dots n} \lambda_j^b & = 0 \\ \displaystyle \lambda_i^c \min [(c_i(x)-c_i^L),(c_i^U-c_i(x))] & = 0, & i=1 \dots m \\ \displaystyle \lambda_j^b \min [(x_j-b_j^L),(b_j^U-x_j)] & = 0, & j=1 \dots n \\ \displaystyle c_i^L \leq c_i(x) & \leq c_i^U, & i=1 \dots m \\ \displaystyle b_j^L \leq x_j & \leq b_j^U, & j=1 \dots n \\ \displaystyle \lambda_i^c & \geq 0, & i \in {\cal I}, \ c_i^L=-\infty,\ c_i^U\ \mbox{finite} \\ \displaystyle \lambda_i^c & \leq 0, & i \in {\cal I}, \ c_i^U=+\infty,\ c_i^L\ \mbox{finite} \\ \displaystyle \lambda_j^b & \geq 0, & j \in {\cal B}, \ b_j^L=-\infty,\ b_j^U\ \mbox{finite} \\ \displaystyle \lambda_j^b & \leq 0, & j \in {\cal B}, \ b_j^U=+\infty,\ b_j^L\ \mbox{finite} \end{array} \]

where \({\cal I}\) and \({\cal B}\) represent the sets of indices corresponding to the general inequality constraints and non-fixed variable bound constraints, respectively, \(\lambda_i^c\) is the Lagrange multiplier corresponding to constraint \(c_i(x)\), and \(\lambda_j^b\) is the Lagrange multiplier corresponding to the simple bounds on \(x_j\). There is exactly one Lagrange multiplier for each constraint and variable. The Lagrange multiplier may be restricted to take on a particular sign depending on the corresponding constraint or variable bounds.

The feasibility error (FeasErr) at a point \(x^k\) is defined as the maximum violation of the constraints of (1), i.e.,

\[ \mbox{FeasErr} = \max_{i=1 \dots m, \ j=1 \dots n} (0, (c_i^L-c_i(x^k)), (c_i(x^k)-c_i^U), (b_j^L-x_j^k), (x_j^k-b_j^U)), \]

while the optimality error (OptErr) is defined as the maximum violation of the first three conditions of (2). In the complementarity conditions, it is only required that either the multiplier or the corresponding constraint is zero. To protect against numerical problems that may occur when the Lagrange multipliers become very large, the complementarity terms are therefore modified as follows:

\begin{align*} \mbox{OptErr} & = \max_{i=1 \dots m, \ j=1 \dots n} (\|\nabla_x {\cal L}(x^k,\lambda^k) \|_\infty, \min(|\lambda_i^c| g_i^c(x^k), |\lambda_i^c|, g_i^c(x^k)), \min(|\lambda_j^b| g_j^b(x^k), |\lambda_j^b|, g_j^b(x^k))), \\ \text{where} \quad g_i^c(x) & = \min [(c_i(x)-c_i^L),(c_i^U-c_i(x))], \\ g_j^b(x) & = \min [(x_j-b_j^L),(b_j^U-x_j)]. \end{align*}

The remaining conditions on the sign of the multipliers are enforced explicitly throughout the optimization. In order to take into account problem scaling in the termination test, the following scaling factors are defined:

\begin{align*} \tau_1 & = \max (1, (c_i^L-c_i(x^0)), (c_i(x^0)-c_i^U), (b_j^L-x_j^0), (x_j^0-b_j^U)), \\ \tau_2 & = \begin{cases} \max (1, \|\nabla f(x^k)\|_\infty), & \text{for constrained problems}, \\ \max (1, \min(|f(x^k)| , \|\nabla f(x^0)\|_\infty)), & \text{for unconstrained problems}, \end{cases} \end{align*}

where \(x^0\) represents the initial point. The special treatment for unconstrained problems is necessary, as for these problems, \(\|\nabla f(x^k)\|_\infty \rightarrow 0\) as a solution is approached, thus \(\max (1, \|\nabla f(x^k)\|_\infty)\) would not be effective.

Knitro stops and declares Locally optimal solution found if the following stopping conditions are satisfied:

\begin{align*} \mbox{FeasErr} & \le \min (\tau_1\,\mbox{feastol}, \mbox{feastol_abs}) \\ \mbox{OptErr} & \le \min (\tau_2\,\mbox{opttol}, \mbox{opttol_abs}) \end{align*}

where feastol, opttol, feastol_abs and opttol_abs are user options. Whether FeasErr is computed for the problem as given by GAMS or for the problem solved internally by Knitro (after presolve, scaling, etc.) is controlled by the option feaserr_level. If the problem is scaled (see option scale), some aspects of the optimality test are based on the scaled problem. If the accuracy achieved with the default settings is not satisfactory, the tolerances can be decreased or scaling can be disabled (scale=0).

This stopping test is designed to give the user much flexibility in deciding when the solution returned by Knitro is accurate enough. By default, Knitro uses a scaled stopping test, while also enforcing that some minimum absolute tolerances for feasibility and optimality are satisfied. The default value -1 of all four tolerances lets Knitro choose them automatically depending on the problem type and the algorithm. For standard NLP problems, feastol and opttol are set to 1e-6 and feastol_abs and opttol_abs are set to 1e-3. A purely absolute stopping test can be enforced by setting feastol_abs \(\le\) feastol and opttol_abs \(\le\) opttol. Likewise, a purely scaled stopping test can be enforced by setting feastol_abs and opttol_abs to a large value.

Unbounded Problems

Knitro declares a problem to be unbounded if the magnitude of the objective function at a feasible iterate becomes greater than objrange (default 1e+20). If the problem is bounded, but objective function values of this magnitude are expected, objrange should be increased.

Infeasible Problems

Since Knitro is a local solver, it can in general only detect that a problem is locally infeasible, i.e., that it has converged to an infeasible point from which it cannot further decrease the infeasibility measure. Knitro terminates at an infeasible point if the relative change in the feasibility error is less than infeastol (default 1e-8) for infeastol_iters (default 50) consecutive infeasible iterations. In addition, the Knitro presolver may determine that the bounds on the constraints or variables are infeasible. See section Termination Messages for the most common termination messages.

If Knitro declares a problem infeasible although it is believed to be feasible, the following settings may help:

  • a different initial point, preferably one close to the feasible region, or multi-start (ms_enable = 1), which automatically runs Knitro from several initial points,
  • for the interior-point algorithms, bar_feasible = 2 (get) or 3 (get_stay), which places special emphasis on getting feasible before trying to optimize.
  • a smaller value for infeastol,

To detect infeasible problems quickly, the Active Set algorithm is preferable.

Discrete Problems

Algorithms for solving versions of (1) where one or more of the variables are restricted to take on only discrete values proceed by solving a sequence of continuous relaxations, where the discrete variables are relaxed such that they can take on any continuous value. The global solutions \(f(x_R)\) of these relaxed problems provide a dual bound on the optimal objective value. If a feasible point is found that satisfies the discrete restrictions on the variables, then this provides a primal bound on the optimal objective value. These feasible points are called incumbent points and the objective value at an incumbent point is denoted by \(f(x_I)\). Assuming all the continuous subproblems have been solved to global optimality (if the problem is convex, all local solutions are global solutions), an optimal solution is verified when the dual bound and primal bound are equal.

Knitro declares optimality for a discrete problem when the gap between the dual bound \(f(x_R)\) and the primal bound \(f(x_I)\) is less than a threshold determined by the user options mip_opt_gap_abs and mip_opt_gap_rel. Specifically, Knitro declares optimality when either

\begin{align*} |f(x_I) - f(x_R)| & \leq \mbox{mip_opt_gap_abs} \quad \text{or} \\ |f(x_I) - f(x_R)| & \leq \mbox{mip_opt_gap_rel} \cdot \max (1,|f(x_I)|), \end{align*}

where mip_opt_gap_abs and mip_opt_gap_rel are typically small positive numbers. Since these termination conditions assume that the continuous subproblems are solved to global optimality and Knitro only finds local solutions of nonconvex, continuous optimization problems, they are only reliable when solving convex mixed-integer problems. The integrality gap \(f(x_I) - f(x_R)\) ( \(f(x_R) - f(x_I)\) if maximizing) should be non-negative, although it may become slightly negative from roundoff error, or if the continuous subproblems are not solved to sufficient accuracy. If the integrality gap becomes significantly negative, this may be an indication that the model is nonconvex, in which case Knitro may not converge to the optimal solution, and will be unable to verify optimality (even if it claims otherwise).

Note that the default values for mip_opt_gap_abs and mip_opt_gap_rel are taken from the GAMS options optCA and optCR, but an explicit setting of mip_opt_gap_abs or mip_opt_gap_rel will override those.

Output

The amount of output is controlled by the option outlev. If outlev=0, no output is printed. The following sections explain the log for a continuous and a discrete problem from the GAMS Model Library, using the default output level (outlev=2).

Continuous Problems

Solving the model CHENERY with Knitro gives the following log:

--- Artelys Knitro Optimizer 16.0.0
--- GMO Q Extraction (ThreePass): 0.00s
--- GMO setup time: 0.00s
--- Set initial levels for 37 / 43 variables.
--- Set initial marginals for 0 / 43 variables.
--- Set initial marginals for 0 / 38 equations.

=======================================
          Commercial License
         Artelys Knitro 16.0.0
=======================================

Knitro using 1 thread.
Knitro presolve eliminated 0 variables (0%) and 0 constraints (0%) in 0.00s.

concurrent_evals         0
datacheck                0
deterministic            1
feastol                  1e-06
feastol_abs              0.001
hessian_no_f             1
opttol                   1e-06
opttol_abs               0.001

Problem Characteristics                     |           Presolved
-----------------------
Problem type: NLP
Objective: maximize / linear
Number of variables:                     43 |                            43
  bounds:         lower     upper     range |     lower     upper     range
                      5         0        38 |        10         2        28
                             free     fixed |                free     fixed
                                0         0 |                   3         0
Number of constraints:                   38 |                            38
                    eq.     ineq.     range |       eq.     ineq.     range
  linear:            11         4         0 |        11         4         0
  quadratic:          5         2         0 |         5         2         0
  nonlinear:         16         0         0 |        16         0         0
Number of nonzeros:
              objective  Jacobian   Hessian | objective  Jacobian   Hessian
  linear:             4        72           |         4        72
  quadratic:          0        36        18 |         0        36        18
  nonlinear:          0        20        14 |         0        20        14
  total:              4       128        32 |         4       128        32
Coefficient range:
  linear objective:          [1e+00, 1e+00] |                [1e+00, 1e+00]
  linear constraints:        [1e-03, 4e+00] |                [1e-03, 4e+00]
  quadratic objective:       [0e+00, 0e+00] |                [0e+00, 0e+00]
  quadratic constraints:     [1e+00, 1e+00] |                [5e-01, 1e+00]
  variable bounds:           [1e-03, 2e+03] |                [1e-03, 2e+03]
  constraint bounds:         [1e+00, 8e+02] |                [1e+00, 4e+02]
Knitro using the Interior-Point/Barrier Direct algorithm.

    Iter       Objective  FeasError   OptError   ||Step||      Time
--------  --------------  ---------  ---------  ---------  --------
       0    1.000000e+03   2.17e+02
      10    1.075293e+03   3.10e+01   1.01e+01   2.80e+00      0.02
      14    1.058920e+03   1.29e-08   1.16e-07   1.79e-04      0.02

EXIT: Locally optimal solution found.

Final Statistics
----------------
Final objective value               =   1.05891985562401e+03
Final feasibility error (abs / rel) =   1.29e-08 / 5.94e-11
Final optimality error  (abs / rel) =   1.16e-07 / 1.16e-07
# of iterations                     =         14
# of CG iterations                  =          4
# of function evaluations           =         20
# of gradient evaluations           =         17
# of Hessian evaluations            =         14
Total program time (secs)           =       0.02364 (     0.007 CPU time)
Time spent in evaluations (secs)    =       0.00039

================================================================================

The lines starting with --- are printed by the GAMS/Knitro link. They report the time for setting up the model and how many initial levels and marginals are passed to Knitro (see options initvalues0 and initvalues).

After the license banner, Knitro reports the number of threads used and the result of the presolve. Next, it lists all options whose values differ from the Knitro defaults. These are the options set in the option file, options set by the GAMS/Knitro link (e.g., datacheck and deterministic), and options whose automatic setting has been resolved by Knitro (e.g., the stopping tolerances). If nothing is listed, all options are set to their default values. The following block describes the problem characteristics before and after the presolve: the number of variables and constraints by type, the number of nonzeros, and the ranges of coefficients and bounds. Afterwards, Knitro reports the algorithm it uses.

An iteration, in the context of Knitro, is defined as a step that generates a new solution estimate (i.e., a successful step). The columns of the iteration log are as follows:

  • Iter Iteration number.
  • fCount The cumulative number of function evaluations, only included if outlev>3.
  • Objective The value of the objective function at the current iterate.
  • FeasError A measure of the feasibility violation at the current iterate.
  • OptError A measure of the violation of the Karush-Kuhn-Tucker (KKT) (first-order) optimality conditions (not including feasibility) at the current iterate.
  • ||Step|| The 2-norm length of the step (i.e., the distance between the new iterate and the previous iterate).
  • Time The cumulative real time in seconds.

If outlev=2, information is printed every 10 iterations and at the final iteration. If outlev=3, information is printed at each iteration. If outlev=4, the column fCount is added.

The line starting with EXIT is the termination message, which indicates whether an optimal solution was found and, if not, why Knitro terminated (see section Termination Messages). It is followed by some final statistics: the final objective value, the absolute and relative feasibility and optimality errors (see section Termination Criteria), the number of iterations and evaluations, and the total time. If outlev=5, the values of the solution vector are printed after the final statistics. If outlev=6, the final constraint values and the values of the Lagrange multipliers are printed as well.

Discrete Problems

Solving the model PROCSEL with Knitro gives the following log (shortened, omitted parts are marked with [...]):

Knitro changing mip_method from AUTO to 1.
[...]
WARNING: Problem appears to have nonlinear equalities and be non-convex.
         The Knitro mixed integer solver is designed for convex problems.
         For non-convex problems it is only a heuristic, and the reported
         bounds and optimality claims cannot be verified.
[...]
Knitro using Branch and Bound method with 8 threads.
[...]
Root node relaxation
--------------------
 Iter      Objective      Feasibility        Optimality       Time
                             error              error        (secs)
 ----      ---------      -----------        ----------      ------
    0       -4.52748          1.38948          0.477666       0.009
    1      -0.181769         0.524762          0.258142       0.009
    2        2.59649      2.91666e-03       9.40136e-03       0.009
    3        2.63165      7.28231e-06       4.71734e-05       0.009
    4        2.63181      3.37445e-10       2.23739e-09       0.009
    5        2.63181      5.47258e-11       2.31572e-10       0.009
    6        2.63181      5.47258e-11       2.31572e-10       0.015
Tree search
-----------
       Nodes        Best solution   Best bound      Gap       Time
   Expl  |  Unexpl      value         value                  (secs)
   ---------------  -------------   ----------      ---      ------
      1       2      1.92310 FCRD          inf                0.022
      5       0      1.92310           1.92329      0.01%     0.025

EXIT: Optimal solution found (assuming convexity).
HINT: The problem may be a non-convex mixed-integer problem.  Set
      mip_multistart=1 to enable a mixed-integer multistart heuristic,
      which may improve the chances of finding the global solution.

Final Statistics for MIP
------------------------
Final objective value               =  1.92309873776803197e+00
Final bound value                   =  1.92329104764180880e+00
Final optimality gap (abs / rel)    =  1.92310e-04 / 1.00000e-04 (0.01%)
# of root cutting plane rounds      =  1
# of restarts                       =  0
# of nodes processed                =  5 (0.014s)
# of strong branching evaluations   =  0 (0.000s)
# of function evaluations           =  109 (0.000s)
# of gradient evaluations           =  91 (0.000s)
# of hessian evaluations            =  54 (0.000s)
# of hessian-vector evaluations     =  0
# of subproblems processed          =  9 (0.018s)
Total program time (secs)           =  0.02579 (0.025 CPU time)
Time spent in evaluations (secs)    =  0.00045

Cuts statistics (gen / add)
---------------------------
Knapsack cuts                       =  0 / 0
Mixed-integer rounding cuts         =  0 / 0
Flow-cover cuts                     =  0 / 0
Probing cuts                        =  0 / 0

Heuristics statistics (calls / successes / time)
------------------------------------------------
Feasibility pump                    =  1 / 0 / 0.001s
Rounding heuristic                  =  1 / 1 / 0.001s
MPEC heuristic                      =  0 / 0 / 0.000s
Local search heuristic              =  7 / 2 / 0.003s

===========================================================================

For discrete problems, Knitro first reports the settings it has chosen automatically (lines starting with Knitro changing) and possibly warnings, for example, if the problem appears to be nonconvex. After the problem characteristics, it prints the iteration log of the root node relaxation, whose columns correspond to those of the log for continuous problems, followed by the log of the tree search. Knitro prints a log line for selected nodes only, for example, whenever a new incumbent has been found. The frequency of log lines can be changed via the mip_outinterval option. The node log can be turned off completely by setting the mip_outlevel option to 0. The columns of the tree search log are as follows:

  • Nodes Expl The number of explored nodes.
  • Nodes Unexpl The number of active nodes left in the branch-and-bound tree.
  • Best solution value The objective function value of the current incumbent point (primal bound). The tag printed next to the value indicates how the solution has been found (e.g., by a heuristic).
  • Best bound value The value of the current relaxation (dual bound).
  • Gap The relative gap between the best solution value and the best bound value in percent.
  • Time The cumulative wall-clock time in seconds.

The termination message may be followed by hints on option settings that could improve the result. The final statistics for discrete problems include the best bound, the optimality gap, the number of processed nodes and subproblems, and statistics on the generated cuts and the applied heuristics.

Termination Messages

At the end of the run, a termination message is printed that indicates whether an optimal solution was found and, if not, why Knitro terminated. Below is a list of the most common termination messages.

  • EXIT: Locally optimal solution found.

    Knitro found a locally optimal point that satisfies the stopping criterion (see section Termination Criteria for more detail on how this is defined). If the problem is convex (for example, a linear program), then this point corresponds to a globally optimal solution.

  • EXIT: Optimal solution found., EXIT: Optimal solution found (assuming convexity).

    Knitro found an integer feasible point of a discrete problem that satisfies the optimality gap criterion (see section Discrete Problems). The second message indicates that this conclusion relies on the assumption that the problem is convex.

  • EXIT: Primal feasible solution estimate cannot be improved. It appears to be optimal, but desired accuracy in dual feasibility could not be achieved.

    No more progress can be made, but the stopping tests are close to being satisfied (within a factor of 100) and so the current approximate solution is believed to be optimal.

  • EXIT: Primal feasible solution estimate cannot be improved; desired accuracy in dual feasibility could not be achieved.

    No more progress can be made. The current point is feasible and may be optimal; however, the stopping tests cannot be satisfied, perhaps because of degeneracy, ill-conditioning, or bad scaling.

  • EXIT: Convergence to an infeasible point. Problem appears to be locally infeasible.

    The algorithm has converged to an infeasible point from which it cannot further decrease the infeasibility measure. This happens when the problem is infeasible, but may also occur on occasion for feasible problems with nonlinear constraints or badly scaled problems. It is recommended to try various initial points, for example, by enabling multi-start (ms_enable). If this occurs for a variety of initial points, it is likely the problem is infeasible. See also Infeasible Problems.

  • EXIT: Current infeasible solution estimate cannot be improved.

    No more progress towards a feasible point can be made. The problem may be badly scaled or (locally) infeasible.

  • EXIT: Problem appears to be unbounded.

    The objective function appears to be decreasing without bound, while satisfying the constraints (see objrange).

  • EXIT: Iteration limit reached., EXIT: Time limit reached., EXIT: Node limit reached.

    The iteration, time, or node limit (see maxit, maxtime, and mip_maxnodes) was reached before being able to satisfy the required stopping criteria. The second part of the message (e.g., Current point is feasible. or No integer feasible point found.) states whether the final point is feasible.

  • EXIT: All nodes have been explored.

    All nodes of the branch-and-bound tree of a discrete problem have been explored, but the optimality gap criterion is not satisfied. The second part of the message states whether an integer feasible point has been found.

  • EXIT: Evaluation error.

    An evaluation error occurred (e.g., division by zero or the square root of a negative number) from which Knitro could not recover (see section Evaluation Errors).

  • EXIT: Not enough memory available to solve problem.

    There was not enough memory available to solve the problem.

Special Features

This section describes some special features of Knitro and the GAMS/Knitro link and provides some guidance on how to use them.

Second Derivatives

By default (hessopt = 0), Knitro uses the exact second derivatives provided by GAMS, which is highly recommended. However, if the Hessian is expensive to compute or large and dense, one of the following alternatives may be more efficient:

hessopt Method Remarks
2 dense quasi-Newton BFGS positive-definite approximation, small to medium problems only
3 dense quasi-Newton SR1 for negative curvature, small to medium problems only
4 finite-difference Hessian-vector products not with Interior/Direct or SQP
5 exact Hessian-vector products Hessian is not stored, not with Interior/Direct or SQP
6 limited-memory quasi-Newton BFGS for large problems, see option lmsize

The quasi-Newton methods only use gradient information to approximate the Hessian. They typically require more iterations to converge than the exact Hessian, but each iteration is cheaper. The dense approximations (hessopt=2 and 3) are only recommended for small to medium problems ( \(n < 1000\)). Each finite-difference Hessian-vector product (hessopt=4) requires one additional gradient evaluation. Exact Hessian-vector products (hessopt=5) should perform nearly as well as the exact Hessian but require much less storage. If GAMS cannot provide the requested second derivative information, the GAMS/Knitro link switches to the BFGS approximation and prints the message Hessian-vector product not available. Using BFGS.

Staying Feasible

In some applications, functions are undefined outside the region defined by the variable bounds or the inequality constraints (e.g., log(x) for \(x \le 0\)). Knitro offers two options to keep the iterates inside this region.

The option honorbnds controls whether the variable bounds (1c) are satisfied throughout the optimization process. By default (honorbnds=-1), Knitro decides automatically. With honorbnds=1, the initial point and all intermediate iterates satisfy the bounds. With honorbnds=2, only the initial point satisfies the bounds. With honorbnds=0, the bounds are only enforced at the solution.

The option bar_feasible can force intermediate iterates to stay feasible with respect to the inequality constraints (feasibility with respect to the equality constraints is not enforced, however). If the initial point is sufficiently feasible with respect to all inequality constraints, setting bar_feasible = 1 forces all iterates to strictly satisfy the inequality constraints throughout the solution process. For the feasible mode to become active, the iterate \(x\) must satisfy

\begin{equation}\tag{3} c^L + tol \le c(x) \le c^U - tol \end{equation}

for all inequality constraints (i.e., for \(c^L \ne c^U\)). The tolerance \(tol>0\) by which an iterate must be strictly feasible for entering the feasible mode is determined by the option bar_feasmodetol, which is 1.0e-4 by default. If the initial point does not satisfy (3) then the default infeasible version of Knitro runs until it obtains a point which is sufficiently feasible with respect to all the inequality constraints. At this point, it switches to the feasible version of Knitro and all subsequent iterates are forced to satisfy the inequality constraints.

For a detailed description of the feasible version of Knitro see [27] .

Note
The option bar_feasible may only be used with the interior-point algorithms (nlp_algorithm=1 or 2).

Complementarity Constraints

For models of type MCP, MPEC, and RMPEC, the GAMS/Knitro link passes the complementarity conditions to Knitro, which handles them with special care internally. Knitro currently only supports complementarity constraints between two nonnegative variables. Therefore, the link reformulates each complementarity pair of an equation \(F(x)\) and a variable \(x_j\) using additional nonnegative variables and constraints. For example, if \(x_j\) has a finite lower bound \(b_j^L\) only, the link adds the nonnegative variables \(w\) and \(t\), the constraints \(F(x) - w = 0\) and \(x_j - t = b_j^L\), and the complementarity constraint between \(w\) and \(t\). A variable with finite lower and upper bounds leads to two complementarity constraints, and for a free variable, the equation is passed as an equality constraint. Hence, the problem solved by Knitro contains more variables and constraints than the GAMS model (see the problem characteristics in the log).

The feasibility error of a complementarity constraint between \(x_1\) and \(x_2\) is measured as \(\min(x_1, x_2)\), and the feasibility tolerances described in section Continuous Problems apply. With the interior-point algorithms, the options bar_initpi_mpec (initial value of the penalty parameter) and bar_mpec_heuristic (a heuristic that may speed up the convergence and provide a more precise solution) can be used. In addition, the Knitro presolver may transform quadratic constraints into complementarity constraints (see option presolveop_implied_mpec), and for discrete problems, Knitro offers an MPEC heuristic that handles binary variables via complementarity constraints (see option mip_heuristic_mpec).

Convexity

Several features of Knitro depend on whether the problem is convex. In particular, the optimality claims for discrete problems are only reliable for convex problems (see section Discrete Problems), and Knitro applies specializations and tunings that are often beneficial for convex problems. By default (convex = -1), Knitro tries to determine convexity automatically, which is only possible for simple model forms such as QPs and QCQPs. With convex=1 or convex=0, the problem can be declared convex or nonconvex, respectively. This also skips the automatic convexity check. Declaring a nonconvex problem convex may result in incorrect optimality claims. If Knitro declares a discrete problem optimal based on the assumption of convexity, it terminates with the message EXIT: Optimal solution found (assuming convexity).

Starting Point

The GAMS/Knitro link passes the levels and marginals of the variables and the marginals of the equations to Knitro as a starting point. Which values are passed is controlled by the option initvalues0 for the first solve of a model and by the option initvalues for all subsequent solves of the same model. By default, only non-default values are passed in the first solve, that is, levels that differ from the default level and nonzero marginals, while all values are passed in subsequent solves. Passing only non-default values in the first solve allows Knitro to choose the starting point more freely (e.g., by its own initial point strategy, see option initpt_strategy) if the model does not provide a good starting point. In subsequent solves, the solution of the previous solve is usually a good starting point. The log reports how many values have been passed (see section Continuous Problems). For discrete problems, the levels are also passed as an initial guess for the MIP solution, from which Knitro tries to construct a feasible solution.

Note that Knitro may shift a given starting point so that it lies sufficiently inside the bounds (see option honorbnds).

Multi-Start

Since Knitro finds local solutions, the solution of a nonconvex problem may depend on the starting point. With ms_enable = 1, Knitro solves a continuous problem from multiple starting points and returns the best solution found. The number of solves is controlled by the option ms_maxsolves. The multi-start solves can be run in parallel (see option ms_numthreads). For discrete problems, the option mip_multistart = 1 enables a multi-start heuristic at the branch-and-bound level, which is recommended for nonconvex problems.

Evaluation Errors

If an evaluation error occurs at a trial point (e.g., log(x) for \(x \le 0\)), the GAMS/Knitro link reports this to Knitro, which then tries to continue from a different point. The GAMS option domlim is ignored, i.e., the solve is not stopped after a certain number of evaluation errors. The evaluation errors are reported in the listing file. If Knitro cannot recover, it terminates with the message EXIT: Evaluation error. To avoid evaluation errors, it is recommended to add bounds on the variables that keep the functions defined and to use the options described in section Staying Feasible.

Tuner

The Knitro-Tuner helps to identify non-default option settings that may improve the performance on a particular model or set of models. It is enabled with the option tuner and controlled via the tuner_ family of options. With tuner=1, Knitro runs the model with a variety of automatically determined option settings and reports some statistics at the end. Any Knitro options that have been set in the usual way remain fixed throughout the tuning procedure.

Instead of letting Knitro choose the options to tune, the options and the values to explore can be specified in a Tuner options file, which is loaded via the option tuner_optionsfile. A Tuner options file is a simple text file that is similar to a standard Knitro option file, with some important differences:

  • Multiple values (separated by spaces) can be defined for each option. Knitro explores these values.
  • An option name can be specified without any values. Knitro then explores all possible values of this option. This only works for options that have a finite set of possible values.

All possible combinations of the options and values specified in a Tuner options file are explored, while any Knitro options that have been set in the usual way remain fixed.

For example, the following option file knitro.opt enables the tuner and loads the Tuner options file tuner.opt:

tuner 1
tuner_optionsfile tuner.opt

With the following Tuner options file tuner.opt, Knitro explores all possible values of the option nlp_algorithm and the values 1 and 4 of the option bar_murule:

# explore all possible values of nlp_algorithm
nlp_algorithm
# explore the values 1 and 4 of bar_murule
bar_murule 1 4

At the end of the tuning procedure, Knitro reports the fastest solve together with its non-default option settings as well as summary statistics for each explored option value.

Writing the Problem

The option writeprob writes the problem as passed to Knitro to a file. The file format is determined by the file extension, where .mps and .lp are supported. Note that these formats can only represent the linear and quadratic parts of the problem. General nonlinear terms are omitted, i.e., nonlinear constraints are written with their linear and quadratic parts only. Hence, for nonlinear problems, the written file does not describe the problem solved by Knitro and is mainly useful for inspecting the problem structure. With names = 1, the GAMS variable and equation names are used in this file.

List of Knitro Options

General options

Option Description Default
blasoption Specifies the BLAS/LAPACK function library to use for basic vector and matrix computations -1
blasoptionlib Specifies a dynamic library name that contains object code for BLAS/LAPACK functions
bndrange Specifies max limits on the magnitude of constraint and variable bounds 1e+20
cg_maxit Determines the maximum allowable number of inner conjugate gradient (CG) iterations per Knitro minor iteration -1
cg_pmem Specifies the amount of nonzero elements per column of the Hessian of the Lagrangian which are retained when computing the incomplete Cholesky preconditioner 10
cg_precond Specifies whether an incomplete Cholesky preconditioner is applied during CG iterations in barrier algorithms 0
cg_stoptol Specifies the relative stopping tolerance used for the conjugate gradient (CG) subproblem solves 0.01
convex Declare the problem as convex by setting to 1 or non-convex by setting to 0 -1
cpuplatform This option can be used to specify the target instruction set architecture for the machine on which Knitro is running -1
datacheck Specifies whether to perform more extensive data checks to look for errors in the problem input to Knitro (in particular, this option looks for errors in the sparse Jacobian and/or sparse Hessian structure) 0
delta Specifies the initial trust region radius scaling factor used to determine the initial trust region size 1
deterministic This option specifies whether to always enforce deterministic behavior for Knitro 1
eval_cost Use this option to tell Knitro the relative cost of performing a callback 0
honorbnds Indicates whether or not to enforce satisfaction of simple variable bounds throughout the optimization -1
initpenalty Specifies the initial penalty parameter used in the Knitro merit functions 10
initpt_strategy Specifies the initial point strategy used for the continuous algorithms -1
initvalues Enable use of initial guess for levels and marginals (subsequent solves) 1
initvalues0 Enable use of initial guess for levels and marginals (first solve) 2
linesearch Indicates which linesearch strategy to use for the Interior/Direct or SQP algorithm to search for a new acceptable iterate 0
linesearch_maxtrials Indicates the maximum allowable number of trial points during the linesearch of the Interior/Direct or SQP algorithm before treating the linesearch step as a failure and generating a new step 3
linsolver Indicates which linear solver to use to solve linear systems arising in Knitro algorithms 0
linsolver_maxitref Indicates the maximum allowable number of iterative refinement steps applied when a linear system is solved inside Knitro 2
linsolver_nodeamalg Controls the node amalgamation setting for the MA57, MA86 and MA97 linear solvers 0
linsolver_ooc Indicates whether to use Intel MKL PARDISO out-of-core solve of linear systems when linsolver = mklpardiso 0
linsolver_ordering Sets the ordering method used for the linear system solver -1
linsolver_pivottol Specifies the initial pivot threshold used in factorization routines 1e-08
linsolver_scaling Enables scaling for the linear system solver 0
lp_algorithm Indicates which algorithm to use to solve linear problems (LPs) -1
maxstepsize This option enforces a maximum step size limit at every iteration of the continuous NLP algorithms in Knitro (as well as the barrier LP algorithm) -1
maxstepsize_maxit This option specifies the maximum number of iterations where the maxstepsize restriction is enforced (if 0 then no iteration limit is imposed for this) 0
names Enable to pass variable and equation names to Knitro 0
ncvx_qcqp_init Specifies the initialization strategy used for non-convex QPs and QCQPs -1
nlp_algorithm Indicates which algorithm to use to solve nonlinear problems (e.g. NLPs, QPs, QCQPs) 0
objrange Specifies the extreme limits of the objective function for purposes of determining unboundedness 1e+20
option_file additional option file name - read only by KNITRO solver lib
output_time print output on where time is used 0
qextractalg quadratic extraction algorithm in GAMS interface 0
qextractdenseswitchfactor Sparse/dense factor for quadratic extraction algorithm in GAMS interface 0.008
qextractdenseswitchlog Enables additional information about sparse/dense factor choice in quadratic extraction algorithm in GAMS interface 0
restarts Specifies whether or not to enable automatic restarts in Knitro -1
restarts_maxit When restarts are enabled, this option can be used to specify a maximum number of iterations before enforcing a restart 0
scale Specifies whether to perform problem scaling of the objective function, constraint functions, or possibly variables 1
scale_strategy Strategies for problem scaling. Multiple strategies can be selected at once using multiple bits 0
soc Specifies whether or not to try second order corrections (SOC) 1
soltype This option specifies the solution returned by Knitro 0
strat_warm_start Specifies whether or not to invoke a warm-start strategy 0
writeprob Writes problem to file (format based on extension)

Derivative options

Option Description Default
bfgs_scaling Specify the initial scaling to use for the BFGS or L-BFGS Hessian approximation 0
findiff_estnoise This option can be used to enable an estimate of the noise in the model when using finite-difference gradients 0
findiff_relstepsize Specifies the relative stepsize used for finite-difference gradients during the optimization 0
hessopt Specifies how to compute the (approximate) Hessian of the Lagrangian 0
lmsize Specifies the number of limited memory pairs stored when approximating the Hessian using the limited-memory quasi-Newton BFGS option 8

Termination options

Option Description Default
feaserr_level This option specifies the feasibility error measure used at the algorithm level and for termination 1
feastol Specifies the final relative stopping tolerance for the feasibility error -1
feastol_abs Specifies the final absolute stopping tolerance for the feasibility error -1
findiff_terminate This option specifies the termination criteria when using finite-difference gradients 1
fstopval Used to implement a custom stopping condition based on the objective function value maxdouble
ftol The optimization process will terminate if the relative change in the objective function is less than ftol for ftol_iters consecutive feasible iterations 1e-12
ftol_iters The optimization process will terminate if the relative change in the objective function is less than ftol for ftol_iters consecutive feasible iterations 5
infeastol Specifies the (relative) tolerance used for declaring infeasibility of a model 1e-08
infeastol_iters Controls the termination for consecutive infeasible iterations 50
maxfevals Specifies the maximum number of function evaluations before termination -1
maxit Specifies the maximum number of iterations before termination GAMS iterlim
maxtime Specifies, in seconds, the maximum allowable real time before termination GAMS reslim
opttol Specifies the final relative stopping tolerance for the KKT (optimality) error -1
opttol_abs Specifies the final absolute stopping tolerance for the KKT (optimality) error -1
xtol Tolerance for convergence criterion based on relative change between successive solution points 1e-12
xtol_iters Number of iterations for convergence criterion based on relative change between successive solution points 0

Presolve options

Option Description Default
presolve Determine whether or not to use the Knitro presolver to try to simplify the model by removing variables or constraints 1
presolveop_clique_merging Determine whether or not to enable the Knitro presolve operations that attempt to merge cliques to strengthen the formulation -1
presolveop_implied_mpec Transforms quadratic constraints into MPEC constraints 1
presolveop_probing Determine whether or not to enable the Knitro presolve operations that analyze deductions made by fixing integer variables -1
presolveop_redundant Determine whether or not to enable the Knitro presolve operation to detect and remove redundant constraints 1
presolveop_substitution Determine whether or not to enable the Knitro presolve operation to substitute out variables when possible -1
presolveop_substitution_tol Tolerance for applying a substitution 0.01
presolveop_tighten Determine whether or not to enable the Knitro presolve operation to tighten variable bounds or coefficients -1
presolve_initpt Control whether the Knitro presolver can shift a user-supplied initial point -1
presolve_level Set the level of presolve operations to enable through the Knitro presolver -1
presolve_passes Set a maximum limit on the number of passes through the Knitro presolve operations 10
presolve_tol Determines the tolerance used by the Knitro presolver to remove variables and constraints from the model 1e-08
presolve_zero_tol Tolerance for rounding to zero linear coefficients in presolve. Higher values mean that more reductions will be applied. Zero value is not recommended as it means no rounding is done, which can lead to numerical instability 1e-11

Barrier options

Option Description Default
bar_conic_enable Enable special treatments for conic constraints -1
bar_directinterval Controls the maximum number of consecutive conjugate gradient (CG) steps before Knitro will try to enforce that a step is taken using direct linear algebra -1
bar_feasible Specifies whether special emphasis is placed on getting and staying feasible in the interior-point algorithms 0
bar_feasmodetol Tolerance used in the feasibility condition that determines whether Knitro will force subsequent iterates to remain feasible 0.0001
bar_globalize Specifies the globalization strategy used in the interior-point algorithms 2
bar_initmu Specifies the initial value for the barrier parameter \(\mu\) used with the barrier algorithms -1
bar_initpi_mpec Specifies the initial value for the MPEC penalty parameter \(\pi\) used when solving problems with complementarity constraints using the barrier algorithms 0
bar_initpt Indicates initial point strategy for x, slacks and multipliers when using a barrier algorithm 0
bar_linsys Indicates which linear system form is used inside the Interior/Direct algorithm for computing primal-dual steps -1
bar_linsys_storage Indicates how to store in memory the linear systems used inside the Interior/Direct algorithm for computing primal-dual steps -1
bar_maxcorrectors Specifies the maximum number of corrector steps allowed for primal-dual steps -1
bar_maxcrossit Specifies the maximum number of crossover iterations before termination 0
bar_maxmu Specifies the maximum allowable value for the barrier parameter \(\mu\) used with the barrier algorithms 1e+16
bar_maxrefactor Indicates the maximum number of refactorizations of the KKT system per iteration of the Interior/Direct algorithm before reverting to a CG step -1
bar_mpec_heuristic Specifies whether or not to use a heuristic approach when solving MPEC models with the barrier algorithm 0
bar_murule Indicates which strategy to use for modifying the barrier parameter \(\mu\) in the barrier algorithms 0
bar_penaltycons Indicates whether a penalty approach is applied to the constraints -1
bar_penaltyrule Indicates which penalty parameter strategy to use for determining whether or not to accept a trial iterate 0
bar_refinement Specifies whether to try to refine the barrier solution for better precision 0
bar_relaxcons Indicates whether a relaxation approach is applied to the constraints 2
bar_slackboundpush Specifies the amount by which the barrier slack variables are initially pushed inside the bounds -1
bar_switchobj Indicates which objective function to use when the barrier algorithms switch to a pure feasibility phase 1
bar_switchrule Indicates whether or not the barrier algorithms will allow switching from an optimality phase to a pure feasibility phase -1
bar_watchdog Specifies whether to enable watchdog heuristic for barrier algorithms 0

Active-set options

Option Description Default
act_lpfeastol Specifies the feasibility tolerance used for linear programming subproblems solved when using the Active Set or SQP algorithms 1e-08
act_lppenalty Indicates whether to use a penalty formulation for linear programming subproblems in the Knitro Active Set or SQP algorithms 1
act_lppresolve Indicates whether to apply a presolve for linear programming subproblems in the Knitro Active Set or SQP algorithms 0
act_parametric Indicates whether to use a parametric approach when solving linear programming (LP) subproblems when using the Knitro Active Set or SQP algorithms 1
act_qpalg Indicates which algorithm to use to solve quadratic programming (QP) subproblems when using the Knitro Active Set or SQP algorithms 0
act_qppenalty Indicates whether to use a penalty formulation for quadratic programming subproblems in the Knitro SQP algorithm -1

Augmented Lagrangian options

Option Description Default
al_initpenalty Specifies the initial penalty parameter value used in the Augmented Lagrangian (AL) algorithm 0
al_maxpenalty Specifies the maximum allowable penalty parameter value used in the Augmented Lagrangian (AL) algorithm 1e+10

MIP options

Option Description Default
mip_branchrule Specifies which branching rule to use for MIP branch and bound procedure 0
mip_clique Specifies rules for adding clique cuts -1
mip_cutfactor This value specifies a limit on the number of cuts added to a node subproblem 1
mip_cutoff This value specifies the objective cutoff value for MIP maxdouble
mip_cutoff_abs This value specifies the absolute improvement cutoff value for MIP 1e-06
mip_cutoff_rel This value specifies the relative improvement cutoff value for MIP 0.0001
mip_cutting_plane Specifies when to apply the cutting plane procedure 1
mip_cut_flowcover Specifies rules for adding flow cover cuts -1
mip_cut_probing Specifies rules for adding probing cuts -1
mip_gomory Specifies rules for adding Gomory mixed-integer cuts -1
mip_gub_branch Specifies whether or not to branch on generalized upper bounds (GUBs) 0
mip_heuristic_diving Specifies whether or not to enable the MIP diving heuristic 1
mip_heuristic_feaspump Specifies whether or not to enable the MIP feasibility pump heuristic -1
mip_heuristic_fixpropagate Specifies whether or not to enable the MIP fix-and-propagate heuristic 1
mip_heuristic_lns Specifies whether or not to enable the MIP large neighborhood search (LNS) heuristics -1
mip_heuristic_localsearch Specifies whether or not to enable the MIP local search heuristic -1
mip_heuristic_maxit Maximum number of iterations to allow for MIP heuristic 100
mip_heuristic_misqp Specifies whether or not to enable the MIP MISQP heuristic -1
mip_heuristic_mpec Specifies whether or not to enable the MIP MPEC heuristic -1
mip_heuristic_strategy Specifies the level of effort applied for the MIP heuristic search used to try to find an initial integer feasible point -1
mip_heuristic_terminate Specifies the condition for terminating the MIP heuristic 1
mip_implications Whether to add logical implications deduced from branching decisions at a MIP node 1
mip_integer_tol This value specifies the threshold for deciding whether or not a variable is determined to be an integer 1e-08
mip_intvar_strategy Specifies how to handle integer variables 0
mip_knapsack Specifies rules for adding MIP knapsack cuts -1
mip_liftproject Specifies rules for adding lift and project cuts -1
mip_maxnodes Specifies the maximum number of nodes explored (0 means no limit) GAMS nodlim
mip_method Specifies which MIP method to use 0
mip_mir Specifies rules for adding mixed-integer rounding (MIR) cuts -1
mip_multistart Use to enable MIP multi-start at the branch-and-bound level 0
mip_node_lpalg Specifies which algorithm to use for standard node LP subproblem solves in MIP (same options as lp_algorithm user option) -1
mip_node_nlpalg Specifies which algorithm to use for standard node NLP subproblem solves in MIP (same options as nlp_algorithm user option) 0
mip_numthreads Number of threads to use for MIP solvers 0
mip_opt_gap_abs The absolute optimality gap stop tolerance for MIP GAMS optca
mip_opt_gap_rel The relative optimality gap stop tolerance for MIP GAMS optcr
mip_outinterval Specifies node printing interval for mip_outlevel when mip_outlevel > 0 0
mip_outlevel Specifies how much MIP information to print 2
mip_pseudoinit Specifies the method used to initialize pseudo-costs corresponding to variables that have not yet been branched on in the MIP method 0
mip_relaxable Specifies whether integer variables are relaxable 1
mip_restart Specifies whether to enable the MIP restart procedure 1
mip_root_lpalg Specifies which algorithm to use for root node LP subproblem solves in MIP (same options as lp_algorithm user option) -1
mip_root_nlpalg Specifies which algorithm to use for root node NLP solves in MIP (same options as nlp_algorithm user option) 0
mip_rounding Specifies the MIP rounding rule to apply -1
mip_selectdir Specifies the MIP node selection direction rule (for tiebreakers) for choosing the next node in the branch-and-bound tree 0
mip_selectrule Specifies the MIP select rule for choosing the next node in the branch-and-bound tree 0
mip_strong_candlim Specifies the maximum number of candidates to explore for MIP strong branching 128
mip_strong_level Specifies the maximum number of tree levels on which to perform MIP strong branching 10
mip_strong_maxit Specifies the maximum number of iterations to allow for MIP strong branching solves 1000
mip_sub_maxtime Specifies the maximum allowable real time in seconds for MIP node subproblems 1e+08
mip_terminate Specifies conditions for terminating the MIP algorithm 0
mip_zerohalf Specifies rules for adding zero-half cuts -1

Concurrent solver options

Option Description Default
concurrent_lpalg Specifies the LP algorithms to run concurrently when the concurrent solver is enabled on an LP -1
concurrent_maxsolves Specifies the maximum number of solves when using the concurrent solver (should be more than 1 and <= numthreads) 0
concurrent_nlpalg Specifies the NLP algorithms to run concurrently when the concurrent solver is enabled on an NLP -1
concurrent_outlog Specifies the output logging options when the concurrent solver is enabled 2
concurrent_solver Specifies whether or not to enable the concurrent solver -1

Multi-start options

Option Description Default
ms_enable Whether to enable multistart to find a better local minimum 0
ms_initpt_cluster The strategy for clustering initial points in multi-start 0
ms_maxbndrange Specifies the maximum range that an unbounded variable can vary over when multistart computes new start points 1000
ms_maxsolves How many Knitro solutions to compute if multistart is enabled 0
ms_numthreads Number of threads to use in parallel multistart 0
ms_num_to_save How many feasible multistart points to save in file knitro_mspoints.log 0
ms_outsub Enable writing algorithm output to files for the parallel multi-start procedure 0
ms_savetol Specifies the tolerance for deciding two feasible points are the same 1e-06
ms_seed Seed value used to generate random initial points in multi-start; should be a non-negative integer 0
ms_startptrange Specifies the maximum range that any variable can vary over when multistart computes new start points 1e+20
ms_sub_maxtime Specifies, in seconds, the maximum allowable real time for multi-start subproblems 1e+08
ms_terminate Specifies conditions for terminating the multistart procedure 4
ms_terminaterule_tol The tolerance in (0,1] for the rule-based termination of multi-start 0

Parallelism options

Option Description Default
blas_numthreads Specify the number of threads to use for BLAS operations when blasoption = 1 0
conic_numthreads Number of threads to do conic operations in parallel. Choose any positive integer, or 0 = determine automatically based on numthreads 0
linsolver_numthreads Specify the number of threads to use for linear system solve operations when linsolver = 6 0
threads default thread count GAMS threads

Output options

Option Description Default
newpoint Specifies additional action to take after every iteration in a solve of a continuous problem, or after every new incumbent of the NLPBB algorithm 0
outappend Specifies whether output should be started in a new file, or appended to existing files 0
outdir Specifies a single directory as the location to write all output files
outlev Controls the level of output produced by Knitro 2
outmode Specifies where to direct the output from Knitro 0
outname Use to specify a custom filename when output is written to a file using outmode
out_csvinfo Controls whether or not to generate a file knitro_solve.csv containing solve information in comma separated format 0
out_csvname Use to specify a custom csv filename when using out_csvinfo
out_hints Specifies whether to print diagnostic hints (e.g. about user option settings) after solving 1

Tuner options

Option Description Default
tuner Indicates whether to invoke the Knitro-Tuner 0
tuner_optionsfile Can be used to specify the location of a Tuner options file
tuner_outsub Enable writing additional Tuner subproblem solve output to files for the Knitro-Tuner procedure (tuner = 1) 0
tuner_sub_maxtime Specifies, in seconds, the maximum allowable real time for Knitro-Tuner subproblems (i.e. individual solves with a particular option setting) 1e+08
tuner_terminate Define the termination condition for the Knitro-Tuner procedure (tuner = 1) 0

Detailed Options Description

act_lpfeastol (real): Specifies the feasibility tolerance used for linear programming subproblems solved when using the Active Set or SQP algorithms ↵

Range: [0, ∞]

Default: 1e-08

act_lppenalty (integer): Indicates whether to use a penalty formulation for linear programming subproblems in the Knitro Active Set or SQP algorithms ↵

Default: 1

value meaning
1 (all) Penalize all constraints.
2 (nonlinear) Penalize only nonlinear constraints.
3 (dynamic) Dynamically choose which constraints to penalize.

act_lppresolve (integer): Indicates whether to apply a presolve for linear programming subproblems in the Knitro Active Set or SQP algorithms ↵

Default: 0

value meaning
0 (off) Presolve turned off for LP subproblems.
1 (on) Presolve turned on for LP subproblems.

act_parametric (integer): Indicates whether to use a parametric approach when solving linear programming (LP) subproblems when using the Knitro Active Set or SQP algorithms ↵

A parametric approach will solve a sequence of closely related LPs instead of one LP. It may increase the cost of an active-set iteration, but perhaps lead to convergence in fewer iterations.

Default: 1

value meaning
0 (no) Never
1 (maybe) Use selectively
2 (yes) Always use parametric approach

act_qpalg (integer): Indicates which algorithm to use to solve quadratic programming (QP) subproblems when using the Knitro Active Set or SQP algorithms ↵

This option has no effect on the Interior/Direct and Interior/CG algorithms.

Default: 0

value meaning
0 (auto) Let Knitro choose the algorithm
1 (direct) Use Interior (barrier) Direct algorithm
2 (cg) Use Interior (barrier) CG algorithm
3 (active) Use Active Set SLQP algorithm

act_qppenalty (integer): Indicates whether to use a penalty formulation for quadratic programming subproblems in the Knitro SQP algorithm ↵

Default: -1

value meaning
-1 (auto) Let Knitro automatically decide.
0 (none) Do not penalize constraints in QP subproblems.
1 (all) Penalize all constraints in QP subproblems.

al_initpenalty (real): Specifies the initial penalty parameter value used in the Augmented Lagrangian (AL) algorithm ↵

A larger initial penalty value places more weight initially on achieving feasibility. Setting this parameter to 0.0 (the default setting) means Knitro will automatically try to choose a good initial value for the penalty parameter.

Range: [0, 1e+16]

Default: 0

al_maxpenalty (real): Specifies the maximum allowable penalty parameter value used in the Augmented Lagrangian (AL) algorithm ↵

If feasibility cannot be achieved once this value is reached, the problem is declared infeasible.

Range: [0, 1e+16]

Default: 1e+10

bar_conic_enable (integer): Enable special treatments for conic constraints ↵

Only when using the Interior/Direct algorithm (has no effect when using the Interior/CG algorithm).

Default: -1

value meaning
-1 (auto) Let Knitro automatically choose the strategy.
0 (none) Do not apply any special treatment for conic constraints.
1 (soc) Apply special treatments for any Second Order Cone (SOC) constraints identified in the model.

bar_directinterval (integer): Controls the maximum number of consecutive conjugate gradient (CG) steps before Knitro will try to enforce that a step is taken using direct linear algebra ↵

This option is only valid for the Interior/Direct algorithm and may be useful on problems where Knitro appears to be taking lots of conjugate gradient steps. Setting bar_directinterval to 0 will try to enforce that only direct steps are taken which may produce better results on some problems.

Range: {-1, ..., ∞}

Default: -1

bar_feasible (integer): Specifies whether special emphasis is placed on getting and staying feasible in the interior-point algorithms ↵

This option can only be used with the Interior/Direct and Interior/CG algorithms. If bar_feasible = stay or bar_feasible = get_stay, this will activate the feasible version of Knitro. The feasible version of Knitro will force iterates to strictly satisfy inequalities, but does not require satisfaction of equality constraints at intermediate iterates. This option and the honorbnds option may be useful in applications where functions are undefined outside the region defined by inequalities. The initial point must satisfy inequalities to a sufficient degree; if not, Knitro may generate infeasible iterates and does not switch to the feasible version until a sufficiently feasible point is found. Sufficient satisfaction occurs at a point x if it is true for all inequalities that cl + tol ≤ c(x) ≤ cu - tol. The constant tol is determined by the option bar_feasmodetol. If bar_feasible = get or bar_feasible = get_stay, Knitro will place special emphasis on first trying to get feasible before trying to optimize.

Default: 0

value meaning
0 (no) No emphasis on feasibility
1 (stay) Iterates must satisfy inequality constraints once they become sufficiently feasible.
2 (get) Special emphasis is placed on getting feasible before trying to optimize.
3 (get_stay) Implement both options 1 and 2 above.

bar_feasmodetol (real): Tolerance used in the feasibility condition that determines whether Knitro will force subsequent iterates to remain feasible ↵

The tolerance applies to all inequality constraints in the problem. This option only has an effect if option bar_feasible = stay or bar_feasible = get_stay.

Range: [0, ∞]

Default: 0.0001

bar_globalize (integer): Specifies the globalization strategy used in the interior-point algorithms ↵

Default: 2

value meaning
0 (none) Do not apply any globalization strategy
1 (kkt) Apply a globalization strategy based on decreasing the KKT error
2 (filter) Apply a globalization strategy using a filter based on the objective and constraint violation

bar_initmu (real): Specifies the initial value for the barrier parameter \(\mu\) used with the barrier algorithms ↵

This option has no effect on the Active Set algorithm.

Range: [-∞, ∞]

Default: -1

bar_initpi_mpec (real): Specifies the initial value for the MPEC penalty parameter \(\pi\) used when solving problems with complementarity constraints using the barrier algorithms ↵

If this value is non-positive, then Knitro uses an internal formula to initialize the MPEC penalty parameter.

Range: [0, ∞]

Default: 0

bar_initpt (integer): Indicates initial point strategy for x, slacks and multipliers when using a barrier algorithm ↵

Note, this option only alters the initial x values if the user does not specify an initial x. This option has no effect on the Active Set algorithm.

Default: 0

value meaning
0 (auto) Let Knitro choose the strategy
1 (convex) Initialization designed for convex models.
2 (nearbnd) Initialization strategy that stays closer to the bounds.
3 (central) Initialization strategy that is more central on double-bounded variables.

bar_linsys (integer): Indicates which linear system form is used inside the Interior/Direct algorithm for computing primal-dual steps ↵

Eliminating more elements results in a smaller dimensional linear system (but also one that is, perhaps, less numerically stable). The bounds option may be preferable for very large problems with many bounded variables. The ineq option may generate significant speedups on models where the number of variables is small, but the number of inequality constraints is large.

Default: -1

value meaning
-1 (auto) Let Knitro automatically choose the linear system form.
0 (full) Use the full linear system.
1 (slacks) Eliminate the slack variables.
2 (bounds) Eliminate the slack variables and bounds.
3 (ineqs) Eliminate the slack variables, bounds, and some inequalities.

bar_linsys_storage (integer): Indicates how to store in memory the linear systems used inside the Interior/Direct algorithm for computing primal-dual steps ↵

The lowmem option uses one storage location for multiple linear systems. As a result it may use much less memory, but also may be less efficient when the Interior/Direct algorithm takes a lot of CG steps. The normal option uses separate storage for different linear systems.

Default: -1

value meaning
-1 (auto) Let Knitro automatically choose the linear system storage approach.
1 (lowmem) Use common storage for multiple linear systems.
2 (normal) Use separate storage for different linear systems.

bar_maxcorrectors (integer): Specifies the maximum number of corrector steps allowed for primal-dual steps ↵

If the value is positive and the algorithm used is Interior/Direct, then Knitro may add at most bar_maxcorrectors corrector steps to the primal-dual step to try to stay closer to the central path. This may speedup convergence on some models (although it may make the cost per iteration a little more expensive). If the value is negative, Knitro automatically determines the maximum number of corrector steps to apply.

Range: {-1, ..., ∞}

Default: -1

bar_maxcrossit (integer): Specifies the maximum number of crossover iterations before termination ↵

If the value is positive and the algorithm in operation is Interior/Direct or Interior/CG, then Knitro will crossover to the Active Set algorithm near the solution. The Active Set algorithm will then perform at most bar_maxcrossit iterations to get a more exact solution. If the value is 0, no Active Set crossover occurs and the interior-point solution is the final result. If Active Set crossover is unable to improve the approximate interior-point solution, then Knitro will restore the interior-point solution. In some cases (especially on large-scale problems or difficult degenerate problems) the cost of the crossover procedure may be significant – for this reason, crossover is disabled by default. Enabling crossover generally provides a more accurate solution than Interior/Direct or Interior/CG.

Range: {0, ..., ∞}

Default: 0

bar_maxmu (real): Specifies the maximum allowable value for the barrier parameter \(\mu\) used with the barrier algorithms ↵

Range: [3e-16, 1e+16]

Default: 1e+16

bar_maxrefactor (integer): Indicates the maximum number of refactorizations of the KKT system per iteration of the Interior/Direct algorithm before reverting to a CG step ↵

If this value is set to -1, it will use a dynamic strategy. These refactorizations are performed if negative curvature is detected in the model. Rather than reverting to a CG step, the Hessian matrix is modified in an attempt to make the subproblem convex and then the KKT system is refactorized. Increasing this value will make the Interior/Direct algorithm less likely to take CG steps. If the Interior/Direct algorithm is taking a large number of CG steps (as indicated by a positive value for "CGits" in the output), this may improve performance. This option has no effect on the Active Set algorithm.

Range: {-1, ..., ∞}

Default: -1

bar_mpec_heuristic (integer): Specifies whether or not to use a heuristic approach when solving MPEC models with the barrier algorithm ↵

In some cases enabling this heuristic can speedup the convergence to the solution and provide a more precise solution on MPEC models (i.e., models with complementarity constraints).

Default: 0

value meaning
0 (no) No MPEC heuristic enabled
1 (yes) MPEC heuristic is enabled

bar_murule (integer): Indicates which strategy to use for modifying the barrier parameter \(\mu\) in the barrier algorithms ↵

Not all strategies are available for both barrier algorithms, as described below. This option has no effect on the Active Set algorithm.

Default: 0

value meaning
0 (auto) Let Knitro choose the strategy
1 (monotone) Monotonically decrease the barrier parameter. Available for both barrier algorithms.
2 (adaptive) Use an adaptive rule based on the complementarity gap to determine the value of the barrier parameter. Available for both barrier algorithms.
3 (probing) Use a probing (affine-scaling) step to dynamically determine the barrier parameter. Available only for the Interior/Direct algorithm.
4 (dampmpc) Use a Mehrotra predictor-corrector type rule to determine the barrier parameter, with safeguards on the corrector step. Available only for the Interior/Direct algorithm.
5 (fullmpc) Use a Mehrotra predictor-corrector type rule to determine the barrier parameter, without safeguards on the corrector step. Available only for the Interior/Direct algorithm.
6 (quality) Minimize a quality function at each iteration to determine the barrier parameter. Available only for the Interior/Direct algorithm.

bar_penaltycons (integer): Indicates whether a penalty approach is applied to the constraints ↵

Using a penalty approach may be helpful when the problem has degenerate or difficult constraints. It may also help to more quickly identify infeasible problems, or achieve feasibility in problems with difficult constraints. This option has no effect on the Active Set algorithm.

Default: -1

value meaning
-1 (auto) Let Knitro choose the strategy
0 (none) Do not apply penalty approach to any constraints
2 (all) Apply a penalty approach to all general constraints
3 (equalities) Apply a penalty approach to equality constraints only

bar_penaltyrule (integer): Indicates which penalty parameter strategy to use for determining whether or not to accept a trial iterate ↵

This option has no effect on the Active Set algorithm.

Default: 0

value meaning
0 (auto) Let Knitro choose the strategy
1 (single) Use a single penalty parameter in the merit function to weight feasibility versus optimality.
2 (flex) Use a more tolerant and flexible step acceptance procedure based on a range of penalty parameter values.

bar_refinement (integer): Specifies whether to try to refine the barrier solution for better precision ↵

If enabled, once the optimality conditions are satisfied, Knitro will apply an additional refinement/postsolve phase to try to obtain more precision in the barrier solution. The effect is similar to the effect of enabling bar_maxcrossit, but it is usually much more efficient since it does not involve switching to the Active Set algorithm.

Default: 0

value meaning
0 (no) Do not refine the barrier solution
1 (yes) Try to refine the barrier solution

bar_relaxcons (integer): Indicates whether a relaxation approach is applied to the constraints ↵

Using a relaxation approach may be helpful when the problem has degenerate or difficult constraints. This option has no effect on the Active Set algorithm.

Default: 2

value meaning
0 (none) Do not relax any constraints
1 (eqs) Relax only equality constraints
2 (ineqs) Relax only inequality constraints
3 (all) Relax all general constraints

bar_slackboundpush (real): Specifies the amount by which the barrier slack variables are initially pushed inside the bounds ↵

A smaller value may be preferable when warm-starting from a point close to the solution.

Range: [-∞, ∞]

Default: -1

bar_switchobj (integer): Indicates which objective function to use when the barrier algorithms switch to a pure feasibility phase ↵

Default: 1

value meaning
0 (none) No objective
1 (scalarprox) Proximal point objective with scalar weighting
2 (diagprox) Proximal point objective with diagonal weighting

bar_switchrule (integer): Indicates whether or not the barrier algorithms will allow switching from an optimality phase to a pure feasibility phase ↵

Default: -1

value meaning
-1 (auto) Let Knitro choose the strategy
0 (never) Never switch
2 (moderate) Allow moderate switching
3 (aggressive) More aggressive switching

bar_watchdog (integer): Specifies whether to enable watchdog heuristic for barrier algorithms ↵

In general, enabling the watchdog heuristic makes the barrier algorithms more likely to accept trial points. Specifically, the watchdog heuristic may occasionally accept trial points that increase the merit function, provided that subsequent iterates decrease the merit function.

Default: 0

value meaning
0 (no) No watchdog heuristic
1 (yes) Allow watchdog heuristic to be used

bfgs_scaling (integer): Specify the initial scaling to use for the BFGS or L-BFGS Hessian approximation ↵

Default: 0

value meaning
0 (dynamic) Dynamically determine
1 (invhess) Approximate scale of the inverse Hessian
2 (hess) Approximate the scale of the Hessian

blasoption (integer): Specifies the BLAS/LAPACK function library to use for basic vector and matrix computations ↵

BLAS and LAPACK functions from Intel Math Kernel Library (MKL) are provided with the Knitro distribution. The number of threads to use for the MKL BLAS are specified with blas_numthreads. On platforms where Intel MKL and Apple Accelerate are not available, the Knitro built-in functions are used by default. BLAS (Basic Linear Algebra Subroutines) and LAPACK (Linear Algebra PACKage) functions are used throughout Knitro for fundamental vector and matrix calculations. The CPU time spent in these operations can be measured by setting option debug = 1 and examining the output file kdbg_profile*.txt. Some optimization problems are observed to spend very little CPU time in BLAS/LAPACK operations, while others spend more than 50%. Be aware that the different function implementations can return slightly different answers due to roundoff errors in double precision arithmetic. Thus, changing the value of blasoption sometimes alters the iterates generated by Knitro, or even the final solution point. The knitro option uses built-in BLAS/LAPACK functions based on standard netlib routines (www.netlib.org). The intel option uses MKL functions written especially for x86_64 processor architectures. On a machine running an Intel processor, testing indicates that the MKL functions can significantly reduce the CPU time in BLAS/LAPACK operations. The dynamic option allows users to load any library that implements the required BLAS/LAPACK functions. Specify the library name with option blasoptionlib.

Default: -1

value meaning
-1 (auto) Let Knitro automatically choose which BLAS to use
0 (knitro) Use Knitro built-in functions
1 (intel) Use Intel Math Kernel Library (MKL) functions on available platforms.
2 (dynamic) Use the dynamic library specified with option blasoptionlib
3 (blis) Use BLIS functions on available platforms (currently not available on Windows OS).
4 (apple) Use Apple Accelerate (only available on macOS).

blasoptionlib (string): Specifies a dynamic library name that contains object code for BLAS/LAPACK functions ↵

The library must implement all BLAS/LAPACK functions required by KNITRO. This option has no effect unless blasoption = 2.

blas_numthreads (integer): Specify the number of threads to use for BLAS operations when blasoption = 1 ↵

In case of a GAMS license with core limit, the link may overwrite blas_numthreads to enforce the limit.

Range: {0, ..., ∞}

Default: 0

bndrange (real): Specifies max limits on the magnitude of constraint and variable bounds ↵

Any constraint or variable bounds whose magnitude is greater than or equal to bndrange will be treated as infinite by Knitro. Using very large, finite bounds is discouraged (and is generally an indication of a poorly scaled model).

Range: [0, ∞]

Default: 1e+20

cg_maxit (integer): Determines the maximum allowable number of inner conjugate gradient (CG) iterations per Knitro minor iteration ↵

Range: {-1, ..., ∞}

Default: -1

cg_pmem (integer): Specifies the amount of nonzero elements per column of the Hessian of the Lagrangian which are retained when computing the incomplete Cholesky preconditioner ↵

Range: {0, ..., ∞}

Default: 10

cg_precond (integer): Specifies whether an incomplete Cholesky preconditioner is applied during CG iterations in barrier algorithms ↵

Default: 0

value meaning
0 (no) Not applied
1 (chol) Preconditioner is applied

cg_stoptol (real): Specifies the relative stopping tolerance used for the conjugate gradient (CG) subproblem solves ↵

Range: [0, ∞]

Default: 0.01

concurrent_lpalg (integer): Specifies the LP algorithms to run concurrently when the concurrent solver is enabled on an LP ↵

Default: -1

value meaning
-1 (auto) Automatically determine LP algorithm for concurrent solver
0 (nlp) Use algorithms specified in concurrent_nlpalg
1 (primalsimplex) Enable Primal Simplex algorithm for concurrent solver
2 (dualsimplex) Enable Dual Simplex algorithm for concurrent solver
4 (barrier) Enable Interior-Point/Barrier algorithm for concurrent solver
8 (pdlp) Enable Primal-Dual Linear Programming algorithm for concurrent solver

concurrent_maxsolves (integer): Specifies the maximum number of solves when using the concurrent solver (should be more than 1 and <= numthreads) ↵

Knitro will automatically set the maximum solve limit based on numthreads if set to 0.

Range: {-∞, ..., ∞}

Default: 0

concurrent_nlpalg (integer): Specifies the NLP algorithms to run concurrently when the concurrent solver is enabled on an NLP ↵

Default: -1

value meaning
-1 (auto) Automatically determine NLP algorithm for concurrent solver
1 (direct) Enable Barrier Direct algorithm for concurrent solver
2 (cg) Enable Interior Barrier CG algorithm for concurrent solver
4 (active) Enable Active-Set SLQP algorithm for concurrent solver
8 (sqp) Enable SQP algorithm for concurrent solver
16 (al) Enable Augmented Lagrangian algorithm for concurrent solver

concurrent_outlog (integer): Specifies the output logging options when the concurrent solver is enabled ↵

Default: 2

value meaning
1 (all) Show all iteration information on all concurrent solves
2 (objfeas) Show objective and feasibility error on all concurrent solves
3 (best) Show information from the current best concurrent solve iterate

concurrent_solver (integer): Specifies whether or not to enable the concurrent solver ↵

Default: -1

value meaning
-1 (auto) Determine automatically whether to enable the concurrent solver.
0 (no) Do not enable the concurrent solver.
1 (yes) Enable the concurrent solver.

conic_numthreads (integer): Number of threads to do conic operations in parallel. Choose any positive integer, or 0 = determine automatically based on numthreads ↵

Range: {-∞, ..., ∞}

Default: 0

convex (integer): Declare the problem as convex by setting to 1 or non-convex by setting to 0 ↵

Otherwise, Knitro will try to determine this automatically, but may only be able to do so for simple model forms such as QPs or QCQPs. If your model is specified as (or automatically determined to be) convex, this will cause Knitro to apply specializations and tunings that are often beneficial for convex models to speed up the solution.

Default: -1

value meaning
-1 (auto) Knitro will try to determine this automatically, but may only be able to do so for simple model forms such as QPs or QCQPs.
0 (no) Declare problem as non-convex
1 (yes) Declare problem as convex

cpuplatform (integer): This option can be used to specify the target instruction set architecture for the machine on which Knitro is running ↵

This can be used, for example (especially using the setting compatible), to try to produce more consistent Knitro performance across various architectures (at the expense of, perhaps, slower performance on some platforms). This option is currently only used for the Intel Math Kernel Library (MKL) functions used inside Knitro.

Default: -1

value meaning
-1 (auto) Determine automatically
1 (compatible) Aim for more compatible performance across architectures
2 (sse2) SSE2
3 (avx) AVX
4 (avx2) AVX-2
5 (avx512) AVX-512 (experimental)

datacheck (integer): Specifies whether to perform more extensive data checks to look for errors in the problem input to Knitro (in particular, this option looks for errors in the sparse Jacobian and/or sparse Hessian structure) ↵

The datacheck may have a non-trivial cost for large problems.

Default: 0

value meaning
0 (no) No extra data checks
1 (yes) Perform extra data checks

delta (real): Specifies the initial trust region radius scaling factor used to determine the initial trust region size ↵

Range: [1e-14, ∞]

Default: 1

deterministic (integer): This option specifies whether to always enforce deterministic behavior for Knitro ↵

Generally, the Knitro algorithms execute deterministically regardless of the setting of this user option. There are some exceptions however. Some linear system solvers that may be used inside Knitro such as MA86 and Apple Accelerate do not enforce deterministic behavior (see linsolver). In addition, the concurrent solver (concurrent_solver) runs non-deterministically by default. Setting deterministic =1 will enforce that in all cases Knitro runs deterministically.

Default: 1

value meaning
0 (no) Do not enforce deterministic behavior in Knitro.
1 (yes) Enforce deterministic behavior in Knitro.

eval_cost (integer): Use this option to tell Knitro the relative cost of performing a callback ↵

For function, gradient and Hessian evaluations. Knitro will use this information to better tune its algorithms.

Default: 0

value meaning
0 (unspecified) Evaluation cost is not specified
1 (inexpensive) Evaluation cost is relatively inexpensive
2 (expensive) Evaluation cost is relatively expensive

feaserr_level (integer): This option specifies the feasibility error measure used at the algorithm level and for termination ↵

If set to the application level, the feasibility error used in the algorithm is based on the original, user problem form. If set to internal, then the feasibility error measure is based on the internal (presolved, scaled) problem form.

Default: 1

value meaning
1 (application) Use feasibility error based on application level (original) problem form
2 (internal) Use feasibility error based on internal (presolved, scaled) problem form

feastol (real): Specifies the final relative stopping tolerance for the feasibility error ↵

Smaller values of feastol result in a higher degree of accuracy in the solution with respect to feasibility. A negative value uses an automatic setting, which will adapt the stopping tolerance to the problem type and solution method (e.g. using a less strict tolerance for first-order methods). For standard NLP problems the auto setting will use 1.0e-6.

Range: [-1, ∞]

Default: -1

feastol_abs (real): Specifies the final absolute stopping tolerance for the feasibility error ↵

Synonym: feastolabs

Smaller values of feastol_abs result in a higher degree of accuracy in the solution with respect to feasibility. A negative value uses an automatic setting, which will adapt the stopping tolerance to the problem type and solution method (e.g. using a less strict tolerance for first-order methods). For standard NLP problems the auto setting will use 1.0e-3.

Range: [-1, ∞]

Default: -1

findiff_estnoise (integer): This option can be used to enable an estimate of the noise in the model when using finite-difference gradients ↵

This noise estimate can then be used to set a finite-difference steplength appropriate for the estimated noise level. This can improve performance on models with noise (e.g. noisy black-box optimization models). The cost of the noise estimation procedure is usually a few extra function evaluations.

Default: 0

value meaning
0 (no) No estimation of noise performed
1 (yes) Estimate the noise and perhaps use it to determine a finite-difference steplength
2 (withcurv) Estimate a curvature factor as well as the noise and perhaps use it to determine a finite-difference steplength

findiff_relstepsize (real): Specifies the relative stepsize used for finite-difference gradients during the optimization ↵

This option sets the stepsize for all variables. Note that this option has no effect on the finite-difference derivatives computed for the derivative checker (default values are always used here). It is only used for the finite-difference derivatives computed during the optimization.

Range: [-∞, ∞]

Default: 0

findiff_terminate (integer): This option specifies the termination criteria when using finite-difference gradients ↵

The optimality (or KKT) conditions for nonlinear optimization depend on gradient values of the nonlinear objective and constraint functions. When using finite- difference gradients (e.g. gradopt > 1), there will typically be small errors in the computed gradients that will limit the precision in the solution (and the ability to satisfy the optimality conditions). By default, Knitro will try to estimate these finite-difference gradient errors and terminate when it seems that no more accuracy in the solution is possible. The solution will be treated as optimal as long as it is feasible and the optimality conditions are satisfied either by the optimality tolerances (opttol and opttol_abs) or the error estimates. On some problems, the error estimates may result in extra function evaluations on some iterations, but will often prevent extra iterations that produce no significant improvement in the solution. This special termination can be disabled by setting findiff_terminate = 0 (none).

Default: 1

value meaning
0 (none) No special criteria; use the standard stopping conditions.
1 (errest) Allow termination based on estimates of the finite-difference error (when no more significant progress is likely).

fstopval (real): Used to implement a custom stopping condition based on the objective function value ↵

Knitro will stop and declare that a satisfactory solution was found if a feasible objective function value at least as good as the value specified by fstopval is achieved. This stopping condition is only active when the absolute value of fstopval is less than objrange.

Range: [-∞, ∞]

Default: maxdouble

ftol (real): The optimization process will terminate if the relative change in the objective function is less than ftol for ftol_iters consecutive feasible iterations ↵

Range: [0, ∞]

Default: 1e-12

ftol_iters (integer): The optimization process will terminate if the relative change in the objective function is less than ftol for ftol_iters consecutive feasible iterations ↵

Range: {1, ..., ∞}

Default: 5

hessopt (integer): Specifies how to compute the (approximate) Hessian of the Lagrangian ↵

Options hessopt = 4 and hessopt = 5 are not available with the Interior/Direct or SQP algorithms. Knitro usually performs best when the user provides exact Hessians (hessopt = 1) or exact Hessian-vector products (hessopt = 5). If neither can be provided but exact gradients are available (i.e., gradopt = 1), then hessopt = 4 may be a good option. This option is comparable in terms of robustness to the exact Hessian option and typically not much slower in terms of time, provided that gradient evaluations are not a dominant cost. However, this option is only available for some algorithms. If exact gradients cannot be provided, then one of the quasi-Newton options is preferred. Options hessopt = 2 and hessopt = 3 are only recommended for small problems (say, n < 1000) since they require working with a dense Hessian approximation. Note that with these last two options, the Hessian pattern will be ignored since Knitro computes a dense approximation. Option hessopt = 6 should be used for large problems.

Default: 0

value meaning
0 (auto) Knitro will use exact Hessians if provided; otherwise it uses an appropriate approximation.
1 (exact) Knitro uses supplied exact second derivatives
2 (bfgs) Knitro computes a dense quasi-Newton BFGS Hessian
3 (sr1) Knitro computes a dense quasi-Newton SR1 Hessian
4 (product_findiff) Knitro computes Hessian-vector products by finite differences
5 (product) GAMS supplies exact Hessian-vector products
6 (lbfgs) Knitro computes a limited-memory quasi-Newton BFGS Hessian
7 (gauss_newton) Knitro computes a Gauss-Newton approximation of the Hessian (available for least-squares only, and default value for least-squares)

honorbnds (integer): Indicates whether or not to enforce satisfaction of simple variable bounds throughout the optimization ↵

This option and the bar_feasible option may be useful in applications where functions are undefined outside the region defined by inequalities. Note that setting honorbnds = 1 (always) or 2 (initpt) or using the default auto option may cause Knitro to shift the value of a user-provided initial point so that it lies sufficiently inside the (possibly presolved) bounds. Setting honorbnds = 0 (no) will prevent Knitro from shifting a user-provided initial point.

Default: -1

value meaning
-1 (auto) Setting determined automatically by Knitro
0 (no) Allow iterations to violate the bounds
1 (always) Enforce bounds satisfaction of all iterates
2 (initpt) Enforce bounds satisfaction of initial point

infeastol (real): Specifies the (relative) tolerance used for declaring infeasibility of a model ↵

Smaller values of infeastol make it more difficult to satisfy the conditions Knitro uses for detecting infeasible models. If you believe Knitro incorrectly declares a model to be infeasible, then you should try a smaller value for infeastol.

Range: [0, ∞]

Default: 1e-08

infeastol_iters (integer): Controls the termination for consecutive infeasible iterations ↵

The optimization process will terminate if the relative change in the feasibility error is less than infeastol for infeastol_iters consecutive infeasible iterations.

Range: {1, ..., ∞}

Default: 50

initpenalty (real): Specifies the initial penalty parameter used in the Knitro merit functions ↵

The Knitro merit functions are used to balance improvements in the objective function versus improvements in feasibility. A larger initial penalty value places more weight initially on feasibility in the merit function.

Range: [0, ∞]

Default: 10

initpt_strategy (integer): Specifies the initial point strategy used for the continuous algorithms ↵

Using a more advanced initial point strategy may produce a better initial point at the cost of more computation.

Default: -1

value meaning
-1 (auto) Automatic initial point strategy
1 (basic) Try basic initial point strategy
2 (advanced) Try more advanced initial point strategy

initvalues (integer): Enable use of initial guess for levels and marginals (subsequent solves) ↵

In case of a MI(NL)P, the initial levels are added as primal initial point for the root relaxation and as primal MIP initial guess. From the primal MIP initial guess Knitro will try to construct a feasible solution.

Default: 1

value meaning
0 Using no initial values
1 Using all initial values
2 Using only non-default initial values

initvalues0 (integer): Enable use of initial guess for levels and marginals (first solve) ↵

In case of a MI(NL)P, the initial levels are added as primal initial point for the root relaxation and as primal MIP initial guess. From the primal MIP initial guess Knitro will try to construct a feasible solution.

Default: 2

value meaning
0 Using no initial values
1 Using all initial values
2 Using only non-default initial values

linesearch (integer): Indicates which linesearch strategy to use for the Interior/Direct or SQP algorithm to search for a new acceptable iterate ↵

This option has no effect on the Interior/CG or Active Set algorithm.

Default: 0

value meaning
0 (auto) Let Knitro choose the linesearch method
1 (backtrack) Backtracking linesearch
2 (interpolate) Interpolation based linesearch
3 (weakwolfe) Weak Wolfe linesearch

linesearch_maxtrials (integer): Indicates the maximum allowable number of trial points during the linesearch of the Interior/Direct or SQP algorithm before treating the linesearch step as a failure and generating a new step ↵

This option has no effect on the Interior/CG or Active Set algorithm.

Range: {0, ..., ∞}

Default: 3

linsolver (integer): Indicates which linear solver to use to solve linear systems arising in Knitro algorithms ↵

The QR linear solver, the HSL MA57/MA86/MA97 linear solvers and the Intel MKL PARDISO solver all make frequent use of Basic Linear Algebra Subroutines (BLAS) for internal linear algebra operations. If using any of these it is highly recommended to use optimized BLAS for your particular machine. This can result in dramatic speedup. Please read the notes under the blasoption user option in this section for more details about the BLAS options in Knitro and how to make sure that the Intel MKL BLAS or other user-specified BLAS can be used by Knitro. You may also achieve speedups using multi-threaded BLAS with these solvers by setting numthreads > 1 or blas_numthreads > 1 when using the solvers. Additionally, the HSL solvers MA86 and MA97, the Intel MKL PARDISO solver, and the Apple Accelerate solver are specifically designed to exploit parallelism (beyond BLAS parallelism) to achieve speedups on large problems. You may try setting numthreads > 1 or linsolver_numthreads > 1 (with blas_numthreads = 1) when using these solvers, to obtain greater speedups.

Default: 0

value meaning
0 (auto) Let Knitro automatically choose the linear solver.
1 (internal) Use internal solver provided with Knitro.
2 (hybrid) Use a hybrid approach where the solver chosen depends on the particular linear system which needs to be solved.
3 (qr) Use a dense QR method. This approach uses LAPACK QR routines. Since it uses a dense method, it is only efficient for small problems. It may often be the most efficient method for small problems with dense Jacobians or Hessian matrices.
4 (ma27) Use the HSL MA27 sparse symmetric indefinite solver.
5 (ma57) Use the HSL MA57 sparse symmetric indefinite solver.
6 (mklpardiso) Use the Intel MKL PARDISO (parallel, deterministic) sparse symmetric indefinite solver (x86-64 only).
7 (ma97) Use the HSL MA97 (parallel, deterministic) sparse symmetric indefinite solver.
8 (ma86) Use the HSL MA86 (parallel, non-deterministic) sparse symmetric indefinite solver.
9 (apple) Use the Apple Accelerate (parallel, non-deterministic) sparse symmetric indefinite solver (macOS only).

linsolver_maxitref (integer): Indicates the maximum allowable number of iterative refinement steps applied when a linear system is solved inside Knitro ↵

Iterative refinement steps may be applied when there are significant errors (e.g. large residuals) in the linear system solves. Applying more iterative refinement steps may improve the numerical accuracy of the linear solves at extra cost.

Range: {0, ..., ∞}

Default: 2

linsolver_nodeamalg (integer): Controls the node amalgamation setting for the MA57, MA86 and MA97 linear solvers ↵

A value of 0 indicates that the default value should be used for the given linear solver, while a positive value sets the node amalgamation parameter for the linear solver to that specific value.

Range: {0, ..., ∞}

Default: 0

linsolver_numthreads (integer): Specify the number of threads to use for linear system solve operations when linsolver = 6 ↵

In case of a GAMS license with core limit, the link may overwrite linsolver_numthreads to enforce the limit.

Range: {0, ..., ∞}

Default: 0

linsolver_ooc (integer): Indicates whether to use Intel MKL PARDISO out-of-core solve of linear systems when linsolver = mklpardiso ↵

This option is only active when linsolver = mklpardiso. See the Intel MKL PARDISO documentation for more details on how this option works.

Default: 0

value meaning
0 (no) Always use in-core version
1 (maybe) Will use out-of-core version beyond a certain size
2 (yes) Always use out-of-core version

linsolver_ordering (integer): Sets the ordering method used for the linear system solver ↵

Default: -1

value meaning
-1 (auto) Automatically determine ordering procedure
0 (best) Choose the best between AMD and METIS
1 (amd) Use AMD ordering (min degree for MKL PARDISO)
2 (metis) Use METIS ordering

linsolver_pivottol (real): Specifies the initial pivot threshold used in factorization routines ↵

The value should be in the range [0, 0.5] with higher values resulting in more pivoting (more stable factorizations). Values less than 0 will be set to 0 and values larger than 0.5 will be set to 0.5. If linsolver_pivottol is non-positive, initially no pivoting will be performed. Smaller values may improve the speed of the code but higher values are recommended for more stability (for example, if the problem appears to be very ill-conditioned).

Range: [0, 0.5]

Default: 1e-08

linsolver_scaling (integer): Enables scaling for the linear system solver ↵

Applying scaling may allow for more accuracy in the linear system solves, but will generally make the linear system solves more expensive.

Default: 0

value meaning
0 (none) No scaling is applied in the linear system solves
1 (always) Always apply scaling in the linear system solves
2 (dynamic) Dynamically apply scaling in the linear system solves

lmsize (integer): Specifies the number of limited memory pairs stored when approximating the Hessian using the limited-memory quasi-Newton BFGS option ↵

The value must be between 1 and 100 and is only used with hessopt = 6. Larger values may give a more accurate, but more expensive, Hessian approximation. Smaller values may give a less accurate, but faster, Hessian approximation. When using the limited memory BFGS approach it is recommended to experiment with different values of this parameter.

Range: {1, ..., 100}

Default: 8

lp_algorithm (integer): Indicates which algorithm to use to solve linear problems (LPs) ↵

Default: -1

value meaning
-1 (auto) Let Knitro automatically decide.
0 (nlp) Use algorithm specified in nlp_algorithm.
1 (primalsimplex) Use Primal Simplex algorithm.
2 (dualsimplex) Use Dual Simplex algorithm.
3 (barrier) Use Interior-Point/Barrier algorithm.
4 (pdlp) Use Primal-Dual Linear Programming algorithm.

maxfevals (integer): Specifies the maximum number of function evaluations before termination ↵

Values less than zero imply no limit.

Range: {-∞, ..., ∞}

Default: -1

maxit (integer): Specifies the maximum number of iterations before termination ↵

Synonym: iterlim

Currently Knitro sets this value to 10000 for LPs/NLPs and 3000 for MIP problems.

Range: {0, ..., ∞}

Default: GAMS iterlim

maxstepsize (real): This option enforces a maximum step size limit at every iteration of the continuous NLP algorithms in Knitro (as well as the barrier LP algorithm) ↵

The maximum limit is based on the magnitude of the step taken at the algorithm level (on the scaled, presolved problem) and may not exactly correspond to the step measured at the application level. A value less than or equal to 0 implies no maximum limit is applied. The number of iterations where this limit is enforced is controlled by the maxstepsize_maxit user option.

Range: [-∞, ∞]

Default: -1

maxstepsize_maxit (integer): This option specifies the maximum number of iterations where the maxstepsize restriction is enforced (if 0 then no iteration limit is imposed for this) ↵

Range: {0, ..., ∞}

Default: 0

maxtime (real): Specifies, in seconds, the maximum allowable real time before termination ↵

Synonym: reslim

Range: [0, ∞]

Default: GAMS reslim

mip_branchrule (integer): Specifies which branching rule to use for MIP branch and bound procedure ↵

See options mip_strong_candlim, mip_strong_level and mip_strong_maxit for further control of strong branching procedure.

Default: 0

value meaning
0 (auto) Let Knitro choose the rule
1 (most_frac) Most fractional (most infeasible) variable
2 (pseudocost) Use pseudo-cost value
3 (strong) Use strong branching

mip_clique (integer): Specifies rules for adding clique cuts ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (none) Do not add clique cuts
1 (root) Add clique cuts at root node
2 (tree) Add clique cuts in the whole tree

mip_cutfactor (real): This value specifies a limit on the number of cuts added to a node subproblem ↵

If non-negative, a maximum of mip_cutfactor times the number of constraints is possibly appended.

Range: [0, ∞]

Default: 1

mip_cutoff (real): This value specifies the objective cutoff value for MIP ↵

Range: [-∞, ∞]

Default: maxdouble

mip_cutoff_abs (real): This value specifies the absolute improvement cutoff value for MIP ↵

When a new integer solution is found, this value will be subtracted (resp. added) to the incumbent value to determine the new cutoff value for a minimization problem (resp. maximization problem). A higher value will prune additional nodes (saving time). A lower value will improve bound precision.

Range: [0, ∞]

Default: 1e-06

mip_cutoff_rel (real): This value specifies the relative improvement cutoff value for MIP ↵

When a new integer solution is found, this percentage will be used to determine the new cutoff value from the incumbent value. A higher value will prune additional nodes (saving time). A lower value will improve bound precision.

Range: [0, ∞]

Default: 0.0001

mip_cutting_plane (integer): Specifies when to apply the cutting plane procedure ↵

Default: 1

value meaning
0 (none) Do not perform cutting plane
1 (root) Only perform root-cutting

mip_cut_flowcover (integer): Specifies rules for adding flow cover cuts ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (none) Do not add flow cover cuts
1 (root) Add flow cover cuts at root node only
2 (tree) Add flow cover cuts at any tree node

mip_cut_probing (integer): Specifies rules for adding probing cuts ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (none) Do not add probing cuts
1 (root) Add probing cuts at root node only
2 (tree) Add probing cuts at any tree node

mip_gomory (integer): Specifies rules for adding Gomory mixed-integer cuts ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (none) Do not add Gomory cuts
1 (root) Add Gomory cuts at root node only
2 (tree) Add Gomory cuts at any tree node

mip_gub_branch (integer): Specifies whether or not to branch on generalized upper bounds (GUBs) ↵

Default: 0

value meaning
0 (no) Do not branch on GUBs
1 (yes) Branch on GUBs

mip_heuristic_diving (integer): Specifies whether or not to enable the MIP diving heuristic ↵

This option is a bit-valued option where various diving heuristics can be enabled by activating the corresponding bit value as described below.

Default: 1

value meaning
1 (auto) Automatically determined. If enabled, other bits are ignored.
2 (d1) Pure fractional diving.
4 (d2) Objective-guided fractional diving.
8 (d3) Vectorlength diving (obsolete).
16 (d4) Coefficient-branching diving (obsolete).
32 (d5) Guided-branching diving (obsolete).
64 (d6) Linesearch diving (obsolete).
128 (d7) Pseudo-random diving using both fractionality and cliques.
256 (d8) Fractional diving followed by lock-based diving.
512 (d9) Fractional diving followed by objective-based diving.
1024 (d10) Fractional diving skewed towards fixing binaries to 1.

mip_heuristic_feaspump (integer): Specifies whether or not to enable the MIP feasibility pump heuristic ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (off) Feasibility pump heuristic is turned off
1 (on) Feasibility pump heuristic is turned on

mip_heuristic_fixpropagate (integer): Specifies whether or not to enable the MIP fix-and-propagate heuristic ↵

Default: 1

value meaning
1 (auto) Automatically determined. If enabled, other bits are ignored.
2 (fixprop1) Activate fix & propagate heuristic 1.
4 (fixprop2) Activate fix & propagate heuristic 2.
8 (fixprop3) Activate fix & propagate heuristic 3.
16 (fixprop4) Activate fix & propagate heuristic 4.
32 (fixprop5) Activate fix & propagate heuristic 5.

mip_heuristic_lns (integer): Specifies whether or not to enable the MIP large neighborhood search (LNS) heuristics ↵

This option is a bit-valued option where various LNS heuristics can be enabled by activating the corresponding bit value as described below. Setting this option to -1 will use an automatic setting and setting the value to 0 will disable all LNS heuristics. Otherwise, set this parameter value to the sum of the values for the individual LNS heuristics you wish to enable. For example, to enable both the "RENS" and "RINS" LNS heuristics, you would set this option value to 3 (summing 1 for RENS and 2 for RINS).

Range: {-1, ..., 31}

Default: -1

mip_heuristic_localsearch (integer): Specifies whether or not to enable the MIP local search heuristic ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (off) MIP local search heuristic is turned off
1 (on) MIP local search heuristic is turned on

mip_heuristic_maxit (integer): Maximum number of iterations to allow for MIP heuristic ↵

Range: {0, ..., ∞}

Default: 100

mip_heuristic_misqp (integer): Specifies whether or not to enable the MIP MISQP heuristic ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (off) MISQP heuristic is turned off
1 (on) MISQP heuristic is turned on

mip_heuristic_mpec (integer): Specifies whether or not to enable the MIP MPEC heuristic ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (off) MPEC heuristic is turned off
1 (on) MPEC heuristic is turned on

mip_heuristic_strategy (integer): Specifies the level of effort applied for the MIP heuristic search used to try to find an initial integer feasible point ↵

Default: -1

value meaning
-1 (auto) Automatic strategy
0 (none) No heuristics are used
1 (basic) Try basic heuristics
2 (advanced) Try more advanced heuristics
3 (extensive) Try most extensive heuristics

mip_heuristic_terminate (integer): Specifies the condition for terminating the MIP heuristic ↵

Default: 1

value meaning
1 (feasible) Terminate at first feasible point
2 (limit) Run heuristic until it hits limit

mip_implications (integer): Whether to add logical implications deduced from branching decisions at a MIP node ↵

Default: 1

value meaning
0 (no) Do not add logical implications
1 (yes) Add logical implications

mip_integer_tol (real): This value specifies the threshold for deciding whether or not a variable is determined to be an integer ↵

Range: [0, 1]

Default: 1e-08

mip_intvar_strategy (integer): Specifies how to handle integer variables ↵

Default: 0

value meaning
0 (none) No special treatment
1 (relax) Relax integer variables
2 (mpec) Convert to mpec constraints

mip_knapsack (integer): Specifies rules for adding MIP knapsack cuts ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (none) Do not add knapsack cuts
1 (root) Add knapsack cuts derived in the root node
2 (tree) Add knapsack cuts in the whole tree

mip_liftproject (integer): Specifies rules for adding lift and project cuts ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (none) Do not add lift and project cuts
1 (root) Add lift and project cuts at root node

mip_maxnodes (integer): Specifies the maximum number of nodes explored (0 means no limit) ↵

Synonym: nodlim

Range: {0, ..., ∞}

Default: GAMS nodlim

mip_method (integer): Specifies which MIP method to use ↵

Default: 0

value meaning
0 (auto) Let Knitro choose the method
1 (BB) Standard branch and bound
3 (MISQP) Mixed-integer SQP

mip_mir (integer): Specifies rules for adding mixed-integer rounding (MIR) cuts ↵

Default: -1

value meaning
-1 (auto) Automatically determine whether to add MIR cuts
0 (none) Do not add MIR cuts
1 (root) Add MIR cuts derived in the root node
2 (tree) Add MIR cuts in the whole tree

mip_multistart (integer): Use to enable MIP multi-start at the branch-and-bound level ↵

Default: 0

value meaning
0 (off) MIP multistart turned off
1 (on) MIP multistart turned on

mip_node_lpalg (integer): Specifies which algorithm to use for standard node LP subproblem solves in MIP (same options as lp_algorithm user option) ↵

Default: -1

value meaning
-1 (auto) Let Knitro automatically decide.
0 (nlp) Use algorithm specified in mip_node_nlpalg.
1 (primalsimplex) Use Primal Simplex algorithm.
2 (dualsimplex) Use Dual Simplex algorithm.
3 (barrier) Use Interior-Point/Barrier algorithm.
4 (pdlp) Use Primal-Dual Linear Programming algorithm.

mip_node_nlpalg (integer): Specifies which algorithm to use for standard node NLP subproblem solves in MIP (same options as nlp_algorithm user option) ↵

Default: 0

value meaning
0 (auto) Let Knitro choose the algorithm
1 (direct) Use Interior (barrier) Direct algorithm
2 (cg) Use Interior (barrier) CG algorithm
3 (active) Use Active Set SLQP algorithm
4 (sqp) Use Active Set SQP algorithm
5 (multi) Run multiple algorithms (deprecated)
6 (al) Use Augmented Lagrangian algorithm

mip_numthreads (integer): Number of threads to use for MIP solvers ↵

Choose any positive integer, or 0 = determine automatically.

Range: {0, ..., ∞}

Default: 0

mip_opt_gap_abs (real): The absolute optimality gap stop tolerance for MIP ↵

Synonym: optca

Range: [-1, ∞]

Default: GAMS optca

mip_opt_gap_rel (real): The relative optimality gap stop tolerance for MIP ↵

Synonym: optcr

Range: [-1, ∞]

Default: GAMS optcr

mip_outinterval (integer): Specifies node printing interval for mip_outlevel when mip_outlevel > 0 ↵

Range: {0, ..., ∞}

Default: 0

mip_outlevel (integer): Specifies how much MIP information to print ↵

Default: 2

value meaning
0 (none) Nothing
1 (iters) One line for every node
2 (iterstime) Also print accumulated time every node
3 (root) Also print output from root node relaxation solve

mip_pseudoinit (integer): Specifies the method used to initialize pseudo-costs corresponding to variables that have not yet been branched on in the MIP method ↵

Default: 0

value meaning
0 (auto) Let Knitro choose the method
1 (ave) Use average value
2 (strong) Use strong branching

mip_relaxable (integer): Specifies whether integer variables are relaxable ↵

Default: 1

value meaning
0 (none) Integer variables not relaxable
1 (all) All integer variables are relaxable

mip_restart (integer): Specifies whether to enable the MIP restart procedure ↵

Default: 1

value meaning
0 (off) MIP restart turned off
1 (on) MIP restart turned on

mip_root_lpalg (integer): Specifies which algorithm to use for root node LP subproblem solves in MIP (same options as lp_algorithm user option) ↵

Default: -1

value meaning
-1 (auto) Let Knitro automatically decide.
0 (nlp) Use algorithm specified in mip_root_nlpalg.
1 (primalsimplex) Use Primal Simplex algorithm.
2 (dualsimplex) Use Dual Simplex algorithm.
3 (barrier) Use Interior-Point/Barrier algorithm.
4 (pdlp) Use Primal-Dual Linear Programming algorithm.

mip_root_nlpalg (integer): Specifies which algorithm to use for root node NLP solves in MIP (same options as nlp_algorithm user option) ↵

Default: 0

value meaning
0 (auto) Let Knitro choose the algorithm
1 (direct) Use Interior (barrier) Direct algorithm
2 (cg) Use Interior (barrier) CG algorithm
3 (active) Use Active Set SLQP algorithm
4 (sqp) Use Active Set SQP algorithm
5 (multi) Run multiple algorithms (deprecated)
6 (al) Use Augmented Lagrangian algorithm

mip_rounding (integer): Specifies the MIP rounding rule to apply ↵

Default: -1

value meaning
-1 (auto) Let Knitro choose the rule
0 (none) Do not round if a node is infeasible
2 (heur_only) Round using heuristic only (fast)
3 (nlp_sometimes) Round and solve NLP if likely to succeed
4 (nlp_always) Always round and solve NLP

mip_selectdir (integer): Specifies the MIP node selection direction rule (for tiebreakers) for choosing the next node in the branch-and-bound tree ↵

Default: 0

value meaning
0 (down) Choose the less-than node first
1 (up) Choose the greater-than node first

mip_selectrule (integer): Specifies the MIP select rule for choosing the next node in the branch-and-bound tree ↵

Default: 0

value meaning
0 (auto) Let Knitro choose the rule
1 (depth_first) Search the tree depth first
2 (best_bound) Node with the best relaxation bound
3 (combo_1) Depth first unless pruned, then best bound

mip_strong_candlim (integer): Specifies the maximum number of candidates to explore for MIP strong branching ↵

0 means no limit.

Range: {0, ..., ∞}

Default: 128

mip_strong_level (integer): Specifies the maximum number of tree levels on which to perform MIP strong branching ↵

Range: {0, ..., ∞}

Default: 10

mip_strong_maxit (integer): Specifies the maximum number of iterations to allow for MIP strong branching solves ↵

Range: {0, ..., ∞}

Default: 1000

mip_sub_maxtime (real): Specifies the maximum allowable real time in seconds for MIP node subproblems ↵

Range: [0, ∞]

Default: 1e+08

mip_terminate (integer): Specifies conditions for terminating the MIP algorithm ↵

Default: 0

value meaning
0 (optimal) Terminate at optimum
1 (feasible) Terminate at first integer feasible point

mip_zerohalf (integer): Specifies rules for adding zero-half cuts ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (none) Do not add zero-half cuts
1 (root) Add cuts derived in the root node
2 (tree) Add zero-half cuts in the whole tree

ms_enable (integer): Whether to enable multistart to find a better local minimum ↵

Default: 0

value meaning
0 (no) Knitro solves from a single initial point
1 (yes) Knitro solves using multiple start points

ms_initpt_cluster (integer): The strategy for clustering initial points in multi-start ↵

Default: 0

value meaning
0 (none) Do not apply clustering
1 (sl) Apply single linkage based clustering

ms_maxbndrange (real): Specifies the maximum range that an unbounded variable can vary over when multistart computes new start points ↵

Range: [0, ∞]

Default: 1000

ms_maxsolves (integer): How many Knitro solutions to compute if multistart is enabled ↵

Choose any positive integer, or 0 means Knitro sets a default value depending on context.

Range: {0, ..., ∞}

Default: 0

ms_numthreads (integer): Number of threads to use in parallel multistart ↵

Choose any positive integer, or 0 = determine automatically based on numthreads.

Range: {0, ..., ∞}

Default: 0

ms_num_to_save (integer): How many feasible multistart points to save in file knitro_mspoints.log ↵

Choose any positive integer, or 0 means save none.

Range: {0, ..., ∞}

Default: 0

ms_outsub (integer): Enable writing algorithm output to files for the parallel multi-start procedure ↵

Default: 0

value meaning
0 (none) No output from subproblem solves
1 (yes) Subproblem output enabled, controlled by option outlev.

ms_savetol (real): Specifies the tolerance for deciding two feasible points are the same ↵

Range: [0, ∞]

Default: 1e-06

ms_seed (integer): Seed value used to generate random initial points in multi-start; should be a non-negative integer ↵

Range: {0, ..., ∞}

Default: 0

ms_startptrange (real): Specifies the maximum range that any variable can vary over when multistart computes new start points ↵

Range: [0, ∞]

Default: 1e+20

ms_sub_maxtime (real): Specifies, in seconds, the maximum allowable real time for multi-start subproblems ↵

This is the time for local solves from a given initial point. This option has no effect unless ms_enable = yes.

Range: [0, ∞]

Default: 1e+08

ms_terminate (integer): Specifies conditions for terminating the multistart procedure ↵

Default: 4

value meaning
0 (maxsolves) Terminate after maxsolves
1 (optimal) Terminate at first local optimum
2 (feasible) Terminate at first feasible solution estimate
3 (any) Terminate at first completed solve
4 (rulebased) Terminate when the estimated probability of finding a new local solution is low

ms_terminaterule_tol (real): The tolerance in (0,1] for the rule-based termination of multi-start ↵

Specifying a non-positive value will enable an automatic tolerance selection. Values closer to 1 trigger termination sooner, while values closer to zero will result in more solves before termination.

Range: [0, 1]

Default: 0

names (boolean): Enable to pass variable and equation names to Knitro ↵

Default: 0

ncvx_qcqp_init (integer): Specifies the initialization strategy used for non-convex QPs and QCQPs ↵

In particular, these strategies may be more likely to cause Knitro to find global or better local solutions on non-convex quadratic programs (QPs) or non- convex quadratically constrained quadratic programs (QCQPs).

Default: -1

value meaning
-1 (auto) Knitro will automatically determine the strategy.
0 (none) No special initialization strategy is used.
1 (linear) Initialize by solving a linear relaxation.
2 (hybrid) Initialize by solving a hybrid formulation.
3 (penalty) Initialize by solving a penalty formulation.
4 (cvxquad) Initialize by solving a convex quadratic relaxation.

newpoint (integer): Specifies additional action to take after every iteration in a solve of a continuous problem, or after every new incumbent of the NLPBB algorithm ↵

For a continuous problem, an iteration of Knitro results in a new point that is closer to a solution. The new point includes values of x and Lagrange multipliers lambda.

Default: 0

value meaning
0 (none) No additional action
1 (saveone) Save the latest new point to file knitro_newpoint.knsol. Previous contents of the file are overwritten.
2 (saveall) Export one file per iteration with the new point, named knitro_newpoint_#.knsol where # is the iteration number.

nlp_algorithm (integer): Indicates which algorithm to use to solve nonlinear problems (e.g. NLPs, QPs, QCQPs) ↵

Default: 0

value meaning
0 (auto) Let Knitro choose the algorithm
1 (direct) Use Interior (barrier) Direct algorithm
2 (cg) Use Interior (barrier) CG algorithm
3 (active) Use Active Set SLQP algorithm
4 (sqp) Use Active Set SQP algorithm
5 (multi) Run multiple algorithms (perhaps in parallel)
6 (al) Use Augmented Lagrangian algorithm

objrange (real): Specifies the extreme limits of the objective function for purposes of determining unboundedness ↵

If the magnitude of the objective function becomes greater than objrange for a feasible iterate, then the problem is determined to be unbounded and Knitro proceeds no further.

Range: [0, ∞]

Default: 1e+20

option_file (string): additional option file name - read only by KNITRO solver lib ↵

opttol (real): Specifies the final relative stopping tolerance for the KKT (optimality) error ↵

Smaller values of opttol result in a higher degree of accuracy in the solution with respect to optimality. A negative value uses an automatic setting, which will adapt the stopping tolerance to the problem type and solution method (e.g. using a less strict tolerance for first-order methods). For standard NLP problems the auto setting will use 1.0e-6.

Range: [-1, ∞]

Default: -1

opttol_abs (real): Specifies the final absolute stopping tolerance for the KKT (optimality) error ↵

Synonym: opttolabs

Smaller values of opttol_abs result in a higher degree of accuracy in the solution with respect to optimality. A negative value uses an automatic setting, which will adapt the stopping tolerance to the problem type and solution method (e.g. using a less strict tolerance for first-order methods). For standard NLP problems the auto setting will use 1.0e-3.

Range: [-1, ∞]

Default: -1

outappend (integer): Specifies whether output should be started in a new file, or appended to existing files ↵

The option affects knitro.log and files produced when debug = 1.

Default: 0

value meaning
0 (no) Erase existing files when opening
1 (yes) Append to existing files

outdir (string): Specifies a single directory as the location to write all output files ↵

The option should be a full pathname to the directory, and the directory must already exist.

outlev (integer): Controls the level of output produced by Knitro ↵

Default: 2

value meaning
0 (none) Printing of all output is suppressed
1 (summary) Print only summary information
2 (iter_10) Print basic information every 10 iterations
3 (iter) Print basic information at each iteration
4 (iter_verbose) Print basic information and the function count at each iteration
5 (iter_x) Print all the above, and the values of the solution vector x
6 (all) Print all the above, and the values of the constraints c at x and the Lagrange multipliers lambda

outmode (integer): Specifies where to direct the output from Knitro ↵

Default: 0

value meaning
0 (screen) Directed to GAMS log
1 (file) Directed to a file (default name knitro.log, see option outname)
2 (both) Both GAMS log and file

outname (string): Use to specify a custom filename when output is written to a file using outmode ↵

output_time (boolean): print output on where time is used ↵

Default: 0

out_csvinfo (integer): Controls whether or not to generate a file knitro_solve.csv containing solve information in comma separated format ↵

Default: 0

value meaning
0 (no) No csv solution file is generated
1 (yes) Generate a solution file knitro_solve.csv

out_csvname (string): Use to specify a custom csv filename when using out_csvinfo ↵

out_hints (integer): Specifies whether to print diagnostic hints (e.g. about user option settings) after solving ↵

Default: 1

value meaning
0 (no) Do not print any hints.
1 (yes) Print diagnostic hints on occasion.

presolve (integer): Determine whether or not to use the Knitro presolver to try to simplify the model by removing variables or constraints ↵

Default: 1

value meaning
0 (no) No presolve
1 (yes) Knitro performs presolve

presolveop_clique_merging (integer): Determine whether or not to enable the Knitro presolve operations that attempt to merge cliques to strengthen the formulation ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (no) Disabled
1 (yes) Enabled

presolveop_implied_mpec (integer): Transforms quadratic constraints into MPEC constraints ↵

Default: 1

value meaning
0 (no) Disabled
1 (yes) Enabled

presolveop_probing (integer): Determine whether or not to enable the Knitro presolve operations that analyze deductions made by fixing integer variables ↵

Default: -1

value meaning
-1 (auto) Automatic selection
0 (no) Disabled
1 (light) Light probing
2 (full) Full probing until no more deductions are found

presolveop_redundant (integer): Determine whether or not to enable the Knitro presolve operation to detect and remove redundant constraints ↵

Default: 1

value meaning
0 (none) Do not detect redundant constraints
1 (dupcon) Detect and remove duplicate constraints
2 (depcon) Detect and remove linearly dependent constraints

presolveop_substitution (integer): Determine whether or not to enable the Knitro presolve operation to substitute out variables when possible ↵

Default: -1

value meaning
-1 (auto) Automatic substitution procedure
0 (none) No substitution
1 (simple) Only doubleton equality substitutions
2 (all) All possible substitutions

presolveop_substitution_tol (real): Tolerance for applying a substitution ↵

This is a relative tolerance on coefficients involved with the substituted variable. Higher values mean that less reductions will be applied (potentially improving numerical focus). Zero value means all possible substitutions are applied.

Range: [0, ∞]

Default: 0.01

presolveop_tighten (integer): Determine whether or not to enable the Knitro presolve operation to tighten variable bounds or coefficients ↵

Default: -1

value meaning
-1 (auto) Automatic tightening procedure
0 (none) No tightening
1 (varbnd) Tighten variable bounds

presolve_initpt (integer): Control whether the Knitro presolver can shift a user-supplied initial point ↵

Default: -1

value meaning
-1 (auto) Determine automatically
0 (noshift) Do not shift initial point in presolve
1 (linshift) Allow shifting variables in linear constraints
2 (anyshift) Allow shifting any variable

presolve_level (integer): Set the level of presolve operations to enable through the Knitro presolver ↵

A higher presolve level enables more complex presolve operations.

Default: -1

value meaning
-1 (auto) Determine automatically
1 (level1) Most basic presolve
2 (level2) More advanced presolve

presolve_passes (integer): Set a maximum limit on the number of passes through the Knitro presolve operations ↵

Range: {0, ..., ∞}

Default: 10

presolve_tol (real): Determines the tolerance used by the Knitro presolver to remove variables and constraints from the model ↵

If you believe the Knitro presolver is incorrectly modifying the model, use a smaller value for this tolerance (or turn the presolver off).

Range: [0, ∞]

Default: 1e-08

presolve_zero_tol (real): Tolerance for rounding to zero linear coefficients in presolve. Higher values mean that more reductions will be applied. Zero value is not recommended as it means no rounding is done, which can lead to numerical instability ↵

Range: [0, ∞]

Default: 1e-11

qextractalg (integer): quadratic extraction algorithm in GAMS interface ↵

Default: 0

value meaning
0 Automatic
1 ThreePass: Uses a three-pass forward / backward / forward AD technique to compute function / gradient / Hessian values and a hybrid scheme for storage.
2 DoubleForward: Uses forward-mode AD to compute and store function, gradient, and Hessian values at each node or stack level as required. The gradients and Hessians are stored in linked lists.
3 Concurrent: Uses ThreePass and DoubleForward in parallel. As soon as one finishes, the other one stops.

qextractdenseswitchfactor (real): Sparse/dense factor for quadratic extraction algorithm in GAMS interface ↵

Range: [0, ∞]

Default: 0.008

qextractdenseswitchlog (boolean): Enables additional information about sparse/dense factor choice in quadratic extraction algorithm in GAMS interface ↵

Default: 0

restarts (integer): Specifies whether or not to enable automatic restarts in Knitro ↵

When enabled, if a Knitro algorithm seems to be converging slowly or not converging, the algorithm will automatically restart, which may help with convergence.

Range: {-1, ..., ∞}

Default: -1

restarts_maxit (integer): When restarts are enabled, this option can be used to specify a maximum number of iterations before enforcing a restart ↵

Range: {0, ..., ∞}

Default: 0

scale (integer): Specifies whether to perform problem scaling of the objective function, constraint functions, or possibly variables ↵

If scaling is performed, internal computations, including some aspects of the optimality tests, are based on the scaled values, though the feasibility error is always computed in terms of the original, unscaled values.

Default: 1

value meaning
0 (no) No scaling done
1 (user_internal) User, if defined, otherwise internal
2 (user_none) User, if defined, otherwise none
3 (internal) Knitro performs internal scaling

scale_strategy (integer): Strategies for problem scaling. Multiple strategies can be selected at once using multiple bits ↵

Default: 0

value meaning
0 (auto) Let Knitro choose the scaling strategy. Use option scale for fully disabling scaling.
1 (cons) Apply constraint scaling.
2 (vars) Apply variable scaling.
4 (obj) Apply objective scaling.
8 (equilibration) Apply Equilibration scaling. If enabled, curtisreid and ruizpock bits are ignored.
16 (curtisreid) Apply Curtis-Reid scaling.
32 (ruizpock) Apply Ruiz and Pock scalings.
64 (geomean) Use geometric mean in scaling computation rather than the infinity norm.
128 (varscaling_bounds) Apply variable scaling based on bounds. If disabled, the strategy given by the previous three bits is applied for variable scaling.
256 (scaling_up) Allow scaling factors larger than one.
512 (poweroftwo) Force scaling factors to be powers of two.
1024 (repeat) Allow scaling factor computation in a loop.
2048 (dynamic) Allow dynamic scaling (only for NLPs).

soc (integer): Specifies whether or not to try second order corrections (SOC) ↵

A second order correction may be beneficial for problems with highly nonlinear constraints.

Default: 1

value meaning
0 (no) Never do second order corrections
1 (maybe) SOC steps attempted on some iterations
2 (yes) SOC steps always attempted when constraints are nonlinear

soltype (integer): This option specifies the solution returned by Knitro ↵

Generally, the solution converged to by Knitro is a locally optimal solution that corresponds to the best feasible solution found. However, on rare occasions, Knitro may encounter a feasible solution during the optimization process that has a better objective value than the final solution converged to by Knitro. Setting soltype = 1 in this case will return this iterate.

Default: 0

value meaning
0 (final) Return the final iterate
1 (bestfeas) Return the best feasible iterate found

strat_warm_start (integer): Specifies whether or not to invoke a warm-start strategy ↵

A warm-start strategy may be beneficial when an initial point close to the solution can be provided. For example, this may occur when solving a sequence of closely related problems, and the solution from one problem can be used to initialize (or warm-start) the next problem in the sequence. The Knitro warm- start strategy will use this information to tune the algorithms to try to converge more quickly in this case. If the initial point is not sufficiently close to the solution, or is too infeasible, the warm-start strategy may not be helpful. This option is currently only used for the Knitro barrier/interior- point algorithms. In this case it may also be useful to experiment with different (smaller than default) values for the initial barrier parameter bar_initmu. In general, the closer the initial point is to the solution, the smaller this value should be (Knitro will try by default to initialize this to a good value when applying a warm-start strategy).

Default: 0

value meaning
0 (no) No warm-start strategy is applied.
1 (yes) Knitro will apply a warm-start strategy with special tunings.

threads (integer): default thread count ↵

Synonyms: gthreads numthreads

Controls the number of threads to use. Non-positive values are interpreted as the number of cores to leave free so setting threads to 0 uses all available cores while setting threads to -1 leaves one core free for other tasks.

By default, Knitro decides automatically how to use the threads specified. For example, if the multi-start method is enabled, it can run in parallel threads. If the multi-algorithm algorithm=5 is selected, the different algorithms can be run in parallel threads if threads are allocated. In case only one algorithm is running, multiple threads can be allocated to the MKL BLAS library or to the PARDISO linear solver via the threads option: see the blasoption, par_blasnumthreads, and par_lsnumthreads options for details. In case of a GAMS license with core limit, the link may overwrite threads to enforce the limit.

Range: {-∞, ..., ∞}

Default: GAMS threads

tuner (integer): Indicates whether to invoke the Knitro-Tuner ↵

Default: 0

value meaning
0 (off) Knitro Tuner turned off
1 (on) Knitro Tuner enabled

tuner_optionsfile (string): Can be used to specify the location of a Tuner options file ↵

tuner_outsub (integer): Enable writing additional Tuner subproblem solve output to files for the Knitro-Tuner procedure (tuner = 1) ↵

Default: 0

value meaning
0 (none) No output from subproblem solves and no subproblem summary file
1 (summary) Subproblem output summary directed to a file knitro_tuner_summary.log
2 (all) Subproblem output enabled, controlled by option outlev.

tuner_sub_maxtime (real): Specifies, in seconds, the maximum allowable real time for Knitro-Tuner subproblems (i.e. individual solves with a particular option setting) ↵

This option has no effect unless tuner = on.

Range: [0, ∞]

Default: 1e+08

tuner_terminate (integer): Define the termination condition for the Knitro-Tuner procedure (tuner = 1) ↵

Default: 0

value meaning
0 (all) Terminate after all Tuner runs complete
1 (optimal) Terminate at first local optimum
2 (feasible) Terminate at first feasible solution estimate
3 (any) Terminate at first completed solve

writeprob (string): Writes problem to file (format based on extension) ↵

xtol (real): Tolerance for convergence criterion based on relative change between successive solution points ↵

The optimization process will terminate if the relative change in all components of the solution point estimate is less than xtol for xtol_iters consecutive iterations. If using the Interior/Direct or Interior/CG algorithm and the barrier parameter is still large, Knitro will first try decreasing the barrier parameter before terminating.

Range: [0, ∞]

Default: 1e-12

xtol_iters (integer): Number of iterations for convergence criterion based on relative change between successive solution points ↵

The optimization process will terminate if the relative change in all components of the solution point estimate is less than xtol for xtol_iters consecutive iterations. If set to 0, Knitro chooses this value based on the solver and context. Currently Knitro sets this value to 3 unless the MISQP algorithm is being used, in which case the value is set to 1 by default.

Range: {0, ..., ∞}

Default: 0