linopy.model.Model.apply_sos_reformulation

linopy.model.Model.apply_sos_reformulation#

Model.apply_sos_reformulation()#

Reformulate SOS constraints into binary + linear form, in place.

The reformulation token is stored on the model so it can be reverted with undo_sos_reformulation(). This is the stateful counterpart to linopy.sos_reformulation.reformulate_sos_constraints(), where the caller owns the token.

Raises:

RuntimeError – If a reformulation has already been applied and not undone.