Skip to main content

Very long solving time

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Hi,

    Non-convex problems don't have to be large to be challenging.

    I have written your problem to an \(\texttt{LP}\) file by using the Model.write() function and am referring to the variables and constraints found therein.

    For non-convex quadratic programs, we recommend to always provide bounds on variables occurring non-linearly in the model. In your case these, this would be variables \(\texttt{y, z, a0, b0, c0, e0, a1, b1, c1, e1, h, d}\). Moreover, it is important that these bounds are as tight as possible, e.g., for \(\texttt{Delta0[0]}\) the bounds \([-1,1]\) are valid bounds, because constraint \(\texttt{c64}\) states that \(\texttt{Delta0[0] = - x[188] + x[189]}\) and all \(x\) variables are in \([0,1]\) . This is especially important for variables for which it is not so easy for the solver to deduce valid lower and upper bound.

    It may be advantageous to replace the integer variables occurring in the quadratic constraints by continuous ones. In your case this can be done for, e.g., \(\texttt{Delta0[0]}\) by replacing \(\texttt{Delta0[0]}\) by \(\texttt{- x[188] + x[189]}\) as for constraint \(\texttt{c64}\).

    Another idea would be to try a different formulation for your problem, in best case one with less integers and quadratic constraints. Do you know if there is any alternative formulation for your application in the literature?

    Best regards,
    Jaromił

    0
  • Umair Sindhu
    • First Question
    • Gurobi-versary
    • Conversationalist

    Respected Sir 

    Thank you so much for your response.

    I forgot to mention that actually I want to minimize the distance d, and want to find a suitable Dalta0 and Dalta1 as well. So I can't replace it. However, I will try the problem with tight bounds for the variables you have mentioned. 

    Sir, geometrically my problem is a polyhedron and convex, but I am getting an error while compilation and asking to set the nonconvex parameter to 2, that's why I did that. Moreover, my problem got universal and existential quantifiers, and I have reformulated it by using Affine Form of Farkas Lemma to get a quantifier-free problem. 

    http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.30.8036

    Affine Form of Farkas Lemma is given on page 16  as Theorem 7. To apply this lemma I have to introduced 456 auxiliary variables, and due to this, I am getting a lot of bilinear terms in constraints that make this problem quadratic as well.   

    Presently, I don't know any other formulation. However, If I get to know some other technique to get rid of the quantifiers then this problem would be very small. 

    Any help in this regard will be highly appreciated. 

    Thanks 

    Umair

     

     

     

    0
  • Jaromił Najman
    • Gurobi Staff

    Dear Umair,

    Ok, so you applied the Affine Form of Farkas Lemma to get rid of quantifiers and this resulted in many bilinear terms. Did you try formulating the logic quantifiers via the introduction of binary variables as recommended by Eli in your previous post?

    For example, if you have a constraint like \(\exists x_i = 1, i \in\{1,2\}, x_i \in \{0,1\}\), you can reformulate it as \(x_1 + x_2 \geq 1\). Like this, you can avoid the addition of many bilinear terms, which may indeed be more complex than solving a linear integer problem of a similar size.

    Best regards,
    Jaromił    

    0

Post is closed for comments.