From c977a1f5fa4bcbb766b99cc732d58358738f9f39 Mon Sep 17 00:00:00 2001 From: Tim Quatmann Date: Tue, 5 Nov 2019 17:48:49 +0100 Subject: [PATCH] Fix for detecting infeasible models in glpk. --- src/storm/solver/GlpkLpSolver.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/storm/solver/GlpkLpSolver.cpp b/src/storm/solver/GlpkLpSolver.cpp index 76007fc91..68a34e57a 100644 --- a/src/storm/solver/GlpkLpSolver.cpp +++ b/src/storm/solver/GlpkLpSolver.cpp @@ -261,6 +261,7 @@ namespace storm { // Invoke mip solving error = glp_intopt(this->lp, parameters); + int status = glp_mip_status(this->lp); delete parameters; // mipgap.first has been set to the achieved mipgap (either within the callback function or because it has been set to this->maxMILPGap) @@ -268,7 +269,7 @@ namespace storm { // In case the error is caused by an infeasible problem, we do not want to view this as an error and // reset the error code. - if (error == GLP_ENOPFS) { + if (error == GLP_ENOPFS || status == GLP_NOFEAS) { this->isInfeasibleFlag = true; error = 0; } else if (error == GLP_ENODFS) {