Skip to content

Commit 2f473ba

Browse files
Apache license and appeal for volunteers (#1122)
* license and contributors * replace mit * improve iis docu * remove apache license for later
1 parent c2d8cfd commit 2f473ba

File tree

4 files changed

+56
-65
lines changed

4 files changed

+56
-65
lines changed

LICENSE

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
MIT License
22

3-
Copyright (c) 2023 Zuse Institute Berlin (ZIB)
3+
Copyright (c) 2025 Zuse Institute Berlin (ZIB)
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person btaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
116

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
148

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
10+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,23 @@ Please cite [this paper](https://opus4.kobv.de/opus4-zib/frontdoor/index/index/d
119119
}
120120
```
121121
as well as the corresponding [SCIP Optimization Suite report](https://scip.zib.de/index.php#cite) when you use this tool for a publication or other scientific work.
122+
123+
Seeking Maintainers
124+
----------------------------------
125+
126+
PySCIPOpt is sustained by volunteer effort, and as the project grows we are inviting more contributors and maintainers to join the team.
127+
128+
What needs to be done
129+
----------------------
130+
These are the core responsibilities:
131+
132+
* Community support: Going over the open issues regularly. Occasionally visiting Stack Overflow and OR.SE, as users also ask questions there.
133+
* PR review: Reviewing user pull requests, making sure that the CHANGELOG is updated, and all added methods are tested.
134+
* API coverage: keep expanding PySCIPOpt's coverage of SCIP's C API.
135+
* Documentation: help keep the documentation up to date, and add new tutorials/examples.
136+
* Releases: there should be a PySCIPOpt release with every SCIP release, at a minimum.
137+
138+
Even if you are not interested in becoming a maintainer, but would like to help out occasionally, that would be very welcome as well!
139+
140+
Send us an email over at **joao.goncalves.dionisio@gmail.com** if you're ready to take on the challenge :)
141+

docs/tutorials/iis.rst

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,18 @@ Let us create a simple infeasible model and then generate an IIS for it.
3333

3434
.. code-block:: python
3535
36-
from pyscipopt import Model
36+
x1 = model.addVar("x1", vtype="B")
37+
x2 = model.addVar("x2", vtype="B")
38+
x3 = model.addVar("x3", vtype="B")
3739

38-
m = Model()
39-
x1 = m.addVar("x1", vtype="B")
40-
x2 = m.addVar("x2", vtype="B")
41-
x3 = m.addVar("x3", vtype="B")
40+
# These four constraints cannot be satisfied simultaneously
41+
model.addCons(x1 + x2 == 1, name="c1")
42+
model.addCons(x2 + x3 == 1, name="c2")
43+
model.addCons(x1 + x3 == 1, name="c3")
44+
model.addCons(x1 + x2 + x3 <= 0, name="c4")
4245

43-
# These four constraints cannot be satisfied simultaneously
44-
m.addCons(x1 + x2 == 1, name="c1")
45-
m.addCons(x2 + x3 == 1, name="c2")
46-
m.addCons(x1 + x3 == 1, name="c3")
47-
m.addCons(x1 + x2 + x3 <= 0, name="c4")
48-
49-
model.optimize()
50-
iis = model.generateIIS()
46+
model.optimize()
47+
iis = model.generateIIS()
5148

5249
When you run this code, SCIP will output a log showing the progress of finding the IIS:
5350

@@ -82,14 +79,14 @@ When you run this code, SCIP will output a log showing the progress of finding t
8279
Num. Vars. in IIS : 3
8380
Num. Bounds in IIS : 6
8481
82+
After SCIP finds that the model is infeasible, see that SCIP's IIS finders alternate between including constraints to make the problem feasible, and removing constraints to make the problem as small as possible.
83+
You see in the final statistics that the IIS is indeed irreducible, with 3 variables and 2 constraints.
84+
8585
.. note::
8686
While an already optimized infeasible model is not required to use the IIS functionality, it is
8787
encouraged to call this functionality only after ``model.optimize()``. Otherwise, SCIP will naturally optimize
8888
the base problem first to ensure that it is actually infeasible.
8989

90-
After SCIP finds that the model is infeasible, see that SCIP's IIS finders alternate between including constraints to make the problem feasible, and removing constraints to make the problem as small as possible.
91-
You see in the final statistics that the IIS is indeed irreducible, with 3 variables and 2 constraints.
92-
9390
The IIS Object
9491
==============
9592

@@ -98,7 +95,7 @@ The ``IIS`` object returned by ``generateIIS()`` can be queried to access the fo
9895
- **time**: The CPU time spent finding the IIS
9996
- **irreducible**: Boolean indicating if the IIS is irreducible
10097
- **nodes**: Number of nodes explored during IIS generation
101-
- **model**: A ``Model`` object containing the subscip with the IIS constraints
98+
- **subscip**: A ``Model`` object containing the subscip with the IIS constraints
10299

103100
You can interact with the subscip to examine which constraints and variables are part of the IIS:
104101

@@ -125,47 +122,31 @@ for identifying infeasible subsystems.
125122
Basic Structure
126123
---------------
127124

128-
To create a custom IIS finder, inherit from the ``IISfinder`` class and implement the ``iisfinderexec`` method:
125+
To create a custom IIS finder, inherit from the ``IISfinder`` class and implement the ``iisfinderexec`` method.
126+
This IISfinder just directly removes two constraints in the example above to yield an IIS:
129127

130128
.. code-block:: python
131129
132-
from pyscipopt import Model, IISfinder, SCIP_RESULT
130+
from pyscipopt import IISfinder, SCIP_RESULT
133131
134132
class SimpleIISFinder(IISfinder):
135133
"""
136-
A simple IIS finder that removes constraints one by one
137-
until the problem becomes feasible.
134+
Minimal working example: keep a known infeasible subset (by name)
135+
and mark it as the IIS.
138136
"""
139137
140138
def iisfinderexec(self):
141139
subscip = self.iis.getSubscip()
142-
constraints = subscip.getConss()
143-
144-
# Start with all constraints
145-
active_constraints = set(constraints)
146-
147-
for cons in constraints:
148-
# Temporarily remove the constraint
149-
active_constraints.discard(cons)
150-
151-
# Check if remaining constraints are still infeasible
152-
# (This would require setting up a sub-problem with only active_constraints)
153-
# For simplicity, we use the full solve approach here
154-
155-
subscip.freeTransform()
156-
subscip.delCons(cons)
157-
subscip.optimize()
158-
159-
if subscip.getStatus() == SCIP_STATUS.INFEASIBLE:
160-
# Still infeasible without this constraint
161-
# Keep it removed
162-
pass
163-
else:
164-
# Feasible without it, so constraint is needed in IIS
165-
active_constraints.add(cons)
166-
# In practice, you'd recreate the subscip with all active constraints
167-
168-
iis.markIrreducible()
140+
141+
# keep only constraints {c2, c4} and delete others
142+
keep = {"c2", "c4"}
143+
for cons in list(subscip.getConss()):
144+
if cons.name not in keep:
145+
subscip.delCons(cons)
146+
147+
# Tell SCIP that our sub-SCIP represents an (irreducible) IIS
148+
self.iis.setSubscipInfeasible(True)
149+
self.iis.setSubscipIrreducible(True)
169150
return {"result": SCIP_RESULT.SUCCESS}
170151
171152
Including Your Custom IIS Finder
@@ -186,6 +167,7 @@ To use your custom IIS finder, include it in the model before calling ``generate
186167
model.addCons(x1 + x2 == 1, name="c1")
187168
model.addCons(x2 + x3 == 1, name="c2")
188169
model.addCons(x1 + x3 == 1, name="c3")
170+
model.addCons(x1 + x2 + x3 <= 0, name="c4")
189171
190172
# Create and include the custom IIS finder
191173
simple_iis = SimpleIISFinder()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = [
1111
dependencies = ['numpy >=1.16.0']
1212
requires-python = ">=3.8"
1313
readme = "README.md"
14-
license = {text = "MIT"}
14+
license = {text = "MIT License"}
1515
classifiers = [
1616
"Development Status :: 4 - Beta",
1717
"Intended Audience :: Education",

0 commit comments

Comments
 (0)