Compute IIS if problem is infeasible for solver COPT
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reviewing the COPT Python IIS example in the issue and then locate linopy's solver integration for COPT. Determine how infeasible solutions are represented and where solver diagnostics are exposed. Done means linopy can compute and report an IIS for infeasible COPT problems, including the relevant constraints and variables.
Written by the indexing model from the issue text.
Description
COPT has a python example of how to calculate the IIS to help debug infeasible solutions. It would be great to add this functionality to linopy.
Compute IIS if problem is infeasible
if model.status == COPT.INFEASIBLE:
Compute IIS
model.computeIIS()
Check if IIS is available
if model.hasIIS:
# Print variables and constraints in IIS
cons = model.getConstrs()
vars = model.getVars()
print("\n======================== IIS result ========================")
for con in cons:
if con.iislb or con.iisub:
print(' {0}: {1}'.format(con.name, "lower" if con.iislb else "upper"))
print("")
for var in vars:
if var.iislb or var.iisub:
print(' {0}: {1}'.format(var.name, "lower" if var.iislb else "upper"))
# Write IIS to file
print("")
model.writeIIS('iis_ex1.iis')
- Dominant language
- Python
- Stars
- 257
- Forks
- 87
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 32
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PyPSA/linopy
-
bug solver interface
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
documentation sparse
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
enhancement sparse
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Make the sparse path observable and controllable (.is_sparse, densify warning, per-call sparse=) Openenhancement sparse
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
enhancement performance sparse
Difficulty 4/5 3-5 days Newbie friendliness 68/100
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·