Skip to main content

Custom heuristic implementation for MIQCP

Answered

Comments

4 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Yes, Gurobi supports callbacks for (MI)QCPs. The callback \(\texttt{where}\) you are looking for is \(\texttt{MIPSOL}\) which triggers when a new feasible solution has been found. In this callback, you can access the feasible solution via the cbGetSolution method. After improving the solution point via your heuristic, you can save this point and provide the improved solution point in the \(\texttt{MIPNODE}\) callback via the cbSetSolution method.

    Best regards,
    Jaromił

    0
  • Shuvomoy Das Gupta
    Gurobi-versary
    Conversationalist
    First Question

    Hi Jaromił,

    Thank you very much for your response. To clarify, for the heuristic, I need a fractional solution only that satisfies the linear constraints (I do not need a feasible solution of the MIQP), and I can generate a good feasible solution to the MIQP from that fractional solution because of a special structure present in the problem. In that situation, is my `where` still `MIPSOL`?

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi,

    In the MIPSOL callback you can access a feasible solution which satisfies all constraints of the given model, i.e., the solution will satisfy all linear and all quadratic constraints.

    I think what you are looking for is the \(\texttt{MIPNODE_REL}\) (\(\texttt{what}\)) of the \(\texttt{MIPNODE}\) callback, which returns the solution of the LP relaxation of a given node via the cbGetNodeRel method. This relaxation solution does not have to fulfill the quadratic constraints. However, it also does not have to fulfill the integer linear constraints, because it is a relaxation solution.

    If you are looking for a feasible point which fulfills all integer and continuous linear constraints, then you would have to create a new model without the quadratic parts and solve it separately.

    Best regards,
    Jaromił

    0
  • Shuvomoy Das Gupta
    Gurobi-versary
    Conversationalist
    First Question

    Hi Jaromił,

     

    Thanks very much for the update, the second paragraph is exactly what I need to access: a fraction solution to the LP relaxation (it does not need to satisfy the quadratic and/or integer constraints), the heuristic can generate an integer feasible solution to the MIQCP from the fractional solution based on the special structure of the problem.

     

    Best Regards,

    Shuvo 

    0

Please sign in to leave a comment.

Powered by Zendesk