docplex.mp.constants module

class docplex.mp.constants.ComparisonType[source]

Bases: enum.Enum

This enumerated class defines the various types of linear constraints:

  • LE for e1 <= e2 constraints
  • EQ for e1 == e2 constraints
  • GE for e1 >= e2 constraints

where e1 and e2 denote linear expressions.

operator_symbol

Returns a string operator for the constraint.

Example

Returns string “<=” for a e1 <= e2 constraint.

Returns:A string describing the logical operator used in the constraint.
Return type:string
class docplex.mp.constants.ConflictStatus[source]

Bases: enum.Enum

This enumerated class defines the conflict status types.

class docplex.mp.constants.ObjectiveSense[source]

Bases: enum.Enum

This enumerated class defines the two types of objectives, Minimize and Maximize.

class docplex.mp.constants.RelaxationMode[source]

Bases: enum.Enum

This enumerated type describes the different strategies for model relaxation: MinSum, OptSum, MinInf, OptInf, MinQuad, OptQuad.

Relaxation algorithms work in two phases: In the first phase, they attempt to find a feasible solution while making minimal changes to the model (according to a metric). In the second phase, they attempt to find an optimal solution while keeping the relaxation at the minimal value found in phase 1.

Values of this type define two aspects of the algorithm:
  • whether or not they should continue to a second phase: all OptXxx values continue to a second phase, and MinXxx values stop at phase 1.
  • which metric to use for evaluating the relaxation in the first phase. There are three metrics:
    • the sum of relaxations for OptSum, MinSum, or
    • the total number of constraints being relaxed for OptInf, MinInf, or
    • the sum of squares of relaxations for OptQuad, MinQuad.
class docplex.mp.constants.SOSType[source]

Bases: enum.Enum

This enumerated class defines the SOS types:

  • SOS1 for SOS type 1
  • SOS1 for SOS type 2.