Skip to content

Two sided constraint is infeasible when the equivalent version using two one sided constraints is not #1129

@jnh277

Description

@jnh277

Describe the bug
Two sided constraint is infeasible when the equivalent version using two one sided constraints is not.

When I define the below two sided constraint the problem is infeasible

In this problem,
ramp_rate_delta is a positive parameter
meter_power_current and meter_power_previous are continuous variables
slack_below and slack_above are continuous non negative variables

model.addCons(
         -ramp_rate_delta
         <= ((
             meter_power_current
             - meter_power_previous
             + slack_below
             - slack_above)
             <= ramp_rate_delta
         ),
         name=f"ramp_rate_cons_{step}",
     )

However, when I formulate this using two single sided constraints the problem is feasible

    below_cons = model.addCons(
        -ramp_rate_delta
        <=
        meter_power_current
        - meter_power_previous
        + slack_below
    )

    above_cons = model.addCons(
        meter_power_current
        - meter_power_previous
        - slack_above
        <= ramp_rate_delta
    )

To Reproduce
Unsure if this helps, but I have saved the model file for both formulations and attached in zip file

formulations.zip

Expected behavior
The two seemingly equivalent formulations to both be feasible

System

  • OS: macOS tahoe
  • Version 26
  • SCIP version
  • installed using uv add pyscipopt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions