Knitro options
Knitro has a great number and variety of user option settings and although it tries to choose the best settings by default, often significant performance improvements can be realized by choosing some non-default option settings.
For information on how to set options in various interfaces, see the Setting options section of the User Guide.
Index
User options are defined in the knitro.h and summarized in the following index. To see
a more detailed description of an individual option and its possible values click on the option name.
The importance of each option is related to its category (General, Derivatives, etc…), 1 being the most
important parameters.
General options
Option name |
Importance |
Purpose |
|---|---|---|
2 |
Specifies the BLAS/LAPACK function library to use for basic vector and matrix computations. |
|
3 |
Specifies a dynamic library name that contains object code for BLAS/LAPACK functions. |
|
3 |
Specifies max limits on the magnitude of constraint and variable bounds. |
|
2 |
Determines the maximum allowable number of inner conjugate gradient (CG) iterations per Knitro minor iteration. |
|
3 |
Specifies the amount of nonzero elements per column of the Hessian of the Lagrangian which are retained when computing the incomplete Cholesky preconditioner. |
|
2 |
Specifies whether an incomplete Cholesky preconditioner is applied during CG iterations in barrier algorithms. |
|
3 |
Specifies the relative stopping tolerance used for the conjugate gradient (CG) subproblem solves. |
|
1 |
Declare the problem as convex by setting KN_CONVEX_YES or non-convex by setting KN_CONVEX_NO. |
|
2 |
This option can be used to specify the target instruction set architecture for the machine on which Knitro is running. |
|
2 |
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). |
|
3 |
Specifies the initial trust region radius scaling factor used to determine the initial trust region size. |
|
1 |
This option specifies whether to always enforce deterministic behavior for Knitro. |
|
1 |
Use this option to tell Knitro the relative cost of performing a callback. |
|
3 |
Use this option to tell Knitro that you are providing the first derivatives in the same callback routine used for your function evaluations. |
|
1 |
Indicates whether or not to enforce satisfaction of simple variable bounds throughout the optimization. |
|
3 |
Specifies the initial penalty parameter used in the Knitro merit functions. |
|
1 |
Specifies the initial point strategy used for the continuous algorithms. |
|
3 |
Specifies a file from which to read the initial point used for the Knitro algorithms. |
|
2 |
Indicates which linesearch strategy to use for the Interior/Direct or SQP algorithm to search for a new acceptable iterate. |
|
3 |
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. |
|
1 |
Indicates which linear solver to use to solve linear systems arising in Knitro algorithms. |
|
3 |
Indicates the maximum allowable number of iterative refinement steps applied when a linear system is solved inside Knitro. |
|
3 |
Controls the node amalgamation setting for the MA57, MA86 and MA97 linear solvers. |
|
3 |
Indicates whether to use Intel MKL PARDISO out-of-core solve of linear systems when linsolver = mklpardiso. |
|
2 |
Sets the ordering method used for the linear system solver. |
|
3 |
Specifies the initial pivot threshold used in factorization routines. |
|
2 |
Enables scaling for the linear system solver. |
|
1 |
Indicates which algorithm to use to solve linear problems (LPs). |
|
2 |
This option enforces a maximum step size limit at every iteration of the continuous NLP algorithms in Knitro (as well as the barrier LP algorithm). |
|
3 |
This option specifies the maximum number of iterations where the maxstepsize restriction is enforced (if 0 then no iteration limit is imposed for this). |
|
2 |
Specifies the initialization strategy used for non-convex QPs and QCQPs. |
|
1 |
Indicates which algorithm to use to solve nonlinear problems (e.g. NLPs, QPs, QCQPs) |
|
3 |
Specifies the extreme limits of the objective function for purposes of determining unboundedness. |
|
2 |
Specifies whether or not to enable automatic restarts in Knitro. |
|
3 |
When restarts are enabled, this option can be used to specify a maximum number of iterations before enforcing a restart. |
|
1 |
Specifies whether to perform problem scaling of the objective function, constraint functions, or possibly variables. |
|
2 |
Strategies for problem scaling. Multiple strategies can be selected at once using multiple bits. |
|
3 |
Specifies whether or not to try second order corrections (SOC). |
|
2 |
This option specifies the solution returned by Knitro. |
|
2 |
Specifies whether or not to invoke a warm-start strategy. |
Derivatives options
Option name |
Importance |
Purpose |
|---|---|---|
2 |
Specify the initial scaling to use for the BFGS or L-BFGS Hessian approximation. |
|
1 |
Determine whether or not to perform a derivative check |
|
3 |
Determine whether to always terminate after the derivative check or only when the derivative checker detects a possible error. |
|
3 |
Specifies the relative tolerance used for detecting derivative errors, when the Knitro derivative checker is enabled. |
|
3 |
Specifies whether to use forward or central finite differencing for the derivative checker when it is enabled. |
|
2 |
This option can be used to enable an estimate of the noise in the model when using finite-difference gradients. |
|
2 |
Specifies the relative stepsize used for finite-difference gradients during the optimization. |
|
1 |
Specifies how to compute the gradients of the objective and constraint functions. |
|
3 |
Determines whether or not to allow Knitro to request Hessian (or Hessian-vector product) evaluations without the objective component included. |
|
1 |
Specifies how to compute the (approximate) Hessian of the Lagrangian. |
|
2 |
Specifies the number of limited memory pairs stored when approximating the Hessian using the limited-memory quasi-Newton BFGS option. |
Termination options
Option name |
Importance |
Purpose |
|---|---|---|
2 |
This option specifies the feasibility error measure used at the algorithm level and for termination. |
|
1 |
Specifies the final relative stopping tolerance for the feasibility error. |
|
1 |
Specifies the final absolute stopping tolerance for the feasibility error. |
|
2 |
This option specifies the termination criteria when using finite-difference gradients. |
|
2 |
Used to implement a custom stopping condition based on the objective function value. |
|
2 |
The optimization process will terminate if the relative change in the objective function is less than ftol for ftol_iters consecutive feasible iterations. |
|
3 |
The optimization process will terminate if the relative change in the objective function is less than ftol for ftol_iters consecutive feasible iterations. |
|
2 |
Specifies the (relative) tolerance used for declaring infeasibility of a model. |
|
3 |
Controls the termination for consecutive infeasible iterations. |
|
2 |
Specifies the maximum number of function evaluations before termination. |
|
1 |
Specifies the maximum number of iterations before termination. |
|
1 |
Specifies, in seconds, the maximum allowable real time before termination. |
|
1 |
Specifies the final relative stopping tolerance for the KKT (optimality) error. |
|
1 |
Specifies the final absolute stopping tolerance for the KKT (optimality) error. |
|
1 |
Tolerance for convergence criterion based on relative change between successive solution points. |
|
3 |
Number of iterations for convergence criterion based on relative change between successive solution points. |
Presolve options
Option name |
Importance |
Purpose |
|---|---|---|
1 |
Determine whether or not to use the Knitro presolver to try to simplify the model by removing variables or constraints. |
|
2 |
Control whether the Knitro presolver can shift a user-supplied initial point. |
|
2 |
Set the level of presolve operations to enable through the Knitro presolver. |
|
2 |
Set a maximum limit on the number of passes through the Knitro presolve operations. |
|
3 |
Determines the tolerance used by the Knitro presolver to remove variables and constraints from the model. |
|
2 |
Tolerance for rounding to zero linear coefficients in presolve. Higher values mean that more reductions will be applied. Zero value is not recommended as it means no rounding is done, which can lead to numerical instability. |
|
2 |
Determine whether or not to enable the Knitro presolve operations that attempt to merge cliques to strengthen the formulation. |
|
3 |
Transforms quadratic constraints into MPEC constraints. |
|
2 |
Determine whether or not to enable the Knitro presolve operations that analyze deductions made by fixing integer variables. |
|
2 |
Determine whether or not to enable the Knitro presolve operation to detect and remove redundant constraints. |
|
2 |
Determine whether or not to enable the Knitro presolve operation to substitute out variables when possible. |
|
3 |
Tolerance for applying a substitution. |
|
2 |
Determine whether or not to enable the Knitro presolve operation to tighten variable bounds or coefficients. |
Barrier options
Option name |
Importance |
Purpose |
|---|---|---|
1 |
Enable special treatments for conic constraints. |
|
1 |
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 |
Specifies whether special emphasis is placed on getting and staying feasible in the interior-point algorithms. |
|
3 |
Tolerance used in the feasibility condition that determines whether Knitro will force subsequent iterates to remain feasible. |
|
2 |
Specifies the globalization strategy used in the interior-point algorithms. |
|
2 |
Specifies the initial value for the barrier parameter $mu$ used with the barrier algorithms. |
|
3 |
Specifies the initial value for the MPEC penalty parameter $pi$ used when solving problems with complementarity constraints using the barrier algorithms. |
|
2 |
Indicates initial point strategy for x, slacks and multipliers when using a barrier algorithm. |
|
2 |
Indicates which linear system form is used inside the Interior/Direct algorithm for computing primal-dual steps. |
|
2 |
Indicates how to store in memory the linear systems used inside the Interior/Direct algorithm for computing primal-dual steps. |
|
2 |
Specifies the maximum number of corrector steps allowed for primal-dual steps. |
|
3 |
Specifies the maximum number of crossover iterations before termination. |
|
3 |
Specifies the maximum allowable value for the barrier parameter $mu$ used with the barrier algorithms. |
|
3 |
Indicates the maximum number of refactorizations of the KKT system per iteration of the Interior/Direct algorithm before reverting to a CG step. |
|
3 |
Specifies whether or not to use a heuristic approach when solving MPEC models with the barrier algorithm. |
|
1 |
Indicates which strategy to use for modifying the barrier parameter $mu$ in the barrier algorithms. |
|
2 |
Indicates whether a penalty approach is applied to the constraints. |
|
3 |
Indicates which penalty parameter strategy to use for determining whether or not to accept a trial iterate. |
|
3 |
Specifies whether to try to refine the barrier solution for better precision. |
|
2 |
Indicates whether a relaxation approach is applied to the constraints. |
|
3 |
Specifies the amount by which the barrier slack variables are initially pushed inside the bounds. |
|
3 |
Indicates which objective function to use when the barrier algorithms switch to a pure feasibility phase. |
|
3 |
Indicates whether or not the barrier algorithms will allow switching from an optimality phase to a pure feasibility phase. |
|
3 |
Specifies whether to enable watchdog heuristic for barrier algorithms. |
Active-Set options
Option name |
Importance |
Purpose |
|---|---|---|
3 |
Indicates which algorithm to use to solve linear programming (LP) subproblems when using the Knitro Active Set or SQP algorithms. |
|
3 |
Specifies the feasibility tolerance used for linear programming subproblems solved when using the Active Set or SQP algorithms. |
|
1 |
Indicates whether to use a penalty formulation for linear programming subproblems in the Knitro Active Set or SQP algorithms. |
|
3 |
Indicates whether to apply a presolve for linear programming subproblems in the Knitro Active Set or SQP algorithms. |
|
1 |
Indicates which linear programming simplex solver the Knitro Active Set or SQP algorithms use when solving internal LP subproblems. |
|
2 |
Indicates whether to use a parametric approach when solving linear programming (LP) subproblems when using the Knitro Active Set or SQP algorithms. |
|
1 |
Indicates which algorithm to use to solve quadratic programming (QP) subproblems when using the Knitro Active Set or SQP algorithms. |
|
2 |
Indicates whether to use a penalty formulation for quadratic programming subproblems in the Knitro SQP algorithm. |
|
3 |
See option act_lpsolver. |
|
3 |
See option act_lpsolver. |
Augmented Lagrangian options
Option name |
Importance |
Purpose |
|---|---|---|
2 |
Specifies the initial penalty parameter value used in the Augmented Lagrangian (AL) algorithm. |
|
2 |
Specifies the maximum allowable penalty parameter value used in the Augmented Lagrangian (AL) algorithm. |
MIP options
Option name |
Importance |
Purpose |
|---|---|---|
1 |
Specifies which branching rule to use for MIP branch and bound procedure. |
|
2 |
Specifies rules for adding clique cuts. |
|
2 |
Specifies rules for adding flow cover cuts. |
|
2 |
Specifies rules for adding probing cuts. |
|
2 |
This value specifies a limit on the number of cuts added to a node subproblem. |
|
3 |
This value specifies the objective cutoff value for MIP. |
|
2 |
This value specifies the absolute improvement cutoff value for MIP. |
|
2 |
This value specifies the relative improvement cutoff value for MIP. |
|
2 |
Specifies when to apply the cutting plane procedure. |
|
2 |
Specifies debugging level for MIP solution. |
|
1 |
Specifies rules for adding Gomory mixed-integer cuts. |
|
3 |
Specifies whether or not to branch on generalized upper bounds (GUBs). |
|
1 |
Specifies whether or not to enable the MIP diving heuristic. |
|
1 |
Specifies whether or not to enable the MIP feasibility pump heuristic. |
|
2 |
Specifies whether or not to enable the MIP fix-and-propagate heuristic. |
|
2 |
Specifies whether or not to enable the MIP large neighborhood search (LNS) heuristics. |
|
1 |
Specifies whether or not to enable the MIP local search heuristic. |
|
2 |
Maximum number of iterations to allow for MIP heuristic. |
|
3 |
Specifies whether or not to enable the MIP MISQP heuristic. |
|
1 |
Specifies whether or not to enable the MIP MPEC heuristic. |
|
1 |
Specifies the level of effort applied for the MIP heuristic search used to try to find an initial integer feasible point. |
|
2 |
Specifies the condition for terminating the MIP heuristic. |
|
2 |
Whether to add logical implications deduced from branching decisions at a MIP node. |
|
3 |
Name for the file from which to read the MIP initial point. |
|
3 |
This value specifies the threshold for deciding whether or not a variable is determined to be an integer. |
|
2 |
Specifies how to handle integer variables. |
|
2 |
Specifies rules for adding MIP knapsack cuts. |
|
2 |
Specifies rules for adding lift and project cuts. |
|
2 |
Specifies the maximum number of nodes explored (0 means no limit). |
|
1 |
Specifies which MIP method to use. |
|
2 |
Specifies rules for adding mixed-integer rounding (MIR) cuts. |
|
3 |
Use to enable MIP multi-start at the branch-and-bound level. |
|
1 |
Specifies which algorithm to use for standard node LP subproblem solves in MIP (same options as lp_algorithm user option). |
|
1 |
Specifies which algorithm to use for standard node NLP subproblem solves in MIP (same options as nlp_algorithm user option). |
|
1 |
Number of threads to use for MIP solvers. |
|
1 |
The absolute optimality gap stop tolerance for MIP. |
|
1 |
The relative optimality gap stop tolerance for MIP. |
|
1 |
Specifies node printing interval for mip_outlevel when mip_outlevel > 0. |
|
1 |
Specifies how much MIP information to print. |
|
3 |
Specifies MIP subproblem solve debug output control. |
|
3 |
Specifies the method used to initialize pseudo-costs corresponding to variables that have not yet been branched on in the MIP method. |
|
2 |
Specifies whether integer variables are relaxable. |
|
2 |
Specifies whether to enable the MIP restart procedure. |
|
1 |
Specifies which algorithm to use for root node LP subproblem solves in MIP (same options as lp_algorithm user option). |
|
2 |
Specifies which algorithm to use for root node NLP solves in MIP (same options as nlp_algorithm user option). |
|
2 |
Specifies the MIP rounding rule to apply. |
|
2 |
Specifies the MIP node selection direction rule (for tiebreakers) for choosing the next node in the branch-and-bound tree. |
|
1 |
Specifies the MIP select rule for choosing the next node in the branch-and-bound tree. |
|
3 |
Specifies the maximum number of candidates to explore for MIP strong branching. |
|
3 |
Specifies the maximum number of tree levels on which to perform MIP strong branching. |
|
3 |
Specifies the maximum number of iterations to allow for MIP strong branching solves. |
|
3 |
Specifies the maximum allowable real time in seconds for MIP node subproblems. |
|
1 |
Specifies conditions for terminating the MIP algorithm. |
|
2 |
Specifies rules for adding zero-half cuts. |
Concurrent solver options
Option name |
Importance |
Purpose |
|---|---|---|
2 |
Specifies the LP algorithms to run concurrently when the concurrent solver is enabled on an LP. |
|
2 |
Specifies the maximum number of solves when using the concurrent solver (should be more than 1 and <= numthreads). |
|
2 |
Specifies the NLP algorithms to run concurrently when the concurrent solver is enabled on an NLP. |
|
3 |
Specifies the output logging options when the concurrent solver is enabled. |
|
1 |
Specifies whether or not to enable the concurrent solver. |
Multi-start options
Option name |
Importance |
Purpose |
|---|---|---|
1 |
Whether to enable multistart to find a better local minimum. |
|
3 |
The strategy for clustering initial points in multi-start. |
|
2 |
Specifies the maximum range that an unbounded variable can vary over when multistart computes new start points. |
|
1 |
How many Knitro solutions to compute if multistart is enabled. |
|
2 |
How many feasible multistart points to save in file knitro_mspoints.log. |
|
1 |
Number of threads to use in parallel multistart. |
|
2 |
Enable writing algorithm output to files for the parallel multi-start procedure. |
|
2 |
Specifies the tolerance for deciding two feasible points are the same. |
|
2 |
Seed value used to generate random initial points in multi-start; should be a non-negative integer. |
|
1 |
Specifies the maximum range that any variable can vary over when multistart computes new start points. |
|
3 |
Specifies, in seconds, the maximum allowable real time for multi-start subproblems. |
|
1 |
Specifies conditions for terminating the multistart procedure. |
|
1 |
The tolerance in (0,1] for the rule-based termination of multi-start. |
Parallelism options
Option name |
Importance |
Purpose |
|---|---|---|
2 |
Specify the number of threads to use for BLAS operations when blasoption = 1 |
|
1 |
Determines whether or not the user provided callback functions used for function and derivative evaluations can take place concurrently in parallel (for possibly different values of x). |
|
2 |
Number of threads to do conic operations in parallel. Choose any positive integer, or 0 = determine automatically based on numthreads |
|
2 |
Number of threads to use in finite-differencing. |
|
2 |
Specify the number of threads to use for linear system solve operations when linsolver = 6. |
|
1 |
Specify the number of threads to use for parallel computing features. |
Output options
Option name |
Importance |
Purpose |
|---|---|---|
2 |
Controls the level of debugging output. |
|
2 |
Specifies additional action to take after every iteration in a solve of a continuous problem, or after every new incumbent of the NLPBB algorithm. |
|
3 |
Controls whether or not to generate a file knitro_solve.csv containing solve information in comma separated format. |
|
3 |
Use to specify a custom csv filename when using out_csvinfo. |
|
2 |
Specifies whether to print diagnostic hints (e.g. about user option settings) after solving. |
|
2 |
Specifies whether output should be started in a new file, or appended to existing files. |
|
2 |
Specifies a single directory as the location to write all output files. |
|
1 |
Controls the level of output produced by Knitro. |
|
1 |
Specifies where to direct the output from Knitro. |
|
2 |
Use to specify a custom filename when output is written to a file using outmode. |
Tuner options
Option name |
Importance |
Purpose |
|---|---|---|
1 |
Indicates whether to invoke the Knitro-Tuner. |
|
1 |
Can be used to specify the location of a Tuner options file. |
|
2 |
Enable writing additional Tuner subproblem solve output to files for the Knitro-Tuner procedure (tuner = 1). |
|
3 |
Specifies, in seconds, the maximum allowable real time for Knitro-Tuner subproblems (i.e. individual solves with a particular option setting). |
|
1 |
Define the termination condition for the Knitro-Tuner procedure (tuner = 1). |
General options
blasoption
Specifies the BLAS/LAPACK function library to use for basic vector and matrix computations.
Details
BLAS and LAPACK functions from Intel Math Kernel Library (MKL) are provided with the Knitro distribution. The number of threads to use for the MKL BLAS are specified with blas_numthreads. On platforms where Intel MKL and Apple Accelerate are not available, the Knitro built-in functions are used by default.
BLAS (Basic Linear Algebra Subroutines) and LAPACK (Linear Algebra PACKage) functions are used throughout Knitro for fundamental vector and matrix calculations. The CPU time spent in these operations can be measured by setting option debug = 1 and examining the output file kdbg_profile*.txt. Some optimization problems are observed to spend very little CPU time in BLAS/LAPACK operations, while others spend more than 50%. Be aware that the different function implementations can return slightly different answers due to roundoff errors in double precision arithmetic. Thus, changing the value of blasoption sometimes alters the iterates generated by Knitro, or even the final solution point.
The knitro option uses built-in BLAS/LAPACK functions based on standard netlib routines (www.netlib.org). The intel option uses MKL functions written especially for x86 and x86_64 processor architectures. On a machine running an Intel processor, testing indicates that the MKL functions can significantly reduce the CPU time in BLAS/LAPACK operations. The dynamic option allows users to load any library that implements the functions declared in the file include/blas_lapack.h. Specify the library name with option blasoptionlib.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro automatically choose which BLAS to use |
0 |
|
|
Use Knitro built-in functions |
1 |
|
|
Use Intel Math Kernel Library (MKL) functions on available platforms. |
2 |
|
|
Use the dynamic library specified with option blasoptionlib |
3 |
|
|
Use BLIS functions on available platforms (currently not available on Windows OS). |
4 |
|
|
Use Apple Accelerate (only available on Mac with M1 processor). |
blasoptionlib
Specifies a dynamic library name that contains object code for BLAS/LAPACK functions.
Details
The library must implement all the functions declared in the file include/blas_lapack.h.
This option has no effect unless blasoption = 2.
Name |
|
API constant |
|
Type |
string |
Default |
|
bndrange
Specifies max limits on the magnitude of constraint and variable bounds.
Details
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).
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
cg_maxit
Determines the maximum allowable number of inner conjugate gradient (CG) iterations per Knitro minor iteration.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
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.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
cg_precond
Specifies whether an incomplete Cholesky preconditioner is applied during CG iterations in barrier algorithms.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Not applied |
1 |
|
|
Preconditioner is applied |
cg_stoptol
Specifies the relative stopping tolerance used for the conjugate gradient (CG) subproblem solves.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
convex
Declare the problem as convex by setting KN_CONVEX_YES or non-convex by setting KN_CONVEX_NO.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
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 |
|
|
Declare problem as non-convex |
1 |
|
|
Declare problem as convex |
cpuplatform
This option can be used to specify the target instruction set architecture for the machine on which Knitro is running.
Details
This can be used, for example (especially using the setting KN_CPUPLATFORM_COMPATIBLE), to try to produce more consistent Knitro performance across various architectures (at the expense of, perhaps, slower performance on some platforms). This option is currently only used for the Intel Math Kernel Library (MKL) functions used inside Knitro.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
1 |
|
|
Aim for more compatible performance across architectures |
2 |
|
|
SSE2 |
3 |
|
|
AVX |
4 |
|
|
AVX-2 |
5 |
|
|
AVX-512 (experimental) |
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).
Details
The datacheck may have a non-trivial cost for large problems. It is turned on by default, but can be turned off for improved speed.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No extra data checks |
1 |
|
|
Perform extra data checks |
delta
Specifies the initial trust region radius scaling factor used to determine the initial trust region size.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
deterministic
This option specifies whether to always enforce deterministic behavior for Knitro.
Details
Generally, the Knitro algorithms execute deterministically regardless of the setting of this user option. There are some exceptions however. Some linear system solvers that may be used inside Knitro such as MA86 and Apple Accelerate do not enforce deterministic behavior (see linsolver). In addition, the concurrent solver (concurrent_solver) runs non-deterministically by default. Setting deterministic =1 will enforce that in all cases Knitro runs deterministically.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not enforce deterministic behavior in Knitro. |
1 |
|
|
Enforce deterministic behavior in Knitro. |
eval_cost
Use this option to tell Knitro the relative cost of performing a callback.
Details
For function, gradient and Hessian evaluations. Knitro will use this information to better tune its algorithms.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Evaluation cost is not specified |
1 |
|
|
Evaluation cost is relatively inexpensive |
2 |
|
|
Evaluation cost is relatively expensive |
eval_fcga
Use this option to tell Knitro that you are providing the first derivatives in the same callback routine used for your function evaluations.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Gradients are not evaluated in the function evaluation callback |
1 |
|
|
Gradients are evaluated in the function evaluation callback |
honorbnds
Indicates whether or not to enforce satisfaction of simple variable bounds throughout the optimization.
Details
The API function KN_set_var_honorbnds() can be used to set this option for each variable individually. This option and the bar_feasible option may be useful in applications where functions are undefined outside the region defined by inequalities.
Note that setting honorbnds = 1 (always) or 2 (initpt) or using the default auto
option may cause Knitro to shift the value of a user-provided initial point so that it lies
sufficiently inside the (possibly presolved) bounds. Setting honorbnds = 0 (no)
will prevent Knitro from shifting a user-provided initial point.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Setting determined automatically by Knitro |
0 |
|
|
Allow iterations to violate the bounds |
1 |
|
|
Enforce bounds satisfaction of all iterates |
2 |
|
|
Enforce bounds satisfaction of initial point |
initpenalty
Specifies the initial penalty parameter used in the Knitro merit functions.
Details
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.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
initpt_strategy
Specifies the initial point strategy used for the continuous algorithms.
Details
Using a more advanced initial point strategy may produce a better initial point at the cost of more computation.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Automatic initial point strategy |
1 |
|
|
Try basic initial point strategy |
2 |
|
|
Try more advanced initial point strategy |
initptfile
Specifies a file from which to read the initial point used for the Knitro algorithms.
Details
Setting to NULL means that no initial point is read from a file.
Name |
|
API constant |
|
Type |
string |
Default |
|
linesearch
Indicates which linesearch strategy to use for the Interior/Direct or SQP algorithm to search for a new acceptable iterate.
Details
This option has no effect on the Interior/CG or Active Set algorithm.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the linesearch method |
1 |
|
|
Backtracking linesearch |
2 |
|
|
Interpolation based linesearch |
3 |
|
|
Weak Wolfe linesearch |
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.
Details
This option has no effect on the Interior/CG or Active Set algorithm.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
linsolver
Indicates which linear solver to use to solve linear systems arising in Knitro algorithms.
Details
The QR linear solver, the HSL MA57/MA86/MA97 linear solvers and the Intel MKL PARDISO solver all make frequent use of Basic Linear Algebra Subroutines (BLAS) for internal linear algebra operations. If using any of these it is highly recommended to use optimized BLAS for your particular machine. This can result in dramatic speedup. Please read the notes under the blasoption user option in this section for more details about the BLAS options in Knitro and how to make sure that the Intel MKL BLAS or other user-specified BLAS can be used by Knitro. You may also achieve speedups using multi-threaded BLAS with these solvers by setting numthreads > 1 or blas_numthreads > 1 when using the solvers.
Additionally, the HSL solvers MA86 and MA97, the Intel MKL PARDISO solver, and the Apple Accelerate solver are specifically designed to exploit parallelism (beyond BLAS parallelism) to achieve speedups on large problems. You may try setting numthreads > 1 or linsolver_numthreads > 1 (with blas_numthreads = 1) when using these solvers, to obtain greater speedups.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro automatically choose the linear solver. |
1 |
|
|
Use internal solver provided with Knitro. |
2 |
|
|
Use a hybrid approach where the solver chosen depends on the particular linear system which needs to be solved. |
3 |
|
|
Use a dense QR method. This approach uses LAPACK QR routines. Since it uses a dense method, it is only efficient for small problems. It may often be the most efficient method for small problems with dense Jacobians or Hessian matrices. |
4 |
|
|
Use the HSL MA27 sparse symmetric indefinite solver. |
5 |
|
|
Use the HSL MA57 sparse symmetric indefinite solver. |
6 |
|
|
Use the Intel MKL PARDISO (parallel, deterministic) sparse symmetric indefinite solver (x86-64 only). |
7 |
|
|
Use the HSL MA97 (parallel, deterministic) sparse symmetric indefinite solver. |
8 |
|
|
Use the HSL MA86 (parallel, non-deterministic) sparse symmetric indefinite solver. |
9 |
|
|
Use the Apple Accelerate (parallel, non-deterministic) sparse symmetric indefinite solver (macOS only). |
linsolver_maxitref
Indicates the maximum allowable number of iterative refinement steps applied when a linear system is solved inside Knitro.
Details
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.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
linsolver_nodeamalg
Controls the node amalgamation setting for the MA57, MA86 and MA97 linear solvers.
Details
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.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
linsolver_ooc
Indicates whether to use Intel MKL PARDISO out-of-core solve of linear systems when linsolver = mklpardiso.
Details
This option is only active when linsolver = mklpardiso.
See the Intel MKL PARDISO documentation for more details on how this option works.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Always use in-core version |
1 |
|
|
Will use out-of-core version beyond a certain size |
2 |
|
|
Always use out-of-core version |
linsolver_ordering
Sets the ordering method used for the linear system solver.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Automatically determine ordering procedure |
0 |
|
|
Choose the best between AMD and METIS |
1 |
|
|
Use AMD ordering (min degree for MKL PARDISO) |
2 |
|
|
Use METIS ordering |
linsolver_pivottol
Specifies the initial pivot threshold used in factorization routines.
Details
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).
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Maximum |
|
Default |
|
linsolver_scaling
Enables scaling for the linear system solver.
Details
Applying scaling may allow for more accuracy in the linear system solves, but will generally make the linear system solves more expensive.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No scaling is applied in the linear system solves |
1 |
|
|
Always apply scaling in the linear system solves |
2 |
|
|
Dynamically apply scaling in the linear system solves |
lp_algorithm
Indicates which algorithm to use to solve linear problems (LPs).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro automatically decide. |
0 |
|
|
Use algorithm specified in nlp_algorithm. |
1 |
|
|
Use Primal Simplex algorithm. |
2 |
|
|
Use Dual Simplex algorithm. |
3 |
|
|
Use Interior-Point/Barrier algorithm. |
4 |
|
|
Use Primal-Dual Linear Programming algorithm. |
maxstepsize
This option enforces a maximum step size limit at every iteration of the continuous NLP algorithms in Knitro (as well as the barrier LP algorithm).
Details
The maximum limit is based on the magnitude of the step taken at the algorithm level (on the scaled, presolved problem) and may not exactly correspond to the step measured at the application level. A value less than or equal to 0 implies no maximum limit is applied. The number of iterations where this limit is enforced is controlled by the maxstepsize_maxit user option.
Name |
|
API constant |
|
Type |
double |
Default |
|
maxstepsize_maxit
This option specifies the maximum number of iterations where the maxstepsize restriction is enforced (if 0 then no iteration limit is imposed for this).
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
ncvx_qcqp_init
Specifies the initialization strategy used for non-convex QPs and QCQPs.
Details
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).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Knitro will automatically determine the strategy. |
0 |
|
|
No special initialization strategy is used. |
1 |
|
|
Initialize by solving a linear relaxation. |
2 |
|
|
Initialize by solving a hybrid formulation. |
3 |
|
|
Initialize by solving a penalty formulation. |
4 |
|
|
Initialize by solving a convex quadratic relaxation. |
nlp_algorithm
Indicates which algorithm to use to solve nonlinear problems (e.g. NLPs, QPs, QCQPs)
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the algorithm |
1 |
|
|
Use Interior (barrier) Direct algorithm |
2 |
|
|
Use Interior (barrier) CG algorithm |
3 |
|
|
Use Active Set SLQP algorithm |
4 |
|
|
Use Active Set SQP algorithm |
5 |
|
|
Run multiple algorithms (perhaps in parallel) |
6 |
|
|
Use Augmented Lagrangian algorithm |
objrange
Specifies the extreme limits of the objective function for purposes of determining unboundedness.
Details
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.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
restarts
Specifies whether or not to enable automatic restarts in Knitro.
Details
When enabled, if a Knitro algorithm seems to be converging slowly or not converging, the algorithm will automatically restart, which may help with convergence.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
restarts_maxit
When restarts are enabled, this option can be used to specify a maximum number of iterations before enforcing a restart.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
scale
Specifies whether to perform problem scaling of the objective function, constraint functions, or possibly variables.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No scaling done |
1 |
|
|
User, if defined, otherwise internal |
2 |
|
|
User, if defined, otherwise none |
3 |
|
|
Knitro performs internal scaling |
scale_strategy
Strategies for problem scaling. Multiple strategies can be selected at once using multiple bits.
Name |
|
API constant |
|
Type |
bitset |
Default |
|
Bit value |
Name |
Description |
|---|---|---|
0 |
|
Let Knitro choose the scaling strategy. Use option scale for fully disabling scaling. |
1 |
|
Apply constraint scaling. |
2 |
|
Apply variable scaling. |
4 |
|
Apply objective scaling. |
8 |
|
Apply Equilibration scaling. If enabled, curtisreid and ruizpock bits are ignored. |
16 |
|
Apply Curtis-Reid scaling. |
32 |
|
Apply Ruiz and Pock scalings. |
64 |
|
Use geometric mean in scaling computation rather than the infinity norm. |
128 |
|
Apply variable scaling based on bounds. If disabled, the strategy given by the previous three bits is applied for variable scaling. |
256 |
|
Allow scaling factors larger than one. |
512 |
|
Force scaling factors to be powers of two. |
1024 |
|
Allow scaling factor computation in a loop. |
2048 |
|
Allow dynamic scaling (only for NLPs). |
soc
Specifies whether or not to try second order corrections (SOC).
Details
A second order correction may be beneficial for problems with highly nonlinear constraints.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Never do second order corrections |
1 |
|
|
SOC steps attempted on some iterations |
2 |
|
|
SOC steps always attempted when constraints are nonlinear |
soltype
This option specifies the solution returned by Knitro.
Details
Generally, the solution converged to by Knitro is a locally optimal solution that corresponds to the best feasible solution found. However, on rare occasions, Knitro may encounter a feasible solution during the optimization process that has a better objective value than the final solution converged to by Knitro. Setting soltype = 1 in this case will return this iterate. This iterate can also be retrieved through the API function KN_get_best_feasible_iterate().
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Return the final iterate |
1 |
|
|
Return the best feasible iterate found |
strat_warm_start
Specifies whether or not to invoke a warm-start strategy.
Details
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).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No warm-start strategy is applied. |
1 |
|
|
Knitro will apply a warm-start strategy with special tunings. |
Derivatives options
bfgs_scaling
Specify the initial scaling to use for the BFGS or L-BFGS Hessian approximation.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Dynamically determine |
1 |
|
|
Approximate scale of the inverse Hessian |
2 |
|
|
Approximate the scale of the Hessian |
derivcheck
Determine whether or not to perform a derivative check
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No derivative check |
1 |
|
|
Check first derivatives |
2 |
|
|
Check second derivatives |
3 |
|
|
Check all derivatives |
derivcheck_terminate
Determine whether to always terminate after the derivative check or only when the derivative checker detects a possible error.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
1 |
|
|
Stop when there is an error detected |
2 |
|
|
Always stop after the derivative check |
derivcheck_tol
Specifies the relative tolerance used for detecting derivative errors, when the Knitro derivative checker is enabled.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
derivcheck_type
Specifies whether to use forward or central finite differencing for the derivative checker when it is enabled.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
1 |
|
|
Check using forward finite-differences |
2 |
|
|
Check using central finite-differences |
findiff_estnoise
This option can be used to enable an estimate of the noise in the model when using finite-difference gradients.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No estimation of noise performed |
1 |
|
|
Estimate the noise and perhaps use it to determine a finite-difference steplength |
2 |
|
|
Estimate a curvature factor as well as the noise and perhaps use it to determine a finite-difference steplength |
findiff_relstepsize
Specifies the relative stepsize used for finite-difference gradients during the optimization.
Details
This option sets the stepsize for all variables. The API function KN_set_cb_relstepsizes() can be used to customize the settings for individual variables. Note that this option has no effect on the finite-difference derivatives computed for the derivative checker (default values are always used here). It is only used for the finite-difference derivatives computed during the optimization.
Name |
|
API constant |
|
Type |
double |
Default |
|
gradopt
Specifies how to compute the gradients of the objective and constraint functions.
Details
It is highly recommended to provide exact gradients if at all possible as this greatly impacts the performance of the code.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
1 |
|
|
User supplies exact first derivatives |
2 |
|
|
Gradients computed by internal forward finite differences |
3 |
|
|
Gradients computed by internal central finite differences |
4 |
|
|
Gradients computed by user-provided forward finite differences |
5 |
|
|
Gradients computed by user-provided central finite differences |
hessian_no_f
Determines whether or not to allow Knitro to request Hessian (or Hessian-vector product) evaluations without the objective component included.
Details
If hessian_no_f = 0, Knitro will only ask the user for the standard Hessian and will internally approximate the Hessian without the objective component when it is needed. When hessian_no_f = 1, Knitro will provide a flag to the user EVALH_NO_F (or EVALHV_NO_F) when it wants an evaluation of the Hessian (or Hessian-vector product) without the objective component. Using hessian_no_f = 1 (and providing the appropriate Hessian) may improve Knitro performance on some problems. This option only has an effect when hessopt = 1 (i.e. user-provided exact Hessians), or hessopt = 5 (i.e. user-provided exact Hessian-vector products).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Not allowed |
1 |
|
|
User can provide this version of the Hessian if requested |
hessopt
Specifies how to compute the (approximate) Hessian of the Lagrangian.
Details
Options hessopt = 4 and hessopt = 5 are not available with the Interior/Direct or SQP algorithms.
Knitro usually performs best when the user provides exact Hessians (hessopt = 1) or exact Hessian-vector products (hessopt = 5). If neither can be provided but exact gradients are available (i.e., gradopt = 1), then hessopt = 4 may be a good option. This option is comparable in terms of robustness to the exact Hessian option and typically not much slower in terms of time, provided that gradient evaluations are not a dominant cost. However, this option is only available for some algorithms.
If exact gradients cannot be provided, then one of the quasi-Newton options is preferred. Options hessopt = 2 and hessopt = 3 are only recommended for small problems (say, n < 1000) since they require working with a dense Hessian approximation. Note that with these last two options, the Hessian pattern will be ignored since Knitro computes a dense approximation. Option hessopt = 6 should be used for large problems.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Knitro will use exact Hessians if provided; otherwise it uses an appropriate approximation. |
1 |
|
|
Knitro uses supplied exact second derivatives |
2 |
|
|
Knitro computes a dense quasi-Newton BFGS Hessian |
3 |
|
|
Knitro computes a dense quasi-Newton SR1 Hessian |
4 |
|
|
Knitro computes Hessian-vector products by finite differences |
5 |
|
|
User supplies exact Hessian-vector products |
6 |
|
|
Knitro computes a limited-memory quasi-Newton BFGS Hessian |
7 |
|
|
Knitro computes a Gauss-Newton approximation of the Hessian (available for least-squares only, and default value for least-squares) |
lmsize
Specifies the number of limited memory pairs stored when approximating the Hessian using the limited-memory quasi-Newton BFGS option.
Details
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.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Maximum |
|
Default |
|
Termination options
feaserr_level
This option specifies the feasibility error measure used at the algorithm level and for termination.
Details
If set to the application level, the feasibility error used in the algorithm is based on the original, user problem form. If set to internal, then the feasibility error measure is based on the internal (presolved, scaled) problem form.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
1 |
|
|
Use feasibility error based on application level (original) problem form |
2 |
|
|
Use feasibility error based on internal (presolved, scaled) problem form |
feastol
Specifies the final relative stopping tolerance for the feasibility error.
Details
Smaller values of feastol result in a higher degree of accuracy in the solution with respect to feasibility. A negative value uses an automatic setting, which will adapt the stopping tolerance to the problem type and solution method (e.g. using a less strict tolerance for first-order methods). For standard NLP problems the auto setting will use 1.0e-6.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
feastol_abs
Specifies the final absolute stopping tolerance for the feasibility error.
Details
Smaller values of feastol_abs result in a higher degree of accuracy in the solution with respect to feasibility. A negative value uses an automatic setting, which will adapt the stopping tolerance to the problem type and solution method (e.g. using a less strict tolerance for first-order methods). For standard NLP problems the auto setting will use 1.0e-3.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
findiff_terminate
This option specifies the termination criteria when using finite-difference gradients.
Details
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).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No special criteria; use the standard stopping conditions. |
1 |
|
|
Allow termination based on estimates of the finite-difference error (when no more significant progress is likely). |
fstopval
Used to implement a custom stopping condition based on the objective function value.
Details
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.
Name |
|
API constant |
|
Type |
double |
Default |
|
ftol
The optimization process will terminate if the relative change in the objective function is less than ftol for ftol_iters consecutive feasible iterations.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
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.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
infeastol
Specifies the (relative) tolerance used for declaring infeasibility of a model.
Details
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.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
infeastol_iters
Controls the termination for consecutive infeasible iterations.
Details
The optimization process will terminate if the relative change in the feasibility error is less than infeastol for infeastol_iters consecutive infeasible iterations.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
maxfevals
Specifies the maximum number of function evaluations before termination.
Details
Values less than zero imply no limit.
Name |
|
API constant |
|
Type |
integer |
Default |
|
maxit
Specifies the maximum number of iterations before termination.
Details
Currently Knitro sets this value to 10000 for LPs/NLPs and 3000 for MIP problems.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
maxtime
Specifies, in seconds, the maximum allowable real time before termination.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
opttol
Specifies the final relative stopping tolerance for the KKT (optimality) error.
Details
Smaller values of opttol result in a higher degree of accuracy in the solution with respect to optimality. A negative value uses an automatic setting, which will adapt the stopping tolerance to the problem type and solution method (e.g. using a less strict tolerance for first-order methods). For standard NLP problems the auto setting will use 1.0e-6.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
opttol_abs
Specifies the final absolute stopping tolerance for the KKT (optimality) error.
Details
Smaller values of opttol_abs result in a higher degree of accuracy in the solution with respect to optimality. A negative value uses an automatic setting, which will adapt the stopping tolerance to the problem type and solution method (e.g. using a less strict tolerance for first-order methods). For standard NLP problems the auto setting will use 1.0e-3.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
xtol
Tolerance for convergence criterion based on relative change between successive solution points.
Details
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.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
xtol_iters
Number of iterations for convergence criterion based on relative change between successive solution points.
Details
The optimization process will terminate if the relative change in all components of the solution point estimate is less than xtol for xtol_iters consecutive iterations. If set to 0, Knitro chooses this value based on the solver and context. Currently Knitro sets this value to 3 unless the MISQP algorithm is being used, in which case the value is set to 1 by default.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
Presolve options
presolve
Determine whether or not to use the Knitro presolver to try to simplify the model by removing variables or constraints.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No presolve |
1 |
|
|
Knitro performs presolve |
presolve_initpt
Control whether the Knitro presolver can shift a user-supplied initial point.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
Do not shift initial point in presolve |
1 |
|
|
Allow shifting variables in linear constraints |
2 |
|
|
Allow shifting any variable |
presolve_level
Set the level of presolve operations to enable through the Knitro presolver.
Details
A higher presolve level enables more complex presolve operations.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
1 |
|
|
Most basic presolve |
2 |
|
|
More advanced presolve |
presolve_passes
Set a maximum limit on the number of passes through the Knitro presolve operations.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
presolve_tol
Determines the tolerance used by the Knitro presolver to remove variables and constraints from the model.
Details
If you believe the Knitro presolver is incorrectly modifying the model, use a smaller value for this tolerance (or turn the presolver off).
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
presolve_zero_tol
Tolerance for rounding to zero linear coefficients in presolve. Higher values mean that more reductions will be applied. Zero value is not recommended as it means no rounding is done, which can lead to numerical instability.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
presolveop_clique_merging
Determine whether or not to enable the Knitro presolve operations that attempt to merge cliques to strengthen the formulation.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
Disabled |
1 |
|
|
Enabled |
presolveop_implied_mpec
Transforms quadratic constraints into MPEC constraints.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Disabled |
1 |
|
|
Enabled |
presolveop_probing
Determine whether or not to enable the Knitro presolve operations that analyze deductions made by fixing integer variables.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Automatic selection |
0 |
|
|
Disabled |
1 |
|
|
Light probing |
2 |
|
|
Full probing until no more deductions are found |
presolveop_redundant
Determine whether or not to enable the Knitro presolve operation to detect and remove redundant constraints.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not detect redundant constraints |
1 |
|
|
Detect and remove duplicate constraints |
2 |
|
|
Detect and remove linearly dependent constraints |
presolveop_substitution
Determine whether or not to enable the Knitro presolve operation to substitute out variables when possible.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Automatic substitution procedure |
0 |
|
|
No substitution |
1 |
|
|
Only doubleton equality substitutions |
2 |
|
|
All possible substitutions |
presolveop_substitution_tol
Tolerance for applying a substitution.
Details
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.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
presolveop_tighten
Determine whether or not to enable the Knitro presolve operation to tighten variable bounds or coefficients.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Automatic tightening procedure |
0 |
|
|
No tightening |
1 |
|
|
Tighten variable bounds |
Barrier options
bar_conic_enable
Enable special treatments for conic constraints.
Details
Only when using the Interior/Direct algorithm (has no effect when using the Interior/CG algorithm).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro automatically choose the strategy. |
0 |
|
|
Do not apply any special treatment for conic constraints. |
1 |
|
|
Apply special treatments for any Second Order Cone (SOC) constraints identified in the model. |
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.
Details
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.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
bar_feasible
Specifies whether special emphasis is placed on getting and staying feasible in the interior-point algorithms.
Details
This option can only be used with the Interior/Direct and Interior/CG algorithms. If bar_feasible = stay or bar_feasible = get_stay, this will activate the feasible version of Knitro. The feasible version of Knitro will force iterates to strictly satisfy inequalities, but does not require satisfaction of equality constraints at intermediate iterates. This option and the honorbnds option may be useful in applications where functions are undefined outside the region defined by inequalities. The initial point must satisfy inequalities to a sufficient degree; if not, Knitro may generate infeasible iterates and does not switch to the feasible version until a sufficiently feasible point is found. Sufficient satisfaction occurs at a point x if it is true for all inequalities that cl + tol ≤ c(x) ≤ cu - tol. The constant tol is determined by the option bar_feasmodetol. If bar_feasible = get or bar_feasible = get_stay, Knitro will place special emphasis on first trying to get feasible before trying to optimize.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No emphasis on feasibility |
1 |
|
|
Iterates must satisfy inequality constraints once they become sufficiently feasible. |
2 |
|
|
Special emphasis is placed on getting feasible before trying to optimize. |
3 |
|
|
Implement both options 1 and 2 above. |
bar_feasmodetol
Tolerance used in the feasibility condition that determines whether Knitro will force subsequent iterates to remain feasible.
Details
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.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
bar_globalize
Specifies the globalization strategy used in the interior-point algorithms.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not apply any globalization strategy |
1 |
|
|
Apply a globalization strategy based on decreasing the KKT error |
2 |
|
|
Apply a globalization strategy using a filter based on the objective and constraint violation |
bar_initmu
Specifies the initial value for the barrier parameter $mu$ used with the barrier algorithms.
Details
This option has no effect on the Active Set algorithm.
Name |
|
API constant |
|
Type |
double |
Default |
|
bar_initpi_mpec
Specifies the initial value for the MPEC penalty parameter $pi$ used when solving problems with complementarity constraints using the barrier algorithms.
Details
If this value is non-positive, then Knitro uses an internal formula to initialize the MPEC penalty parameter.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
bar_initpt
Indicates initial point strategy for x, slacks and multipliers when using a barrier algorithm.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the strategy |
1 |
|
|
Initialization designed for convex models. |
2 |
|
|
Initialization strategy that stays closer to the bounds. |
3 |
|
|
Initialization strategy that is more central on double-bounded variables. |
bar_linsys
Indicates which linear system form is used inside the Interior/Direct algorithm for computing primal-dual steps.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro automatically choose the linear system form. |
0 |
|
|
Use the full linear system. |
1 |
|
|
Eliminate the slack variables. |
2 |
|
|
Eliminate the slack variables and bounds. |
3 |
|
|
Eliminate the slack variables, bounds, and some inequalities. |
bar_linsys_storage
Indicates how to store in memory the linear systems used inside the Interior/Direct algorithm for computing primal-dual steps.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro automatically choose the linear system storage approach. |
1 |
|
|
Use common storage for multiple linear systems. |
2 |
|
|
Use separate storage for different linear systems. |
bar_maxcorrectors
Specifies the maximum number of corrector steps allowed for primal-dual steps.
Details
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.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
bar_maxcrossit
Specifies the maximum number of crossover iterations before termination.
Details
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.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
bar_maxmu
Specifies the maximum allowable value for the barrier parameter $mu$ used with the barrier algorithms.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Maximum |
|
Default |
|
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.
Details
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.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
bar_mpec_heuristic
Specifies whether or not to use a heuristic approach when solving MPEC models with the barrier algorithm.
Details
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).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No MPEC heuristic enabled |
1 |
|
|
MPEC heuristic is enabled |
bar_murule
Indicates which strategy to use for modifying the barrier parameter $mu$ in the barrier algorithms.
Details
Not all strategies are available for both barrier algorithms, as described below. This option has no effect on the Active Set algorithm.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the strategy |
1 |
|
|
Monotonically decrease the barrier parameter. Available for both barrier algorithms. |
2 |
|
|
Use an adaptive rule based on the complementarity gap to determine the value of the barrier parameter. Available for both barrier algorithms. |
3 |
|
|
Use a probing (affine-scaling) step to dynamically determine the barrier parameter. Available only for the Interior/Direct algorithm. |
4 |
|
|
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 |
|
|
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 |
|
|
Minimize a quality function at each iteration to determine the barrier parameter. Available only for the Interior/Direct algorithm. |
bar_penaltycons
Indicates whether a penalty approach is applied to the constraints.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro choose the strategy |
0 |
|
|
Do not apply penalty approach to any constraints |
2 |
|
|
Apply a penalty approach to all general constraints |
3 |
|
|
Apply a penalty approach to equality constraints only |
bar_penaltyrule
Indicates which penalty parameter strategy to use for determining whether or not to accept a trial iterate.
Details
This option has no effect on the Active Set algorithm.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the strategy |
1 |
|
|
Use a single penalty parameter in the merit function to weight feasibility versus optimality. |
2 |
|
|
Use a more tolerant and flexible step acceptance procedure based on a range of penalty parameter values. |
bar_refinement
Specifies whether to try to refine the barrier solution for better precision.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not refine the barrier solution |
1 |
|
|
Try to refine the barrier solution |
bar_relaxcons
Indicates whether a relaxation approach is applied to the constraints.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not relax any constraints |
1 |
|
|
Relax only equality constraints |
2 |
|
|
Relax only inequality constraints |
3 |
|
|
Relax all general constraints |
bar_slackboundpush
Specifies the amount by which the barrier slack variables are initially pushed inside the bounds.
Details
A smaller value may be preferable when warm-starting from a point close to the solution.
Name |
|
API constant |
|
Type |
double |
Default |
|
bar_switchobj
Indicates which objective function to use when the barrier algorithms switch to a pure feasibility phase.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No objective |
1 |
|
|
Proximal point objective with scalar weighting |
2 |
|
|
Proximal point objective with diagonal weighting |
bar_switchrule
Indicates whether or not the barrier algorithms will allow switching from an optimality phase to a pure feasibility phase.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro choose the strategy |
0 |
|
|
Never switch |
2 |
|
|
Allow moderate switching |
3 |
|
|
More aggressive switching |
bar_watchdog
Specifies whether to enable watchdog heuristic for barrier algorithms.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No watchdog heuristic |
1 |
|
|
Allow watchdog heuristic to be used |
Active-Set options
act_lpalg
Indicates which algorithm to use to solve linear programming (LP) subproblems when using the Knitro Active Set or SQP algorithms.
Details
The barrier option is currently only active when using the CPLEX(R) or Xpress(R) LP solvers chosen via act_lpsolver. This option has no effect on the Interior/Direct and Interior/CG algorithms.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Use the default algorithm for the chosen LP solver. |
1 |
|
|
Use a primal simplex algorithm. |
2 |
|
|
Use a dual simplex algorithm. |
3 |
|
|
Use a barrier/interior-point algorithm. |
act_lpfeastol
Specifies the feasibility tolerance used for linear programming subproblems solved when using the Active Set or SQP algorithms.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
act_lppenalty
Indicates whether to use a penalty formulation for linear programming subproblems in the Knitro Active Set or SQP algorithms.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
1 |
|
|
Penalize all constraints. |
2 |
|
|
Penalize only nonlinear constraints. |
3 |
|
|
Dynamically choose which constraints to penalize. |
act_lppresolve
Indicates whether to apply a presolve for linear programming subproblems in the Knitro Active Set or SQP algorithms.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Presolve turned off for LP subproblems. |
1 |
|
|
Presolve turned on for LP subproblems. |
act_lpsolver
Indicates which linear programming simplex solver the Knitro Active Set or SQP algorithms use when solving internal LP subproblems.
Details
If act_lpsolver = cplex then the CPLEX shared object library or DLL must reside in the operating system’s load path. If this option is selected, Knitro will automatically look for standard CPLEX library names in the system’s load path (in order of most recent releases starting with CPLEX 12.10).
To override the automatic search and load a particular CPLEX library, set its name with the character type user option cplexlibname. Either supply the full path name in this option, or make sure the library resides in a directory that is listed in the operating system’s load path. For example, to specifically load the Windows CPLEX library cplex123.dll, make sure the directory containing the library is part of the PATH environment variable, and call the following (also be sure to check the return status of this call):
KN_set_char_param_by_name (kc, "cplexlibname", "cplex123.dll");
If act_lpsolver = xpress then the Xpress shared object library or DLL must reside in the operating system’s load path. If this option is selected, Knitro will automatically look for the standard Xpress dll/shared library name.
To override the automatic search and load a particular Xpress library, set its name with the character type user option xpresslibname. Either supply the full path name in this option, or make sure the library resides in a directory that is listed in the operating system’s load path.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
1 |
|
|
Use internal LP solver |
2 |
|
|
CPLEX (if user has a valid license) |
3 |
|
|
XPRESS (if user has a valid license) |
act_parametric
Indicates whether to use a parametric approach when solving linear programming (LP) subproblems when using the Knitro Active Set or SQP algorithms.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Never |
1 |
|
|
Use selectively |
2 |
|
|
Always use parametric approach |
act_qpalg
Indicates which algorithm to use to solve quadratic programming (QP) subproblems when using the Knitro Active Set or SQP algorithms.
Details
This option has no effect on the Interior/Direct and Interior/CG algorithms.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the algorithm |
1 |
|
|
Use Interior (barrier) Direct algorithm |
2 |
|
|
Use Interior (barrier) CG algorithm |
3 |
|
|
Use Active Set SLQP algorithm |
act_qppenalty
Indicates whether to use a penalty formulation for quadratic programming subproblems in the Knitro SQP algorithm.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro automatically decide. |
0 |
|
|
Do not penalize constraints in QP subproblems. |
1 |
|
|
Penalize all constraints in QP subproblems. |
cplexlibname
See option act_lpsolver.
Name |
|
API constant |
|
Type |
string |
Default |
|
xpresslibname
See option act_lpsolver.
Name |
|
API constant |
|
Type |
string |
Default |
|
Augmented Lagrangian options
al_initpenalty
Specifies the initial penalty parameter value used in the Augmented Lagrangian (AL) algorithm.
Details
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.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Maximum |
|
Default |
|
al_maxpenalty
Specifies the maximum allowable penalty parameter value used in the Augmented Lagrangian (AL) algorithm.
Details
If feasibility cannot be achieved once this value is reached, the problem is declared infeasible.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Maximum |
|
Default |
|
MIP options
mip_branchrule
Specifies which branching rule to use for MIP branch and bound procedure.
Details
See options mip_strong_candlim, mip_strong_level and mip_strong_maxit for further control of strong branching procedure.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the rule |
1 |
|
|
Most fractional (most infeasible) variable |
2 |
|
|
Use pseudo-cost value |
3 |
|
|
Use strong branching |
mip_clique
Specifies rules for adding clique cuts.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
Do not add clique cuts |
1 |
|
|
Add clique cuts at root node |
2 |
|
|
Add clique cuts in the whole tree |
mip_cut_flowcover
Specifies rules for adding flow cover cuts.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
Do not add flow cover cuts |
1 |
|
|
Add flow cover cuts at root node only |
2 |
|
|
Add flow cover cuts at any tree node |
mip_cut_probing
Specifies rules for adding probing cuts.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
Do not add probing cuts |
1 |
|
|
Add probing cuts at root node only |
2 |
|
|
Add probing cuts at any tree node |
mip_cutfactor
This value specifies a limit on the number of cuts added to a node subproblem.
Details
If non-negative, a maximum of mip_cutfactor times the number of constraints is possibly appended.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
mip_cutoff
This value specifies the objective cutoff value for MIP.
Name |
|
API constant |
|
Type |
double |
Default |
|
mip_cutoff_abs
This value specifies the absolute improvement cutoff value for MIP.
Details
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.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
mip_cutoff_rel
This value specifies the relative improvement cutoff value for MIP.
Details
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.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
mip_cutting_plane
Specifies when to apply the cutting plane procedure.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not perform cutting plane |
1 |
|
|
Only perform root-cutting |
mip_debug
Specifies debugging level for MIP solution.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No MIP debugging info |
1 |
|
|
Write debugging to the file kdbg_mip.log |
mip_gomory
Specifies rules for adding Gomory mixed-integer cuts.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
Do not add Gomory cuts |
1 |
|
|
Add Gomory cuts at root node only |
2 |
|
|
Add Gomory cuts at any tree node |
mip_gub_branch
Specifies whether or not to branch on generalized upper bounds (GUBs).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not branch on GUBs |
1 |
|
|
Branch on GUBs |
mip_heuristic_diving
Specifies whether or not to enable the MIP diving heuristic.
Details
This option is a bit-valued option where various diving heuristics can be enabled by activating the corresponding bit value as described below.
Name |
|
API constant |
|
Type |
bitset |
Default |
|
Bit value |
Name |
Description |
|---|---|---|
1 |
|
Automatically determined. If enabled, other bits are ignored. |
2 |
|
Pure fractional diving. |
4 |
|
Objective-guided fractional diving. |
8 |
|
Vectorlength diving (obsolete). |
16 |
|
Coefficient-branching diving (obsolete). |
32 |
|
Guided-branching diving (obsolete). |
64 |
|
Linesearch diving (obsolete). |
128 |
|
Pseudo-random diving using both fractionality and cliques. |
256 |
|
Fractional diving followed by lock-based diving. |
512 |
|
Fractional diving followed by objective-based diving. |
1024 |
|
Fractional diving skewed towards fixing binaries to 1. |
mip_heuristic_feaspump
Specifies whether or not to enable the MIP feasibility pump heuristic.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
Feasibility pump heuristic is turned off |
1 |
|
|
Feasibility pump heuristic is turned on |
mip_heuristic_fixpropagate
Specifies whether or not to enable the MIP fix-and-propagate heuristic.
Name |
|
API constant |
|
Type |
bitset |
Default |
|
Bit value |
Name |
Description |
|---|---|---|
1 |
|
Automatically determined. If enabled, other bits are ignored. |
2 |
|
Activate fix & propagate heuristic 1. |
4 |
|
Activate fix & propagate heuristic 2. |
8 |
|
Activate fix & propagate heuristic 3. |
16 |
|
Activate fix & propagate heuristic 4. |
32 |
|
Activate fix & propagate heuristic 5. |
mip_heuristic_lns
Specifies whether or not to enable the MIP large neighborhood search (LNS) heuristics.
Details
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).
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Maximum |
|
Default |
|
mip_heuristic_localsearch
Specifies whether or not to enable the MIP local search heuristic.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
MIP local search heuristic is turned off |
1 |
|
|
MIP local search heuristic is turned on |
mip_heuristic_maxit
Maximum number of iterations to allow for MIP heuristic.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
mip_heuristic_misqp
Specifies whether or not to enable the MIP MISQP heuristic.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
MISQP heuristic is turned off |
1 |
|
|
MISQP heuristic is turned on |
mip_heuristic_mpec
Specifies whether or not to enable the MIP MPEC heuristic.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
MPEC heuristic is turned off |
1 |
|
|
MPEC heuristic is turned on |
mip_heuristic_strategy
Specifies the level of effort applied for the MIP heuristic search used to try to find an initial integer feasible point.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Automatic strategy |
0 |
|
|
No heuristics are used |
1 |
|
|
Try basic heuristics |
2 |
|
|
Try more advanced heuristics |
3 |
|
|
Try most extensive heuristics |
mip_heuristic_terminate
Specifies the condition for terminating the MIP heuristic.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
1 |
|
|
Terminate at first feasible point |
2 |
|
|
Run heuristic until it hits limit |
mip_implications
Whether to add logical implications deduced from branching decisions at a MIP node.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not add logical implications |
1 |
|
|
Add logical implications |
mip_initptfile
Name for the file from which to read the MIP initial point.
Details
NULL value means no MIP initial point read from file.
Name |
|
API constant |
|
Type |
string |
Default |
|
mip_integer_tol
This value specifies the threshold for deciding whether or not a variable is determined to be an integer.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Maximum |
|
Default |
|
mip_intvar_strategy
Specifies how to handle integer variables.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No special treatment |
1 |
|
|
Relax integer variables |
2 |
|
|
Convert to mpec constraints |
mip_knapsack
Specifies rules for adding MIP knapsack cuts.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
Do not add knapsack cuts |
1 |
|
|
Add knapsack cuts derived in the root node |
2 |
|
|
Add knapsack cuts in the whole tree |
mip_liftproject
Specifies rules for adding lift and project cuts.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
Do not add lift and project cuts |
1 |
|
|
Add lift and project cuts at root node |
mip_maxnodes
Specifies the maximum number of nodes explored (0 means no limit).
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
mip_method
Specifies which MIP method to use.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the method |
1 |
|
|
Standard branch and bound |
3 |
|
|
Mixed-integer SQP |
mip_mir
Specifies rules for adding mixed-integer rounding (MIR) cuts.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Automatically determine whether to add MIR cuts |
0 |
|
|
Do not add MIR cuts |
1 |
|
|
Add MIR cuts derived in the root node |
2 |
|
|
Add MIR cuts in the whole tree |
mip_multistart
Use to enable MIP multi-start at the branch-and-bound level.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
MIP multistart turned off |
1 |
|
|
MIP multistart turned on |
mip_node_lpalg
Specifies which algorithm to use for standard node LP subproblem solves in MIP (same options as lp_algorithm user option).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro automatically decide. |
0 |
|
|
Use algorithm specified in mip_node_nlpalg. |
1 |
|
|
Use Primal Simplex algorithm. |
2 |
|
|
Use Dual Simplex algorithm. |
3 |
|
|
Use Interior-Point/Barrier algorithm. |
4 |
|
|
Use Primal-Dual Linear Programming algorithm. |
mip_node_nlpalg
Specifies which algorithm to use for standard node NLP subproblem solves in MIP (same options as nlp_algorithm user option).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the algorithm |
1 |
|
|
Use Interior (barrier) Direct algorithm |
2 |
|
|
Use Interior (barrier) CG algorithm |
3 |
|
|
Use Active Set SLQP algorithm |
4 |
|
|
Use Active Set SQP algorithm |
5 |
|
|
Run multiple algorithms (deprecated) |
6 |
|
|
Use Augmented Lagrangian algorithm |
mip_numthreads
Number of threads to use for MIP solvers.
Details
Choose any positive integer, or 0 = determine automatically.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
mip_opt_gap_abs
The absolute optimality gap stop tolerance for MIP.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
mip_opt_gap_rel
The relative optimality gap stop tolerance for MIP.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
mip_outinterval
Specifies node printing interval for mip_outlevel when mip_outlevel > 0.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
mip_outlevel
Specifies how much MIP information to print.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Nothing |
1 |
|
|
One line for every node |
2 |
|
|
Also print accumulated time every node |
3 |
|
|
Also print output from root node relaxation solve |
mip_outsub
Specifies MIP subproblem solve debug output control.
Details
This output is only produced if mip_debug = 1 and appears in the file kdbg_mip.log.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not print any debug output from subproblem solves. |
1 |
|
|
Subproblem debug output enabled, controlled by option outlev. |
2 |
|
|
Subproblem debug output enabled and print problem characteristics. |
mip_pseudoinit
Specifies the method used to initialize pseudo-costs corresponding to variables that have not yet been branched on in the MIP method.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the method |
1 |
|
|
Use average value |
2 |
|
|
Use strong branching |
mip_relaxable
Specifies whether integer variables are relaxable.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Integer variables not relaxable |
1 |
|
|
All integer variables are relaxable |
mip_restart
Specifies whether to enable the MIP restart procedure.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
MIP restart turned off |
1 |
|
|
MIP restart turned on |
mip_root_lpalg
Specifies which algorithm to use for root node LP subproblem solves in MIP (same options as lp_algorithm user option).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro automatically decide. |
0 |
|
|
Use algorithm specified in mip_root_nlpalg. |
1 |
|
|
Use Primal Simplex algorithm. |
2 |
|
|
Use Dual Simplex algorithm. |
3 |
|
|
Use Interior-Point/Barrier algorithm. |
4 |
|
|
Use Primal-Dual Linear Programming algorithm. |
mip_root_nlpalg
Specifies which algorithm to use for root node NLP solves in MIP (same options as nlp_algorithm user option).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the algorithm |
1 |
|
|
Use Interior (barrier) Direct algorithm |
2 |
|
|
Use Interior (barrier) CG algorithm |
3 |
|
|
Use Active Set SLQP algorithm |
4 |
|
|
Use Active Set SQP algorithm |
5 |
|
|
Run multiple algorithms (deprecated) |
6 |
|
|
Use Augmented Lagrangian algorithm |
mip_rounding
Specifies the MIP rounding rule to apply.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Let Knitro choose the rule |
0 |
|
|
Do not round if a node is infeasible |
2 |
|
|
Round using heuristic only (fast) |
3 |
|
|
Round and solve NLP if likely to succeed |
4 |
|
|
Always round and solve NLP |
mip_selectdir
Specifies the MIP node selection direction rule (for tiebreakers) for choosing the next node in the branch-and-bound tree.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Choose the less-than node first |
1 |
|
|
Choose the greater-than node first |
mip_selectrule
Specifies the MIP select rule for choosing the next node in the branch-and-bound tree.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Let Knitro choose the rule |
1 |
|
|
Search the tree depth first |
2 |
|
|
Node with the best relaxation bound |
3 |
|
|
Depth first unless pruned, then best bound |
mip_strong_candlim
Specifies the maximum number of candidates to explore for MIP strong branching.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
mip_strong_level
Specifies the maximum number of tree levels on which to perform MIP strong branching.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
mip_strong_maxit
Specifies the maximum number of iterations to allow for MIP strong branching solves.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
mip_sub_maxtime
Specifies the maximum allowable real time in seconds for MIP node subproblems.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
mip_terminate
Specifies conditions for terminating the MIP algorithm.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Terminate at optimum |
1 |
|
|
Terminate at first integer feasible point |
mip_zerohalf
Specifies rules for adding zero-half cuts.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically |
0 |
|
|
Do not add zero-half cuts |
1 |
|
|
Add cuts derived in the root node |
2 |
|
|
Add zero-half cuts in the whole tree |
Concurrent solver options
concurrent_lpalg
Specifies the LP algorithms to run concurrently when the concurrent solver is enabled on an LP.
Name |
|
API constant |
|
Type |
bitset |
Default |
|
Bit value |
Name |
Description |
|---|---|---|
-1 |
|
Automatically determine LP algorithm for concurrent solver |
0 |
|
Use algorithms specified in concurrent_nlpalg |
1 |
|
Enable Primal Simplex algorithm for concurrent solver |
2 |
|
Enable Dual Simplex algorithm for concurrent solver |
4 |
|
Enable Interior-Point/Barrier algorithm for concurrent solver |
8 |
|
Enable Primal-Dual Linear Programming algorithm for concurrent solver |
concurrent_maxsolves
Specifies the maximum number of solves when using the concurrent solver (should be more than 1 and <= numthreads).
Details
Knitro will automatically set the maximum solve limit based on numthreads if set to 0.
Name |
|
API constant |
|
Type |
integer |
Default |
|
concurrent_nlpalg
Specifies the NLP algorithms to run concurrently when the concurrent solver is enabled on an NLP.
Name |
|
API constant |
|
Type |
bitset |
Default |
|
Bit value |
Name |
Description |
|---|---|---|
-1 |
|
Automatically determine NLP algorithm for concurrent solver |
1 |
|
Enable Barrier Direct algorithm for concurrent solver |
2 |
|
Enable Interior Barrier CG algorithm for concurrent solver |
4 |
|
Enable Active-Set SLQP algorithm for concurrent solver |
8 |
|
Enable SQP algorithm for concurrent solver |
16 |
|
Enable Augmented Lagrangian algorithm for concurrent solver |
concurrent_outlog
Specifies the output logging options when the concurrent solver is enabled.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
1 |
|
|
Show all iteration information on all concurrent solves |
2 |
|
|
Show objective and feasibility error on all concurrent solves |
3 |
|
|
Show information from the current best concurrent solve iterate |
concurrent_solver
Specifies whether or not to enable the concurrent solver.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
-1 |
|
|
Determine automatically whether to enable the concurrent solver. |
0 |
|
|
Do not enable the concurrent solver. |
1 |
|
|
Enable the concurrent solver. |
Multi-start options
ms_enable
Whether to enable multistart to find a better local minimum.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Knitro solves from a single initial point |
1 |
|
|
Knitro solves using multiple start points |
ms_initpt_cluster
The strategy for clustering initial points in multi-start.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not apply clustering |
1 |
|
|
Apply single linkage based clustering |
ms_maxbndrange
Specifies the maximum range that an unbounded variable can vary over when multistart computes new start points.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
ms_maxsolves
How many Knitro solutions to compute if multistart is enabled.
Details
Choose any positive integer, or 0 means Knitro sets a default value depending on context.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
ms_num_to_save
How many feasible multistart points to save in file knitro_mspoints.log.
Details
Choose any positive integer, or 0 means save none.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
ms_numthreads
Number of threads to use in parallel multistart.
Details
Choose any positive integer, or 0 = determine automatically based on numthreads.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
ms_outsub
Enable writing algorithm output to files for the parallel multi-start procedure.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No output from subproblem solves |
1 |
|
|
Subproblem output enabled, controlled by option outlev. |
ms_savetol
Specifies the tolerance for deciding two feasible points are the same.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
ms_seed
Seed value used to generate random initial points in multi-start; should be a non-negative integer.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
ms_startptrange
Specifies the maximum range that any variable can vary over when multistart computes new start points.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
ms_sub_maxtime
Specifies, in seconds, the maximum allowable real time for multi-start subproblems.
Details
This is the time for local solves from a given initial point. This option has no effect unless ms_enable = yes.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
ms_terminate
Specifies conditions for terminating the multistart procedure.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Terminate after maxsolves |
1 |
|
|
Terminate at first local optimum |
2 |
|
|
Terminate at first feasible solution estimate |
3 |
|
|
Terminate at first completed solve |
4 |
|
|
Terminate when the estimated probability of finding a new local solution is low |
ms_terminaterule_tol
The tolerance in (0,1] for the rule-based termination of multi-start.
Details
Specifying a non-positive value will enable an automatic tolerance selection. Values closer to 1 trigger termination sooner, while values closer to zero will result in more solves before termination.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Maximum |
|
Default |
|
Parallelism options
blas_numthreads
Specify the number of threads to use for BLAS operations when blasoption = 1
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
concurrent_evals
Determines whether or not the user provided callback functions used for function and derivative evaluations can take place concurrently in parallel (for possibly different values of x).
Details
If it is not safe to have concurrent evaluations, then setting concurrent_evals = 0, will put these evaluations in a critical region so that only one evaluation can take place at a time. If concurrent_evals = 1 then concurrent evaluations are allowed when Knitro is run in parallel, and it is the responsibility of the user to ensure that these evaluations are stable.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Only one thread can perform an evaluation at a time |
1 |
|
|
Allow multi-threaded simultaneous evaluations |
conic_numthreads
Number of threads to do conic operations in parallel. Choose any positive integer, or 0 = determine automatically based on numthreads
Name |
|
API constant |
|
Type |
integer |
Default |
|
findiff_numthreads
Number of threads to use in finite-differencing.
Details
Choose any positive integer, or 0 = determine automatically based on numthreads
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
linsolver_numthreads
Specify the number of threads to use for linear system solve operations when linsolver = 6.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
numthreads
Specify the number of threads to use for parallel computing features.
Name |
|
API constant |
|
Type |
integer |
Minimum |
|
Default |
|
Output options
debug
Controls the level of debugging output.
Details
Debugging output can slow execution of Knitro and should not be used in a production setting. All debugging output is suppressed if option outlev = 0.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No debugging output |
1 |
|
|
Print algorithm information to kdbg*.log output files. |
2 |
|
|
Print program execution information. |
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.
Details
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.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No additional action |
1 |
|
|
Save the latest new point to file knitro_newpoint.knsol. Previous contents of the file are overwritten. |
2 |
|
|
Export one file per iteration with the new point, named knitro_newpoint_#.knsol where # is the iteration number. |
out_csvinfo
Controls whether or not to generate a file knitro_solve.csv containing solve information in comma separated format.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No csv solution file is generated |
1 |
|
|
Generate a solution file knitro_solve.csv |
out_csvname
Use to specify a custom csv filename when using out_csvinfo.
Name |
|
API constant |
|
Type |
string |
Default |
|
out_hints
Specifies whether to print diagnostic hints (e.g. about user option settings) after solving.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Do not print any hints. |
1 |
|
|
Print diagnostic hints on occasion. |
outappend
Specifies whether output should be started in a new file, or appended to existing files.
Details
The option affects knitro.log and files produced when debug = 1.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Erase existing files when opening |
1 |
|
|
Append to existing files |
outdir
Specifies a single directory as the location to write all output files.
Details
The option should be a full pathname to the directory, and the directory must already exist.
Name |
|
API constant |
|
Type |
string |
Default |
|
outlev
Controls the level of output produced by Knitro.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Printing of all output is suppressed |
1 |
|
|
Print only summary information |
2 |
|
|
Print basic information every 10 iterations |
3 |
|
|
Print basic information at each iteration |
4 |
|
|
Print basic information and the function count at each iteration |
5 |
|
|
Print all the above, and the values of the solution vector x |
6 |
|
|
Print all the above, and the values of the constraints c at x and the Lagrange multipliers lambda |
outmode
Specifies where to direct the output from Knitro.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Directed to standard output (stdout) |
1 |
|
|
Directed to a file (default name knitro.log, see option outname) |
2 |
|
|
Both standard output and file |
outname
Use to specify a custom filename when output is written to a file using outmode.
Name |
|
API constant |
|
Type |
string |
Default |
|
Tuner options
tuner
Indicates whether to invoke the Knitro-Tuner.
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Knitro Tuner turned off |
1 |
|
|
Knitro Tuner enabled |
tuner_optionsfile
Can be used to specify the location of a Tuner options file.
Name |
|
API constant |
|
Type |
string |
Default |
|
tuner_outsub
Enable writing additional Tuner subproblem solve output to files for the Knitro-Tuner procedure (tuner = 1).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
No output from subproblem solves and no subproblem summary file |
1 |
|
|
Subproblem output summary directed to a file knitro_tuner_summary.log |
2 |
|
|
Subproblem output enabled, controlled by option outlev. |
tuner_sub_maxtime
Specifies, in seconds, the maximum allowable real time for Knitro-Tuner subproblems (i.e. individual solves with a particular option setting).
Details
This option has no effect unless tuner = on.
Name |
|
API constant |
|
Type |
double |
Minimum |
|
Default |
|
tuner_terminate
Define the termination condition for the Knitro-Tuner procedure (tuner = 1).
Name |
|
API constant |
|
Type |
enum |
Default |
|
Value |
Name |
API constant |
Description |
|---|---|---|---|
0 |
|
|
Terminate after all Tuner runs complete |
1 |
|
|
Terminate at first local optimum |
2 |
|
|
Terminate at first feasible solution estimate |
3 |
|
|
Terminate at first completed solve |