summaryrefslogtreecommitdiffhomepage
path: root/ir/lpp
diff options
context:
space:
mode:
authorManuel Mohr <manuel.mohr@kit.edu>2013-01-24 15:48:30 +0100
committerManuel Mohr <manuel.mohr@kit.edu>2013-01-24 15:58:27 +0100
commit2b7deedf330144e8660c7be97c0267cd4daf925b (patch)
tree60f8be72ebf794abe81fc56283def860265e5243 /ir/lpp
parentd533f130ac25f9f0f521d79e624b04db016091e5 (diff)
lpp: Do not allow Gurobi to violate the optimality.
Diffstat (limited to 'ir/lpp')
-rw-r--r--ir/lpp/lpp_gurobi.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ir/lpp/lpp_gurobi.c b/ir/lpp/lpp_gurobi.c
index 5f882dd..6e261be 100644
--- a/ir/lpp/lpp_gurobi.c
+++ b/ir/lpp/lpp_gurobi.c
@@ -171,6 +171,18 @@ static void gurobi_solve(gurobi_t *grb)
check_gurobi_error(grb, error);
}
+ /* The MIPGAP parameter determines when we consider a solution optimal.
+ * To quote the documentation:
+ * "The MIP solver will terminate (with an optimal result) when the
+ * relative gap between the lower and upper objective bound is less
+ * than MIPGap times the upper bound."
+ * The default value of MIP gap is 1e-4, we set it to 0.0.
+ * Otherwise, we sometimes produce an inferior solution (according
+ * to our cost model) compared to heur4.
+ */
+ error = GRBsetdblparam(grb->modelenv, GRB_DBL_PAR_MIPGAP, 0.0);
+ check_gurobi_error(grb, error);
+
/* solve */
error = GRBoptimize(grb->model);
check_gurobi_error(grb, error);