Skip to main content

Presolve Yields sub-Optimal Result (Bug tied to GenConstraint?)

Answered

Comments

3 comments

  • Marika Karbstein
    • Gurobi Staff

    Did you check the model you created? You could write the LP file with model.write("model.lp"). What are the values for p and v/w? Can you post the lp file here? 

    0
  • Alexander Paskov
    • Gurobi-versary
    • First Question
    • First Comment

    Thank you for the response! I can't seem to upload the LP file here (only jpeg, gif, or png are allowed), so here is a screenshot of the model.lp file itself:

    The values are as follows:

    P = [0.15539925, 0.06792077

           0.39277593, 0.26142169]

    V = [0.16961872, 0.08829835]

    This is a different instance than the one posted above, but the result is still the same — the x variables are all set to 0 and Gurobi claims the "optimal objective" is 0.2579. However, doing it by hand, setting x[0,0]=x[1,1]=1 is clearly feasible and yields a better objective of 0.2084.

     

    EDIT-APPEND: For the gen constraint, I added "FuncPieces=-2 FuncPieceError=0.0001" requirement to ensure it's not an approximation error of the log, but the results didn't change.

     

    0
  • Marika Karbstein
    • Gurobi Staff

    For the variables 

    a = model.addVars(m, vtype=gp.GRB.CONTINUOUS, name='a')
    no lower bound is defined. The default lower bound is 0. Hence, the solution you mention is not feasible.
    a = model.addVars(m, vtype=gp.GRB.CONTINUOUS, lb=-1, name='a')
    will give you x[0,0]=x[1,1]=1 as optimal solution.
    0

Please sign in to leave a comment.