Skip to content

Commit ebed3b0

Browse files
feat: termination condition map for SCIP solver
1 parent 0cc89ac commit ebed3b0

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

doc/release_notes.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
Release Notes
22
=============
33

4-
.. Upcoming Version
5-
.. ----------------
4+
Upcoming Version
5+
----------------
66

7+
**Bug Fixes**
8+
9+
* Improve the mapping of termination conditions for the SCIP solver
710

811
Version 0.5.3
912
--------------

linopy/solvers.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,23 @@ def solve_problem_from_file(
13411341
-------
13421342
Result
13431343
"""
1344-
CONDITION_MAP: dict[str, str] = {}
1344+
CONDITION_MAP: dict[str, str] = {
1345+
# https://github.com/scipopt/scip/blob/b2bac412222296ff2b7f2347bb77d5fc4e05a2a1/src/scip/type_stat.h#L40
1346+
"inforunbd": TerminationCondition.infeasible_or_unbounded,
1347+
"userinterrupt": TerminationCondition.user_interrupt,
1348+
"terminate": TerminationCondition.user_interrupt,
1349+
"nodelimit": TerminationCondition.terminated_by_limit,
1350+
"totalnodelimit": TerminationCondition.terminated_by_limit,
1351+
"stallnodelimit": TerminationCondition.terminated_by_limit,
1352+
"timelimit": TerminationCondition.time_limit,
1353+
"memlimit": TerminationCondition.terminated_by_limit,
1354+
"gaplimit": TerminationCondition.terminated_by_limit,
1355+
"primallimit": TerminationCondition.terminated_by_limit,
1356+
"duallimit": TerminationCondition.terminated_by_limit,
1357+
"sollimit": TerminationCondition.terminated_by_limit,
1358+
"bestsollimit": TerminationCondition.terminated_by_limit,
1359+
"restartlimit": TerminationCondition.terminated_by_limit,
1360+
}
13451361

13461362
io_api = read_io_api_from_problem_file(problem_fn)
13471363
sense = read_sense_from_problem_file(problem_fn)

0 commit comments

Comments
 (0)