Get relaxed solution value in callback MIPNODE
回答済みHow do I retrieve the value of the relaxed solution using the Java API when my callback is called in a MIPNODE and CB_MIPNODE_STATUS is OPTIMAL?
In the documentation page I see:
MIPNODE_OBJBST MIPNODE double Current best objective.,
MIPNODE_OBJBND MIPNODE double Current best objective bound,
MIPNODE_REL MIPNODE double Relaxation solution for the current node, when its optimization status is GRB_OPTIMAL (C only).
The first and second ones provide the bound for the *integer* solution (right?), and the third one is only available from C (the JVM crash badly if I attempt to `getDoubleInfo(GRB.CB_MIPNODE_REL)`).
-
To access the node relaxation solution through the JAVA API, you have to use the GRBCallback.getNodeRel() method.
0 -
In that way I still have to compute the obj function value, is there any shortcut? (a workaround could be to assign the obj function to a single variable and then read its relaxed value...)
0 -
In that way I still have to compute the obj function value, is there any shortcut? (a workaround could be to assign the obj function to a single variable and then read its relaxed value...)
Unfortunately, there is currently no shortcut. Introducing an auxiliary variable to capture the value of the objective function is the correct way to go here.
0
サインインしてコメントを残してください。
コメント
3件のコメント