We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c797259 + f7453bc commit 42beef8Copy full SHA for 42beef8
src/GLPKInterfaceMIP.jl
@@ -509,7 +509,17 @@ end
509
510
getobjval(lpm::GLPKMathProgModelMIP) = GLPK.mip_obj_val(lpm.inner)
511
512
-getobjbound(lpm::GLPKMathProgModelMIP) = lpm.objbound
+function getobjbound(lpm::GLPKMathProgModelMIP)
513
+ # This is a hack. We observed some cases where mip_status == OPT
514
+ # and objval and objbound didn't match.
515
+ # We can fix this case, but objbound may still be incorrect in
516
+ # cases where the solver terminates early.
517
+ if GLPK.mip_status(lpm.inner) == GLPK.OPT
518
+ return GLPK.mip_obj_val(lpm.inner)
519
+ else
520
+ return lpm.objbound
521
+ end
522
+end
523
524
function getsolution(lpm::GLPKMathProgModelMIP)
525
lp = lpm.inner
0 commit comments