Parameters
Parameters control the operation of the Cardinal Optimizer. They can be modified before the optimization begins. Each parameter has its own default value and value range. Before starting the solution, user can set the parameters to different values, so as to put forward specific requirements on the solution algorithm and solution process. Of course, the default settings can also be maintained.
According to the task performed by the solver COPT and the optimization problem solved, it can be divided into different types of parameters.
This chapter will introduce the parameters constants provided by COPT and their meanings.
Limits and tolerances
Name |
Type |
Description |
---|---|---|
Double |
Time limit of the optimization |
|
Double |
Time limit if a primal feasible solution has been found |
|
Integer |
Node limit of the optimization |
|
Integer |
Iteration limit of barrier method |
|
Double |
Input matrix coefficient tolerance |
|
Double |
The feasibility tolerance |
|
Double |
The tolerance for dual solutions and reduced cost |
|
Double |
The integrality tolerance for variables |
|
Double |
The relative gap of optimization |
|
Double |
The absolute gap of optimization |
TimeLimit
Double parameter.
Time limit of the optimization.
Default: 1e20
Minimal: 0
Maximal: 1e20
SolTimeLimit
Double parameter.
Time limit if a primal feasible solution has been found.
Default: 1e20
Minimal: 0
Maximal: 1e20
NodeLimit
Integer parameter.
Node limit of the optimization.
Default: -1 (Choose automatically)
Minimal: -1 (Choose automatically)
Maximal:
INT_MAX
BarIterLimit
Integer parameter.
Iteration limit of barrier method.
Default: 500
Minimal: 0
Maximal:
INT_MAX
MatrixTol
Double parameter.
Input matrix coefficient tolerance.
Default: 1e-10
Minimal: 0
Maximal: 1e-7
FeasTol
Double parameter.
The feasibility tolerance.
Default: 1e-6
Minimal: 1e-9.
Maximal: 1e-4
DualTol
Double parameter.
The tolerance for dual solutions and reduced cost.
Default: 1e-6
Minimal: 1e-9
Maximal: 1e-4
IntTol
Double parameter.
The integrality tolerance for variables.
Default: 1e-6
Minimal: 1e-9
Maximal: 1e-1
RelGap
Double parameter.
The relative gap of optimization.
Default: 1e-4
Minimal: 0
Maximal:
DBL_MAX
AbsGap
Double parameter.
The absolute gap of optimization.
Default: 1e-6
Minimal: 0
Maximal:
DBL_MAX
Presolving and scaling
Name |
Type |
Description |
---|---|---|
Integer |
Level of presolving before solving a model |
|
Integer |
Whether to perform scaling before solving a problem |
|
Integer |
Whether to dualize a problem before solving it |
Presolve
Integer parameter.
Level of presolving before solving a model.
Default: -1
Possible values:
-1: Choose automatically.
0: Off.
1: Fast.
2: Normal.
3: Aggressive.
4: No Limitations, continues until the model cannot be modified (may be very time-consuming).
Scaling
Integer parameter.
Whether to perform scaling before solving a problem.
Default: -1
Possible values:
-1: Choose automatically.
0: No scaling.
1: Apply scaling.
Dualize
Integer parameter.
Whether to dualize a problem before solving it.
Default: -1
Possible values:
-1: Choose automatically.
0: No dualizing.
1: Dualizing the problem.
Other parameters
Logging
Integer parameter.
Whether to print optimization logs.
Default: 1
Possible values:
0: No optimization logs.
1: Print optimization logs.
LogToConsole
Integer parameter.
Whether to print optimization logs to console.
Default: 1
Possible values:
0: No optimization logs to console.
1: Print optimization logs to console.
COPT provides operations related to logs, such as setting the logging file.
COPT provides functions to set the logging file, write the optimization logs into the specified file (with the file name suffix .log
), allowing users to save and review the logs. The functions for different programming interfaces are shown in Table 22:
Programming Interface |
Functions for setting logging files |
---|---|
C |
|
C++ |
|
C# |
|
Java |
|
Python |
|
Note: When calling these functions, users should specify the file name for saving logs using the logfile
parameter.
Basic Information
COPT outputs basic information before starting the solving process, depending on the problem types. The following information is typically displayed:
Model fingerprint: 2c27ab28
Hardware has 64 cores and 128 threads. Using instruction set X86_AVX512_E1 (14)
Minimizing a MIP problem
Here, Model fingerprint
represents the unique code for the current model.
The next output provides information about the hardware used, including the number of CPU cores (cores
) and threads (threads
).
Finally, the problem type and optimization sense are displayed, such as:
Minimizing an LP problem
, Minimizing a MIP problem
, and Minimizing an SDP problem
, etc.
Methods for accessing and setting parameters
In different programming interfaces, the ways to access and set information are slightly different. For details, please refer to the corresponding chapters of each programming language API reference manual:
C++ API: C++ API Reference: Parameters
C# API: C# API Reference: Parameters
Java API: Java API Reference: Parameters
Python API: Python API Reference: Parameters