Skip to main content

How can I give weight to one of objective function in a multiple objective function?

Awaiting user input

Comments

2 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff 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 Gurobi Staff

    Hi Matin,

    Could you tell which variables are optimization variables and which variables are constants?

    Do you introduce \(\alpha\) as an optimization variable? If \(\texttt{df}\) and \(\texttt{df2}\) are constants and \(r,x,\alpha\) are optimization variables, then you could try the code

    import gurobipy as gp
    from gurobipy import GRB

    m.setObjective(gp.quicksum(df.SVI[j] * r[j] for j in CT)
    + gp.quicksum(df2[i][j] * x[i,j] * alpha for i in H for j in CT),
    GRB.MINIMIZE)

    If the above does not help, could you provide a minimal working example showing the issue?

    Best regards,
    Jaromił

    0

Post is closed for comments.