Weird result in GAP with negative best objective values and positive best bound values
回答済みAs the best objective value gets closer to 0, the GAP increases, which shouldn't happen, because the gap should be closing, right? I know this makes sense due to how the GAP is calculated, but it's weird when optimizing with objective values less than 0, as the GAP is needed to finish the process, because the best bound decreases very slowly.
So there could be a parameter that, when set to 1, calculates the GAP as (Best Bound - Best Objective) / Best Bound when the objective values are less than 0 and the best bound is greater than 0, and when set to 0, it calculates as usual.
Thanks, and sorry for the trouble.
-
Please see the article Why are there large or increasing MIP gap values?.
1 -
I'll add that the definition of MIP gap is somewhat subjective. For example, for relative MIP gap Gurobi uses |Z| as the denominator, GAMS uses max(|Z|, |B|) as a denominator, SCIP uses min(|Z|, |B|) as a denominator, BARON uses |B| as a denominator (where Z = obj val, B = obj bound).
If there is a MIP gap definition that is more intuitive to you, or your particular use case, then you can use callbacks to calculate it (see the following link for an example in Python: https://support.gurobi.com/hc/en-us/articles/360047717291-How-do-I-use-callbacks-to-terminate-the-solver). There are "message" functions in our APIs which can be used to write your gap value to console and log.
- Riley
0
サインインしてコメントを残してください。
コメント
2件のコメント