Descrepency in results and a computation check
Awaiting user inputI have coded my model in Pyomo. And I solved it using both GLPK and Gurobi
Although the results for the decision variables are the same, the results for other variables are different.
Therefore, I wrote a piece of code to compute the the values of other variables conditined to values of optimize decision variables. So I have 4 secnario for one variable: 1) result of optimization model for Pyomo-GLPK, 2)Result of optimization model for Pyomo-Gurobi, 3)Computation of variable based on Pyomo-GLPK model and extracted decision variable 4) Computation of variable based on Pyomo-Gurobi model and extracted decision variable
The value in scenario 2 is different from the other 3 scenario.
I don't know how to evaluate this observation
-
Could you provide more details about the problem? It may have multiple solutions. As long as the optimal objective value is the same (w.r.t. some tolerance), there is nothing to worry about if two different solvers result in different solution vectors.
0 -
Hi Marika,
Thanks for the response.
Actually the differences are not negligible.
My optimization model is a Minimization of function of expected value and variance of my decison variable over time. The decision variable is binory. So the objective function is something like this:
Minimize alpha*E_t + (1-alpha)* V_t
E_t and V_t are of some functions of my binary decision variable X ; X had 2 dimansions.
I ran the model for different values of alpha and I wanted to compare the results for alpha=0.5. So, I extracted and stored the values for this instance.
Between Pyomo-GLPK and Pyomo-Gurobi, the values of X is the same. But the values of E-t and V_t do not look the same at all.
So I tried to compute E_t and V_t for my different scenarios.
If I use Pyomo value() function, I get outputs equal to E_t and V_t of Pyomo-GLPK model in both jupyter notebooks. If I use stored values for alpha=0.5, I get the initial descrepency.
I hope it is a bit clearer now,
Shirin
0 -
Do you mean by “the differences are not negligible” that the optimal values for both runs differ although the model is the same?
Could you be more concrete about E_t and V_t? If they are functions of X, and the values of X are the same in both runs, how can E_t and V_t differ for both runs?0
Please sign in to leave a comment.
Comments
3 comments