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

Table 16 Limits and tolerances parameters

Name

Type

Description

TimeLimit

Double

Time limit of the optimization

SolTimeLimit

Double

Time limit if a primal feasible solution has been found

NodeLimit

Integer

Node limit of the optimization

BarIterLimit

Integer

Iteration limit of barrier method

MatrixTol

Double

Input matrix coefficient tolerance

FeasTol

Double

The feasibility tolerance

DualTol

Double

The tolerance for dual solutions and reduced cost

IntTol

Double

The integrality tolerance for variables

RelGap

Double

The relative gap of optimization

AbsGap

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

Table 17 Presolving and scaling parameters

Name

Type

Description

Presolve

Integer

Level of presolving before solving a model

Scaling

Integer

Whether to perform scaling before solving a problem

Dualize

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:

Table 22 Functions for setting logging files in different programming interfaces

Programming Interface

Functions for setting logging files

C

COPT_SetLogFile

C++

Model::SetLogFile()

C#

Model.SetLogFile()

Java

Model.setLogFile()

Python

Model.setLogFile()

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: