Retrieve Pi values from the LP relaxation of a MIP problem with JuMP
AnsweredHello!
I would like to retrieve dual values of the LP relaxation of my MIP problem, that is being solved during B&B.
To give you a bit of context; I am using Julia and JuMP (and Gurobi of course) to solve a very large LP, for which I want to implement a lazy constraints' approach. To achieve that, I am adding a dummy integer variable to my problem to make it MIP and register a user-defined callback function. The process is completed successfully, but in the end I need to retrieve dual values, which are not available. Therefore, I have to revert my problem to its original LP version, add the "lazy" constraints and resolve. I have implemented this successfully, but I hope that there can be a more efficient approach in which I do not need to resolve my problem (which in effect is exactly the same problem as the LP relaxation solved by B&B).
Marilena
-
Hi Marilena,
You could try warm starting the LP, in particular:
i) save the solution vector
ii) use it to set the PStart variable attributes
iii) set DStart constraint attributes to 0
iv) set Method=2When you optimize you should see crossover kick in, and with any luck it will be faster than solving from scratch.
- Riley
0 -
Hi Riley, and thanks for your answer.
Could you please clarify, does this mean that the answer to my original question - retrieving duals during branch and bound - is “No, it is not possible”?
If it is not at all possible, I could try what you suggest. I have never considered warm-starting barrier before, and I usually disable crossover in those runs because it slows down the process considerably. If there is relevant documentation / guidance / a thread in the community that you are aware of, please direct me to it, it would be really helpful.
0 -
Hi Marilena,
does this mean that the answer to my original question - retrieving duals during branch and bound - is “No, it is not possible”?
Yes this is correct.
I usually disable crossover in those runs because it slows down the process considerably
You can keep crossover off for the first solve if this is the case, and enable it for the second.
If there is relevant documentation / guidance / a thread in the community that you are aware of, please direct me to it, it would be really helpful.
You can find a little bit more information on warm-starting in our docs for the LPWarmStart parameter. Note that you can just leave this parameter at its default value.
In terms of a guide, you'll want to understand how to do the following:
- retrieve and save the solution vector in JuMP
- set model (or constraint and variable) attributes in JuMP
- set model parameters in JuMP (it sounds like you're across this already)I would guess/hope you can find instructions on this in the JuMP docs. Then it's just a matter of putting it all together.
- Riley
0 -
Great, thanks again.
Marilena0 -
No problem, I'd be interested to hear how you go and what difference the warmstart with crossover makes.
- Riley
0
Please sign in to leave a comment.
Comments
5 comments