メインコンテンツへスキップ

Against all common sense I attempted (a special type of) branch-and-price. How am I shooting myself in the foot, exactly?

進行中

コメント

2件のコメント

  • 正式なコメント
    Tobias Achterberg
    Gurobi Staff Gurobi Staff

    You are adding variables with model.addVar() from within your callback? This just cannot work. What you have in your hand as a user is the original user model. But the branch-and-cut is performend on a different model, namely the presolved model. Moreover, the LP relaxation is yet another model. Even if you could modify the user model from within your callback, there is nothing in Gurobi's source code that would then transfer the changes to the presolved model and to the LP relaxation.

    I would claim that the model.addVar() call is just doing nothing (except raising the exception). How do you see that the variables are added to the model (your point 8)?

    Regards,

    Tobias

  • Alberto Santini
    Gurobi-versary
    Curious
    Conversationalist

    Hi Tobias.

    First of all, thanks for replying and the explanation. I was checking point 8. from calling \(\texttt{model.write()}\) at the end, but then I must have been mistaken.

    So, just to be clear: there is no way (hacky or legitimate) to add a variable to a model once it's being solved, even if this variable is continuous and valid in all nodes of the tree, right? Even if I add a callback, copy the model, fix the variables, get the duals and solve a pricing subproblem, then I have absolutely no way to insert the resulting column back into the model while it is solved, right? If I were to abort the optimisation, add the column, and call \(\texttt{optimize()}\) again, would I lose all information about the B&B tree generated up to that point?

     

    0

サインインしてコメントを残してください。