KNITRO

Introduction

Artelys Knitro is a software package for finding local solutions of both continuous (i.e. smooth) optimization problems, with or without constraints, and discrete optimization problems with integer or binary variables. Even though Knitro has been designed for solving large-scale general problems, it is efficient for solving all of the following classes of optimization problems:

  • unconstrained,
  • bound constrained,
  • equality constrained,
  • systems of nonlinear equations,
  • least squares problems,
  • linear programming problems (LPs),
  • quadratic programming problems (QPs),
  • general (inequality) constrained problems,
  • (convex) mixed integer nonlinear programs (MINLP) of moderate size.

The Knitro package provides the following features:

  • Efficient and robust solution of small or large problems,
  • Solvers for both continuous and discrete problems,
  • Derivative-free, 1st derivative and 2nd derivative options,
  • Both interior-point (barrier) and active-set optimizers,
  • Both feasible and infeasible versions,
  • Both iterative and direct approaches for computing steps,

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. This allows many forms of constraints, including bounds on the variables. Knitro requires that the functions \(f(x)\) and \(c(x)\) be smooth functions.

Knitro implements both state-of-the-art interior-point and active-set methods for solving nonlinear optimization problems. In the interior method (also known as a barrier method), the nonlinear programming problem is replaced by a series of barrier sub-problems controlled by a barrier parameter \(\mu\). The algorithm uses trust regions and a merit function to promote convergence. The algorithm performs one or more minimization steps on each barrier problem, 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 within the interior point approach. In the version known as Interior/CG each step is computed using a projected conjugate gradient iteration. This approach differs from most interior 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.

The second procedure for computing the steps, which we call Interior/Direct, always attempts to compute a new iterate by solving the primal-dual KKT matrix using direct linear algebra. In the case when this step cannot be guaranteed to be of good quality, or if negative curvature is detected, then the new iterate is computed by the Interior/CG procedure.

Knitro also implements an active-set sequential linear-quadratic programming (SLQP) algorithm which we call Active. This method is similar in nature to a sequential quadratic programming method but uses linear programming sub-problems to estimate the active-set at each iteration. This active-set code may be preferable when a good initial point can be provided, for example, when solving a sequence of related problems.

For problems with discrete variables, Knitro provides two variants of the branch and bound algorithm. The first is a standard implementation, while the second is specialized for convex, mixed-integer nonlinear problems.

We encourage the user to try all algorithmic options to determine which one is more suitable for the application at hand. For guidance on choosing the best algorithm see section Algorithm Options .

For a detailed description of the algorithm implemented in Interior/CG see [29] and for the global convergence theory see [30] . The method implemented in Interior/Direct is described in [196] . The Active algorithm is described in [32] and the global convergence theory for this algorithm is in [33] . An important component of Knitro is the HSL routine MA27 [91] which is used to solve the linear systems arising at every iteration of the algorithm. In addition, the Active Set algorithm in Knitro may make use of the COIN-OR Clp linear programming solver module. The version used in Knitro may be downloaded from https://www.artelys.com/app/docs/clp/.

Usage

Basic details of solver usage, including how to choose Knitro as the solver and how to use a solver-specific option file, are part of Chapter Solver Usage.

As an NLP solver, Knitro can also be used to solve linear programs (LP), and both convex and nonconvex quadratic programs (QCP).

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 the solver will terminate and pass on the current solution to GAMS. See also reslim in section GAMS options .

  • Option SysOut = On;

    This option sends additional Knitro messages to the GAMS listing file. It is useful in case of a solver failure or to get algorithmic details. See also sysout 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.

Summary of Knitro Options

The Knitro options file knitro.opt allows the user to easily set options controlling 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, to set the maximum allowable number of iterations to 500, one could use the following options file:

maxit 500

General options

Option Description Default
blasoption Specifies the BLAS/LAPACK function library to use for basic vector and matrix computations 1 or 4 (platform dependent)
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
eval_cost Use this option to tell Knitro the relative cost of performing callback (e.g. function, gradient and Hessian) evaluations 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
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) 2
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_vars Specifies the strategy for scaling variables 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

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
gradopt Specifies how to compute the gradients of the objective and constraint functions 1
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
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-15
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 The optimization process will terminate if the relative change in the feasibility error is less than infeastol for infeastol_iters 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 The optimization process will terminate if the relative change in all components of the solution point estimate is less than xtol for xtol_iters 1e-12
xtol_iters The optimization process will terminate if the relative change in the solution estimate is less than xtol for xtol_iters consecutive iterations 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_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-06

Barrier options

Option Description Default
bar_conic_enable Enable special treatments for conic constraints when using the Interior/Direct algorithm (has no affect when using the Interior/CG algorithm) -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 Specifies the tolerance in equation 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

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 absolute 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_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 Specifies the maximum number of iterations to allow for MIP heuristic, if one is enabled 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 Specifies whether or not to add constraints to the MIP derived from logical implications 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_maxsolves Specifies the maximum number of subproblem solves allowed (0 means no limit) 0
mip_method Specifies which MIP method to use 0
mip_mir Specifies rules for adding mixed-integer rounding 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 Specify the number of threads to use for MIP branch-and-bound (when mip_method = 1) 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

Multi-algorithm options

Option Description Default
ma_outsub Enable writing algorithm output to files for the multi-algorithm (alg=5) procedure 0
ma_sub_maxtime Specifies, in seconds, the maximum allowable real time for multi-algorithm ("MA") subproblems (alg=5) 1e+08
ma_terminate Define the termination condition for the multi-algorithm (alg=5) procedure 1

Multi-start options

Option Description Default
ms_enable Indicates whether Knitro will solve from multiple start points 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 take when determining new start points 1000
ms_maxsolves Specifies how many start points to try in multi-start 0
ms_numthreads Specify the number of threads to use for multi-start (when ms_enable = 1) 0
ms_num_to_save Specifies the number of distinct feasible points to save in a file named knitro_mspoints 0
ms_outsub Enable writing algorithm output to files for the parallel multi-start procedure 0
ms_savetol Specifies the tolerance for deciding if two feasible points are distinct 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 each variable can take when determining new start points 1e+20
ms_sub_maxtime Specifies, in seconds, the maximum allowable real time for multi-start subproblems (i.e. local solves from a given initial point) 1e+08
ms_terminate Specifies the condition for terminating multi-start 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 Specify the number of threads to use for operations in the conic algorithm (when bar_conic_enable = 1) 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 generates a file knitro_solve 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

Other 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

Detailed Descriptions of Knitro Options

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

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

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

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

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 when using the Interior/Direct algorithm (has no affect 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

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

Specifies whether special emphasis is placed on getting and staying feasible in the interior-point algorithms. Note 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 \leq c(x) \leq 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 honor inequalities
2 (get) Emphasize first getting feasible before optimizing
3 (get_stay) Implement both options 1 and 2 above

bar_feasmodetol (real): Specifies the tolerance in equation that determines whether Knitro will force subsequent iterates to remain feasible

Specifies the tolerance in equation 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

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

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

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) Initial point strategy 1 (mainly for convex problems)
2 (nearbnd) Initial point strategy staying closer to bounds
3 (central) More central initial point strategy

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

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) Automatically determine
0 (full) Full augmented system
1 (slacks) Eliminate slacks
2 (bounds) Also eliminate bounds
3 (ineqs) Also eliminate 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

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) Automatically determine
1 (lowmem) Use one storage location for multiple systems
2 (normal) Store systems separately

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

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

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

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

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

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

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

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 single penalty parameter approach
2 (flex) Use more tolerant flexible strategy

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

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

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

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

Indicates whether or not the barrier algorithms will allow switching from an optimality phase to a pure feasibility phase. This option has no effect on the Active Set algorithm.

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

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

Default: 1 or 4 (platform dependent)

value meaning
-1 (auto) Automatically determine based on platform
0 (knitro) Use Knitro version of netlib functions
1 (intel) Use Intel MKL functions
2 (dynamic) Use dynamic library of functions
3 (blis) Use BLIS functions
4 (apple) Use Apple Accelerate functions

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

Specifies a dynamic library name that contains object code for BLAS/LAPACK functions. The library must implement all the functions declared in the file include/blas_lapack.h.

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

Range: {0, ..., ∞}

Default: 0

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

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

conic_numthreads (integer): Specify the number of threads to use for operations in the conic algorithm (when bar_conic_enable = 1)

Specify the number of threads to use for operations in the conic algorithm (when bar_conic_enable = 1). 0 Let Knitro choose the number of threads (currently sets conic_numthreads based on numthreads). n>0 Use n threads for the conic solver.

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

Default: 0

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

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. Currently this option is only active for the Interior/Direct algorithm, but may be applied to other algorithms in the future.

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 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 , 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)

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

eval_cost (integer): Use this option to tell Knitro the relative cost of performing callback (e.g. function, gradient and Hessian) evaluations

Use this option to tell Knitro the relative cost of performing callback (e.g. function, gradient and Hessian) evaluations. Knitro will use this informaton 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

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

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.

Range: [-1, ∞]

Default: -1

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

Synonym: feastolabs

Specifies the final absolute stopping tolerance for the feasibility error. Smaller values of feastol_abs result in a higher degree of accuracy in the solution with respect to feasibility.

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 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

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 affect 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

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 termination
1 (errest) Terminate on gradient error estimates

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

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-15

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

gradopt (integer): Specifies how to compute the gradients of the objective and constraint functions

Default: 1

value meaning
1 (exact) User supplies exact first derivatives
2 (forward) Gradients computed by internal forward finite differences
3 (central) Gradients computed by internal central finite differences
4 (user_forward) Gradients computed by user-provided forward finite differences
5 (user_central) Gradients computed by user-provided central finite differences

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

Default: 0

value meaning
0 (auto) Determined automatically by Knitro
1 (exact) User supplies 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) User supplies exact Hessian-vector products
6 (lbfgs) Knitro computes a limited-memory quasi-Newton BFGS Hessian

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

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.

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

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): 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

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

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

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

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

Default: 0

value meaning
0 (auto) Let Knitro choose the solver
1 (internal) Use internal solver provided with Knitro
2 (hybrid) Use a mixture of linear solvers depending on the linear systems
3 (qr) Use dense QR solver always (only for small problems)
4 (ma27) Use sparse HSL solver ma27 always
5 (ma57) Use sparse HSL solver ma57 always
6 (mklpardiso) Use sparse Intel MKL Pardiso solver always
7 (ma97) Use parallel, deterministic HSL ma97 solver
8 (ma86) Use parallel, non-deterministic HSL ma86 solver
9 (apple) Use parallel, non-deterministic Apple Sparse Solver

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

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

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

Range: {0, ..., ∞}

Default: 0

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

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.

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

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

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

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)

Indicates which algorithm to use to solve linear problems (LPs). See Algorithms.

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

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

Range: {0, ..., ∞}

Default: GAMS iterlim

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

Synonym: reslim

Range: [0, ∞]

Default: GAMS reslim

ma_outsub (integer): Enable writing algorithm output to files for the multi-algorithm (alg=5) procedure

Default: 0

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

ma_sub_maxtime (real): Specifies, in seconds, the maximum allowable real time for multi-algorithm ("MA") subproblems (alg=5)

Range: [0, ∞]

Default: 1e+08

ma_terminate (integer): Define the termination condition for the multi-algorithm (alg=5) procedure

Default: 1

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

mip_branchrule (integer): Specifies which branching rule to use for MIP branch and bound 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

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

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 absolute improvement cutoff value for MIP

This value specifies the absolute 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

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. Setting this option to -1 will use an automatic setting and setting the value to 0 will disable all diving heuristics. Otherwise, set this parameter value to the sum of the values for the individual diving heuristics you wish to enable. For example, to enable only the "fractional" and "linesearch" diving heuristics, you would set this option value to 9 (summing 1 for fractional and 8 for linesearch).

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

Default: -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_lns (integer): Specifies whether or not to enable the MIP large neighborhood search (LNS) heuristics

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): Specifies the maximum number of iterations to allow for MIP heuristic, if one is enabled

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): Specifies whether or not to add constraints to the MIP derived from logical implications

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_maxsolves (integer): Specifies the maximum number of subproblem solves allowed (0 means no limit)

Range: {0, ..., ∞}

Default: 0

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 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 (perhaps in parallel)

mip_numthreads (integer): Specify the number of threads to use for MIP branch-and-bound (when mip_method = 1)

Specify the number of threads to use for MIP branch-and-bound (when mip_method = 1). 0 Let Knitro choose the number of threads. n>0 Use n threads for the MIP branch-and-bound.

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 (perhaps in parallel)

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 lesser-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

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): Indicates whether Knitro will solve from multiple start points 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 take when determining new start points

Specifies the maximum range that an unbounded variable can take when determining new start points. If a variable is unbounded in one or both directions, then new start point values are restricted by the option. If \(x_i\) is such a variable, then all initial values satisfy \(\max \{ b^L_i, x_i^0 - {\tt ms\_maxbndrange}/2 \} \leq x_i \leq \min \{ b^U_i, x_i^0 + {\tt ms\_maxbndrange}/2 \},\) where \(x_i^0\) is the initial value of \(x_i\) provided by the user, and \(b^L_i\) and \(b^U_i\) are the variable bounds (possibly infinite) on \(x_i\) . This option has no effect unless ms_enable = yes.

Range: [0, ∞]

Default: 1000

ms_maxsolves (integer): Specifies how many start points to try in multi-start

Specifies how many start points to try in multi-start. This option has no effect unless ms_enable = yes.

Range: {0, ..., ∞}

Default: 0

ms_numthreads (integer): Specify the number of threads to use for multi-start (when ms_enable = 1)

Specify the number of threads to use for multi-start (when ms_enable = 1). 0 Let Knitro choose the number of threads (currently sets ms_numthreads based on numthreads). n>0 Use n threads for the multi-start (solve n problems in parallel).

Range: {0, ..., ∞}

Default: 0

ms_num_to_save (integer): Specifies the number of distinct feasible points to save in a file named knitro_mspoints

Specifies the number of distinct feasible points to save in a file named knitro_mspoints.log. Each point results from a Knitro solve from a different starting point, and must satisfy the absolute and relative feasibility tolerances. The file stores points in order from best objective to worst. Points are distinct if they differ in objective value or some component by the value of ms_savetol using a relative tolerance test. This option has no effect unless ms_enable = yes.

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 if two feasible points are distinct

Specifies the tolerance for deciding if two feasible points are distinct. Points are distinct if they differ in objective value or some component by the value of ms_savetol using a relative tolerance test. A large value can cause the saved feasible points in the file knitro_mspoints.log to cluster around more widely separated points. This option has no effect unless ms_enable = yes. and ms_num_to_save is positive.

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 each variable can take when determining new start points

Specifies the maximum range that each variable can take when determining new start points. If a variable has upper and lower bounds and the difference between them is less than or equal to ms_startptrange, then new start point values for the variable can be any number between its upper and lower bounds. If the variable is unbounded in one or both directions, or the difference between bounds is greater than ms_startptrange, then new start point values are restricted by the option. If \(x_i\) is such a variable, then all initial values satisfy \(\max \{ b^L_i, x_i^0 - \tau \} \leq x_i \leq \min \{ b^U_i, x_i^0 + \tau \}, \tau = \min \{ {\tt ms\_startptrange}/2, {\tt ms\_maxbndrange}/2 \}\) where \(x_i^0\) is the initial value of \(x_i\) provided by the user, and \(b^L_i\) and \(b^U_i\) are the variable bounds (possibly infinite) on \(x_i\) . This option has no effect unless ms_enable = yes.

Range: [0, ∞]

Default: 1e+20

ms_sub_maxtime (real): Specifies, in seconds, the maximum allowable real time for multi-start subproblems (i.e. local solves from a given initial point)

Specifies, in seconds, the maximum allowable real time for multi-start subproblems (i.e. 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 the condition for terminating multi-start

Specifies the condition for terminating multi-start. This option has no effect unless ms_enable = yes.

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

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 trigger termination in more solves.

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

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

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. For the NLPBB algorithm, the new incumbent includes values of x.

Default: 0

value meaning
0 (none) No additional action
1 (saveone) Save the latest new point to file knitro_newpoint.log
2 (saveall) Append the latest new point to file knitro_newpoint.log

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

Indicates which algorithm to use to solve nonlinear problems (e.g. NLPs, QPs, QCQPs). See Algorithms.

Default: 2

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

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

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.

Range: [-1, ∞]

Default: -1

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

Synonym: opttolabs

Specifies the final absolute stopping tolerance for the KKT (optimality) error. Smaller values of opttol_abs result in a higher degree of accuracy in the solution with respect to optimality.

Range: [-1, ∞]

Default: -1

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

Specifies whether output should be started in a new file, or appended to existing files. The option affects knitro.log. It does not affect knitro_newpoint.log, which is controlled by option newpoint.

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

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) Nothing
1 (summary) Only final summary information
2 (iter_10) Information every 10 iterations is printed
3 (iter) Information at each iteration is printed
4 (iter_verbose) More verbose information at each iteration is printed
5 (iter_x) In addition, values of solution vector (x) are printed
6 (all) In addition, constraints (c) and multipliers (lambda)

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

Default: 0

value meaning
0 (screen) Directed to stdout
1 (file) Directed to a file (default name knitro.log)
2 (both) Both stdout and file (default name knitro.log)

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 generates a file knitro_solve

Controls whether or not to generates 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_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) Automatically determined (may depend on the algorithm).
0 (none) Do not tighten variable bounds (unless it removes a constraint).
1 (varbnd) Enable tightening variable bounds always.
2 (coef) Enable tightening coefficients in linear constraints.
3 (all) Enable tightening variable bounds and coefficients.

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

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

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-06

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

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

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_vars (integer): Specifies the strategy for scaling variables

Specifies the strategy for scaling 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: 0

value meaning
0 (none) Do not apply any variable scaling
1 (bnds) Apply variable scaling based on their bound values

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

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

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 enounter 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

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.

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)

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

xtol (real): The optimization process will terminate if the relative change in all components of the solution point estimate is less than xtol for xtol_iters

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): The optimization process will terminate if the relative change in the solution estimate is less than xtol for xtol_iters consecutive iterations

The optimization process will terminate if the relative change in the solution 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

Knitro Termination Test and Optimality

Continuous problems

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

\[ \tag{3} \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.

In Knitro we define the feasibility error (FeasErr) at a point \(x^k\) to be 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 (3)

\[ \mbox{OptErr} = \max_{i=1 \dots m, \ j=1 \dots n} (\|\nabla_x {\cal L}(x^k,\lambda^k) \|_\infty, \lambda_i^c \min [(c_i(x)-c_i^L),(c_i^U-c_i(x))], \lambda_j^b \min [(x_j-b_j^L),(b_j^U-x_j)]). \]

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 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 unconstraints 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{equation} \tag{4} \mbox{FeasErr} \le \max (\tau_1*\mbox{feastol},\mbox{feastol_abs}) \end{equation}

\begin{equation}\tag{5} \mbox{OptErr} \le \max (\tau_2*\mbox{opttol}, \mbox{opttol_abs}) \end{equation}

where feastol, opttol, feastol_abs and opttol_abs are user-defined options (see section Usage ).

This stopping test is designed to give the user much flexibility in deciding when the solution returned by Knitro is accurate enough. One can use a purely scaled stopping test (which is the recommended and default option) by setting feastol_abs and opttol_abs equal to 0.0e0. Likewise, an absolute stopping test can be enforced by setting feastol and opttol equal to 0.0e0.

Unbounded problems

Since by default Knitro uses a relative/scaled stopping test it is possible for the optimality conditions to be satisfied for an unbounded problem. For example, if \(\tau_2 \to \infty\) while the optimality error OptErr stays bounded, condition (5) will eventually be satisfied for some opttol>0. If you suspect that your problem may be unbounded, using an absolute stopping test will allow Knitro to detect this.

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 lower bound on the optimal objective value for problem (1) (upper bound if maximizing). If a feasible point is found for problem (1) that satisfies the discrete restrictions on the variables, then this provides an upper bound on the optimal objective value of problem (1) (lower bound if maximizing). We will refer to these feasible points as incumbent points and denote the objective value at an incumbent point 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 of problem (1) is verified when the lower bound and upper bound are equal.

Knitro declares optimality for a discrete problem when the gap between the best (i.e., largest) lower bound \(f(x_R)\) and the best (i.e., smallest) upper 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

\[ f(x_I) - f(x_R) \leq mip\_integral\_gap\_abs \]

or

\[ f(x_I) - f(x_R) \leq mip\_integral\_gap\_rel \cdot \max (1,|f(x_I)|), \]

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)\) 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 largely 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.

Knitro Output

If outlev=0 then all printing of output is suppressed. The description below assumes the default output level (outlev=2) except where indicated:

Nondefault Options:

This output lists all user options (see section Usage) which are different from their default values. If nothing is listed in this section then all user options are set to their default values.

Problem Characteristics:

The output begins with a description of the problem characteristics.

Iteration Information - Continuous Problems:

An iteration, in the context of Knitro, is defined as a step which 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 Gives the value of the objective function at the current iterate.
  • FeasErr Gives a measure of the feasibility violation at the current iterate.
  • OptErr Gives 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).
  • CG its The number of Projected Conjugate Gradient (CG) iterations required to compute the step.

If outlev=2, information is printed every 10 major iterations. If outlev=3 information is printed at each major iteration. If outlev>4 addition information is included in the log.

Iteration Information - Discrete Problems:

By default, the GAMS/Knitro link prints a log line at every 10'th node. This frequency can be changed via the mip_outinterval option. To turn off the node log completely, set the mip_outlevel option to 0. The columns of the iteration log for discrete models are as follows:

  • Node The node number. If an integer feasible point was found at a given node, it is marked with a *
  • Left The current number of active nodes left in the branch and bound tree.
  • Iinf The current number of active nodes left in the branch and bound tree.
  • Objective Gives the value of the objective function at the solution of the relaxed subproblem solved at the current node. If the subproblem was infeasible or failed, this is indicated. Additional symbols may be printed at some nodes if the node was pruned (pr), integer feasible (f), or an integer feasible point was found through rounding (r).
  • Best relaxatn The value of the current best relaxation (lower bound on the solution if minimizing).
  • Best incumbent The value of the current best integer feasible point (upper bound on the solution if minimizing).

Termination Message: At the end of the run a termination message is printed indicating whether or not the optimal solution was found and if not, why the solver terminated. Below is a list of some possible termination messages.

  • EXIT: Locally optimal solution found.

    Knitro found a locally optimal point which satisfies the stopping criterion (see section Knitro Termination Test and Optimality) 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: Iteration limit reached.

    The iteration limit was reached before being able to satisfy the required stopping criteria.

  • 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. If this occurs for a variety of initial points, it is likely the problem is infeasible.

  • EXIT: Problem appears to be unbounded.

    The objective function appears to be decreasing without bound, while satisfying the constraints.

  • EXIT: Current point cannot be improved.

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

  • EXIT: Current point cannot be improved. Point appears to be optimal, but desired accuracy 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: Time limit reached.

    The time limit was reached before being able to satisfy the required stopping criteria.

  • EXIT: Evaluation error.

    This termination value indicates that an evaluation error occurred (e.g., divide by 0, taking the square root of a negative number), preventing the optimization from continuing.

  • EXIT: Not enough memory available to solve problem.

    This termination value indicates that there was not enough memory available to solve the problem.

Final Statistics:

Following the termination message some final statistics on the run are printed. Both relative and absolute error values are printed.

Solution Vector/Constraints:

If outlev=5, the values of the solution vector are printed after the final statistics. If outlev=6, the final constraint values are also printed before the solution vector and the values of the Lagrange multipliers (or dual variables) are printed next to their corresponding constraint or bound.

Algorithm Options

Automatic

By default, Knitro will automatically try to choose the best optimizer for the given problem based on the problem characteristics.

Interior/Direct

If the Hessian of the Lagrangian is ill-conditioned or the problem does not have a large-dense Hessian, it may be advisable to compute a step by directly factoring the KKT (primal-dual) matrix rather than using an iterative approach to solve this system. Knitro offers the Interior/Direct optimizer which allows the algorithm to take direct steps by setting algorithm=1. This option will try to take a direct step at each iteration and will only fall back on the iterative step if the direct step is suspected to be of poor quality, or if negative curvature is detected.

Using the Interior/Direct optimizer 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). We encourage the user to try both options as it is difficult to predict in advance which one will be more effective on a given problem. In each case, also experiment with the bar_murule option, as it is difficult to predict which update rule will work best.

NOTE: Since the Interior/Direct algorithm in Knitro requires the explicit storage of a Hessian matrix, this version can only be used with Hessian options, hessopt=1, 2, 3 or 6. It may not be used with Hessian options, hessopt=4 or 5, which only provide Hessian-vector products. Both the Interior/Direct and Interior/CG methods can be used with the bar_feasible option.

Interior/CG

Since Knitro was designed with the idea of solving large problems, the Interior/CG optimizer in Knitro offers an iterative Conjugate Gradient approach to compute the step at each iteration. This approach has proven to be efficient in most cases and allows Knitro to handle problems with large, dense Hessians, since it does not require factorization of the Hessian matrix. The Interior/CG algorithm can be chosen by setting algorithm=2. It can use any of the Hessian options as well as the bar_feasible option.

Active Set

Knitro includes an active-set Sequential Linear-Quadratic Programing (SLQP) optimizer. This optimizer is particular advantageous when "warm starting" (i.e., when the user can provide a good initial solution estimate, for example, when solving a sequence of closely related problems). This algorithm is also the preferred algorithm for detecting infeasible problems quickly. The Active Set algorithm can be chosen by setting algorithm=3. It can use any of the Hessian options.

Other Knitro special features

This section describes in more detail some of the more important special features of Knitro and provides some guidance on how use them so that Knitro runs most efficiently for the problem at hand.

Second derivative options

The default version of Knitro assumes that exact second derivatives of the objective function and constraint functions can be computed. If this is possible and the cost of computing the second derivatives is not overly expensive, it is highly recommended to use exact second derivatives. However, Knitro also offers other options which are described in detail below.

(Dense) Quasi-Newton BFGS
The quasi-Newton BFGS option uses gradient information to compute a symmetric, positive-definite approximation to the Hessian matrix. Typically this method requires more iterations to converge than the exact Hessian version. However, since it is only computing gradients rather than Hessians, this approach may be more efficient in many cases. This option stores a dense quasi-Newton Hessian approximation so it is only recommended for small to medium problems ( \(n < 1000\)). The quasi-Newton BFGS option can be chosen by setting options value hessopt=2.

(Dense) Quasi-Newton SR1
As with the BFGS approach, the quasi-Newton SR1 approach builds an approximate Hessian using gradient information. However, unlike the BFGS approximation, the SR1 Hessian approximation is not restricted to be positive-definite. Therefore the quasi-Newton SR1 approximation may be a better approach, compared to the BFGS method, if there is a lot of negative curvature in the problem since it may be able to maintain a better approximation to the true Hessian in this case. The quasi-Newton SR1 approximation maintains a dense Hessian approximation and so is only recommended for small to medium problems ( \(n < 1000\)). The quasi-Newton SR1 option can be chosen by setting options value hessopt=3.

Finite-difference Hessian-vector product option
If the problem is large and gradient evaluations are not the dominate cost, then Knitro can internally compute Hessian-vector products using finite-differences. Each Hessian-vector product in this case requires one additional gradient evaluation. This option can be chosen by setting options value hessopt=4. This option is generally only recommended if the exact gradients are provided.

NOTE: This option may not be used when algorithm=1.

Exact Hessian-vector products
In some cases the problem which the user wishes to solve may have a large, dense Hessian which makes it impractical to store or work with the Hessian directly. The performance of this option should be nearly identical to the exact Hessian option but requires much less storage. This option can be chosen by setting options value hessopt=5.

NOTE: This option may not be used when algorithm=1.

Limited-memory Quasi-Newton BFGS
The limited-memory quasi-Newton BFGS option is similar to the dense quasi-Newton BFGS option described above. However, it is better suited for large-scale problems since, instead of storing a dense Hessian approximation, it only stores a limited number of gradient vectors used to approximate the Hessian. In general it requires more iterations to converge than the dense quasi-Newton BFGS approach but will be much more efficient on large-scale problems. This option can be chosen by setting options value hessopt=6.

Feasible version

Knitro offers the user the option of forcing intermediate iterates to stay feasible with respect to the inequality constraints (it does not enforce feasibility with respect to the equality constraints however). Given an initial point which is sufficiently feasible with respect to all inequality constraints and selecting bar_feasible = 1, forces all the 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{21} cl + tol \le c(x) \le cu - tol \end{equation}

for all inequality constraints (i.e., for \(cl \ne cu\)). The tolerance \(tol>0\) by which an iterate must be strictly feasible for entering the feasible mode is determined by the parameter bar_feasmodetol which is 1.0e-4 by default. If the initial point does not satisfy (21) then the default infeasible version of Knitro will run until it obtains a point which is sufficiently feasible with respect to all the inequality constraints. At this point it will switch to the feasible version of Knitro and all subsequent iterates will be forced to satisfy the inequality constraints.

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

NOTE: This option may only be used when algorithm=2.

Honor Bounds

By default Knitro does not enforce that the simple bounds on the variables (1c) are satisfied throughout the optimization process. Rather, satisfaction of these bounds is only enforced at the solution. In some applications, however, the user may want to enforce that the initial point and all intermediate iterates satisfy the bounds \(bl \le x \leq bu\). This can be enforced by setting honorbnds=1.

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, then Knitro will attempt 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, then it will restore the interior-point solution estimate and terminate. By default, Knitro will then print a message indicating that it was unable to improve the solution within the iterations allowed. In this case, you may want to increase the value of bar_maxcrossit and try again. If Knitro determines that the crossover procedure will not succeed, no matter how many iterations are tried, then a message of the form Crossover mode unable to improve solution. will be printed.

The extra cost of performing crossover is problem dependent. In 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.

Tuner

The Knitro-Tuner can help you identify some non-default options settings that may improve performance on a particular model or set of models. The Knitro tuner is enabled with the tuner option and controlled via the tuner_ family of options. If you are unsure about what Knitro options should be tuned to try to improve performance, you can run the default Knitro-Tuner by simply setting the option tuner=1 when solving with Knitro. This will cause Knitro to run your model with a variety of automatically determined option settings, and report some statistics at the end. Any Knitro options that have been set in the usual way will remain fixed throughout the tuning procedure.

If you have some ideas about which Knitro options you want to tune, you can tell Knitro which options you want it to tune, as well as specify the values for particular options that you want Knitro to explore. This can be done by specifying a Tuner options file. A Tuner options file is a simple text file that is similar to a standard Knitro options file, with some important differences:

  • You can define multiple values (separated by spaces) for each option. This tells Knitro the values you want it to explore.
  • You can specify an option name without any values. This will tell Knitro to explore all possible option values for that option. This only works for options that have a finite set of possible option value settings.
  • A Tuner options file is loaded via the tuner_optionsfile option.

All possible combinations of options/values specified in a Tuner options file will be explored by Knitro, while any Knitro options that have been set in the usual way will remain fixed throughout the tuning procedure.

Solving Systems of Nonlinear Equations

Knitro is quite effective at solving systems of nonlinear equations. To solve a square system of nonlinear equations using Knitro one should specify the nonlinear equations as equality constraints (i.e., constraints with \(cl = cu\)), and specify the objective function (1a) as zero (i.e., \(f(x)=0\)).

Solving Least Squares Problems

There are two ways of using Knitro for solving problems in which the objective function is a sum of squares of the form

\[ f(x) = \textstyle\frac{1}{2} \sum_{j=1}^q r_j(x)^2. \]

If the value of the objective function at the solution is not close to zero (the large residual case), the least squares structure of \(f\) can be ignored and the problem can be solved as any other optimization problem. Any of the Knitro options can be used.

On the other hand, if the optimal objective function value is expected to be small (small residual case) then Knitro can implement the Gauss-Newton or Levenberg-Marquardt methods which only require first derivatives of the residual functions, \(r_j(x)\), and yet converge rapidly. To do so, the user need only define the Hessian of \(f\) to be

\[ \nabla^2 f(x) = J(x)^TJ(x), \]

where

\[ J(x) = \left[ \frac{\partial r_j}{\partial x_i} \right]_{\begin{array}{c} j=1,2,\dots,q \\ i=1,2,\dots,n \end{array}}. \]

The actual Hessian is given by

\[ \nabla^2 f(x) = J(x)^T J(x) + \sum_{j=1}^q r_j(x) \nabla^2 r_j(x); \]

the Gauss-Newton and Levenberg-Marquardt approaches consist of ignoring the last term in the Hessian.

Knitro will behave like a Gauss-Newton method by setting algorithm=1, and will be very similar to the classical Levenberg-Marquardt method when algorithm=2. For a discussion of these methods see, for example, [142] .