Skip to main content

Convex Programming

Answered

Comments

4 comments

  • Jaromił Najman
    • Gurobi Staff

    Yes, as long as Gurobi is able to recognize your model as convex, it can solve it to global optimality.

    What kind of model do you have in mind?

    0
  • Oshan Maduwage
    • First Comment
    • First Question

    Thanks for your response.

    In my model, the objective function is a sum of a few Euclidian norms and constraints are some linear inequalities. How does Gurobi work for this kind of a situation?

    0
  • Jaromił Najman
    • Gurobi Staff

    Gurobi should be able to recognize the objective to be a convex quadratic term. It would then use the QP Simplex method or the quadratic Barrier method to solve the model.

    In order to construct your model, you can use the addGenConstrNorm method to add your Euclidean norm terms. Since the addGenConstrNorm method creates an equality constraint with an optimization variable as result, you would have to introduce an auxiliary variable for each Euclidean Norm. So your model would look something like this

    aux1 = model.addVar(obj=1, name="aux1")
    model.addGenConstrNorm(aux1, [list of variables in the Euclidean norm], 2.0, name="norm_1")
    aux2 = model.addVar(obj=1, name="aux2")
    model.addGenConstrNorm(aux2, [list of variables in the Euclidean norm], 2.0, name="norm_2")
    ...

    The above code snippet creates a model of the form

    \[\begin{align*}
    \min \,\,\,&\text{aux}_1 + \text{aux}_2 + \dots\\
    \text{s.t.} \,\,\, &\text{aux}_1 = \sqrt{\sum \text{vars}^2} \\
     &\text{aux}_2 = \sqrt{\sum \text{vars}^2}
    \end{align*}\]

    Best regards, 
    Jaromił

    0
  • Oshan Maduwage
    • First Comment
    • First Question

    Thank you very much Jaromił; it was really helpful

     I will proceed accordingly. If we get any quires, we will reply on this comment chain.

    Kind regards,

    Oshan

     

     

    0

Please sign in to leave a comment.