linopy icon indicating copy to clipboard operation
linopy copied to clipboard

Infeasible constraint ignored

Open MiftariB opened this issue 2 months ago • 0 comments

Version Checks (indicate both or one)

  • [x] 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

linopy 0.5.8

MiftariB avatar Oct 31 '25 14:10 MiftariB