Skip to main content

initial value of quadratic programming.

Answered

Comments

9 comments

  • Jaromił Najman
    • Gurobi Staff

    I wonder whether the initial value will affect the result of quadratic programming. 

    Yes, providing a (feasible) starting point can affect the optimization process independent of the model type.

     If so, how to set the initial value in c++?

    You can use the GRBVar::set() method to set the \(\texttt{GRB_DoubleAttr_Start}\) attribute of a variable. You can find an example of this in our C++ examples sensitivity_c++, multiscenario_c++, and facility_c++. In addition, the Knowledge Base article How do I use MIP starts? might be useful.

    0
  • Haoxiang li
    • Gurobi-versary
    • Conversationalist
    • First Question

    Thank you very much for your fast reply. One more question,  is gurobi able to handle the non-PSD problem? I have tried one, but it returns like this:

    Error code = 10020
    Objective Q not PSD 

     

    0
  • Jaromił Najman
    • Gurobi Staff

    Yes, you have to set the NonConvex parameter to 2, cf.,

    ERROR 10020: Objective Q not PSD

    0
  • Haoxiang li
    • Gurobi-versary
    • Conversationalist
    • First Question

    ok, thank you very much. I'll have a try. really thanks for your help

    0
  • Haoxiang li
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi, Najman. I have tried just now. When setting GRB_IntParam_NonConvex=2, the gurobi solver decided to solve as a MIP, and the speed was too slow. Any more ideas for solving non-PSD quadratic programming? A local minimum is also fine for me. But I really appreciate the speed if it is possible

    0
  • Jaromił Najman
    • Gurobi Staff

    Any more ideas for solving non-PSD quadratic programming? A local minimum is also fine for me. But I really appreciate the speed if it is possible

    Nonconvex models are hard, thus it is expected that they solve much slower than convex ones. If you are not interested in the global optimum, then you should adjust the MIPGap parameter to reflect this. Maybe already a 1% MIPGap is enough for your application. Additionally, you should take a look at the Most important parameters for MIPs (this also includes nonconvex continuous models). Maybe, you can find some parameters which improve the performance. You could try the Automatic Parameter Tuning tool to find them for you.

    0
  • Haoxiang li
    • Gurobi-versary
    • Conversationalist
    • First Question

    ok, I'll try them later. But I'm curious that some other solvers claim they can handle non-PSD quadratic programming. Why gurobi solver has to convert the problem to a MIP problem? is there any theory that converting to the MIP problem is better for non-PSD quadratic programming? And is it possible to still solve it as a continuous quadratic problem? 

    0
  • Jaromił Najman
    • Gurobi Staff

    But I'm curious that some other solvers claim they can handle non-PSD quadratic programming. Why gurobi solver has to convert the problem to a MIP problem? is there any theory that converting to the MIP problem is better for non-PSD quadratic programming? And is it possible to still solve it as a continuous quadratic problem? 

    Gurobi does not convert the model to a MIP. This is not even possible in general.

    The line "Solving as a MIP" indicates that Gurobi will branch on continuous variables and apply the spatial B&B algorithm as other solvers do.

    0
  • Haoxiang li
    • Gurobi-versary
    • Conversationalist
    • First Question

    ok, that makes sense. Thank you for helping me!

    0

Please sign in to leave a comment.