docplex.mp.sdetails module

class docplex.mp.sdetails.SolveDetails(time=0, status_code=-1, status_string=None, problem_type=None, ncolumns=0, nonzeros=0, miprelgap=None, best_bound=None)[source]

Bases: object

The SolveDetails class contains the details of a solve.

This class should never be instantiated. You get an instance of this class from the model by calling the property docplex.mp.model.Model.solve_details.

best_bound

This property returns the MIP best bound at the end of the solve.

Note

  • This property returns NaN when the problem is not a MIP.
columns

This property returns the number of columns.

get_best_bound()[source]

This property returns the MIP best bound at the end of the solve.

Note

  • This property returns NaN when the problem is not a MIP.
get_mip_relative_gap()[source]

This property returns the MIP relative gap.

Note

  • This property returns NaN when the problem is not a MIP.
  • The gap is returned as a floating-point value, not as a percentage.
get_nb_columns()[source]

This property returns the number of columns.

get_nb_linear_nonzeros()[source]

This property returns the number of linear non-zeros in the matrix solved.

get_problem_type()[source]

This property returns the problem type as a string.

get_status()[source]

This property returns the solve status as a string.

Example

  • Returns “optimal” when the solution has been proven optimal.
  • Returns “feasible” for a feasible, but not optimal, solution.
  • Returns “MIP_time_limit_feasible” for a MIP solution obtained before a time limit.
get_time()[source]

This property returns the solve time in seconds.

has_hit_limit()[source]

Checks if the solve details indicate that the solve has hit a limit.

Returns:True if the solve details indicate that the solve has hit a limit.
Return type:Boolean
mip_relative_gap

This property returns the MIP relative gap.

Note

  • This property returns NaN when the problem is not a MIP.
  • The gap is returned as a floating-point value, not as a percentage.
nb_linear_nonzeros

This property returns the number of linear non-zeros in the matrix solved.

problem_type

This property returns the problem type as a string.

status

This property returns the solve status as a string.

Example

  • Returns “optimal” when the solution has been proven optimal.
  • Returns “feasible” for a feasible, but not optimal, solution.
  • Returns “MIP_time_limit_feasible” for a MIP solution obtained before a time limit.
time

This property returns the solve time in seconds.