add_no_good_cuts

(function from pyomo.contrib.mindtpy.cut_generation)

pyomo.contrib.mindtpy.cut_generation.add_no_good_cuts(target_model, var_values, config, timing, mip_iter=0, cb_opt=None)[source]

Adds no-good cuts.

This adds an no-good cuts to the no_good_cuts ConstraintList, which is not activated by default. However, it may be activated as needed in certain situations or for certain values of option flags.

Parameters:
  • target_model (Block) – The model to add no-good cuts to.

  • var_values (list) – Variable values of the current solution, used to generate the cut.

  • config (ConfigBlock) – The specific configurations for MindtPy.

  • timing (Timing) – Timing.

  • mip_iter (Int, optional) – MIP iteration counter.

  • cb_opt (SolverFactory, optional) – Gurobi_persistent solver, by default None.

Raises:

ValueError – The value of binary variable is not 0 or 1.