Presolve Yields sub-Optimal Result (Bug tied to GenConstraint?)
回答済みI'm solving the problem

I've gone through the forums and implemented it in Python as such

However, as shown in the following log, the pre-solve yields a sub-Optimal result. Is this possibly a bug related to the presolve? For reference, the optimal solution yields objective 0.363804 by setting x[1,0]=x[1,1]=1.

Any help would be greatly appreciated.
-
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 -
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 -
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
サインインしてコメントを残してください。
コメント
3件のコメント