Skip to main content

Invalid argument to QuadExpr multiplication for product of more than 2 variables

Awaiting user input


1 comment

  • Gurobot (AI-generated response)
    Gurobi Staff Gurobi Staff

    To optimize an objective function involving the 1-norm (sum of absolute values) of a matrix in Gurobi, you can linearize the absolute values. For each element aij of your matrix, introduce two non-negative variables uij and vij, and set aij=uij−vij and ∣aij∣=uij+vij. Add constraints to ensure uij≥0 and vij≥0. This approach converts the absolute values into a linear form, which Gurobi can handle.


Please sign in to leave a comment.