Skip to content

Infeasible constraint ignored #517

Description

@MiftariB

Version Checks (indicate both or one)

  • I have confirmed this bug exists on the lastest release of Linopy.

  • I have confirmed this bug exists on the current master branch of Linopy.

Issue Description

The infeasible constraints that only use parameters are ignored by the solving phase that returns that the solution is optimal.

Reproducible Example

import linopy 

model = linopy.Model()
x = model.add_variables([0], [10], name="x")
model.add_constraints(linopy.LinearExpression(12, model)==linopy.LinearExpression(13, model))
model.add_objective(x, "minimize")
model.solve()

Expected Behavior

It should return infeasible

Installed Versions

Details linopy 0.5.8

Activity

  1. RobbieKiwi commented on Dec 7, 2025

    @RobbieKiwi
    Contributor

    The constraint that you make there is saying that 12 should equal 13 which is a bit strange. The fact that you can make such a constraint in the first place is an issue that I try to address in this pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions