Skip to main content

Model Infeasible by solving multi-objective model

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 John,

    By using

    C_epsilon = m.addConstr(f2 == e)

    in the \(\texttt{for}\)-loop, you are adding new constraints, instead of modifying the old one. What you are looking for is

    C_epsilon.RHS = e

    in the \(\texttt{for}\)-loop.

    Please note that for LPs, there are possibly better ways to obtain the Pareto Front than using the \(\epsilon\)-method, e.g., Aneja & Nair 1979, Cohon 1978, Ehrgott 2000.

    Best regards,
    Jaromił

    Best regards,
    Jaromił

    0
  • John Raphy Karippery
    • Gurobi-versary
    • Investigator
    • Collaborator

    Hello Jaromił,

    Thank you so much for your help and referances.
    all referances you mention are not free so I need to find another way find that referances.

    I have one more question about the lower and upper bounds (f2_min,f2_max ). Here in my code I pre defined value. 

    Is there any simple way to find f2_min and f2_max in gurobi? 

    Here I submit code for argument e-constraint. that will help for others:

    # deactivate all objective 
    # remove C_epsilon = m.addConstr(f2 == e)


    m.optimize()
    x1_l = []
    x2_l = []
    e=0
    delta = 0.00001
    s = m.addVar(vtype=GRB.CONTINUOUS)
    O_f1 = m.setObjective(f1+(delta*s), GRB.MAXIMIZE)
    C_e = m.addConstr(f2-s == e)

    for i in range(160,190,6):
         e = i
         C_e.RHS = e
         m.optimize()
         v=m.getVars()
         x1_l.append(v[0].x)
         x2_l.append(v[1].x)

    plt.plot(x1_l,x2_l,'o-.');
    plt.title('efficient Pareto-front');
    plt.grid(True);

    Thank you
    john Karippery

    1
  • Jaromił Najman
    • Gurobi Staff

    Hi John,

    Is there any simple way to find f2_min and f2_max in gurobi? 

    You can find the f2_min and f2_max values by minimizing and maximizing the underlying model and setting f2 as its objective. So basically change

    o_f1 = m.setObjective(f1,GRB.MAXIMIZE)

    to

    o_f2 = m.setObjective(f2,GRB.MAXIMIZE)
    m.optimize()
    f2_max = m.ObjVal
    o_f2 = m.setObjective(f2,GRB.MINIMIZE)
    m.optimize()
    f2_min = m.ObjVal

    and then proceed with the rest of your code.

    Best regards,
    Jaromił

    0

Post is closed for comments.