Gurobi Solver plugin
ユーザーの入力を待っています。Hello All,
I am running my optimization problem on Pyomo, and trying to get the dual variables of my constraints by using:
model_Bi.dual = Suffix(direction=Suffix.IMPORT_EXPORT)
However, I get this error:
RuntimeError: ***The GUROBI solver plugin cannot extract solution suffix=dual
I couldn't find anything on that, dose anyone have experinece on this?
thanks
-
HI Shahin,
Can you check the model is solved to optimality and does not contain integer (including binary) variables?
- Riley
0 -
This is my result:
results
Out[58]: {'Problem': [{'Name': 'x1', 'Lower bound': -59236.27041095889, 'Upper bound': -59236.270410958896, 'Number of objectives': 1, 'Number of constraints': 3908, 'Number of variables': 3059, 'Number of binary variables': 852, 'Number of integer variables': 852, 'Number of continuous variables': 2207, 'Number of nonzeros': 19158, 'Sense': 'minimize'}], 'Solver': [{'Status': 'ok', 'Return code': '0', 'Message': 'Model was solved to optimality (subject to tolerances), and an optimal solution is available.', 'Termination condition': 'optimal', 'Termination message': 'Model was solved to optimality (subject to tolerances), and an optimal solution is available.', 'Wall time': '1.2149999141693115', 'Error rc': 0, 'Time': 1.5279500484466553}], 'Solution': [OrderedDict([('number of solutions', 0), ('number of solutions displayed', 0)])]}I do have binary variables but it's solved completely. Is this due to binary variables? if yes how can I extract duals then?!
0 -
Yes, dual values cannot be extracted when there are integer variables. Some users get dual values for MIPs following the method outlined in the below article (although it generally doesn't make sense in my opinion).
- Riley
0
サインインしてコメントを残してください。
コメント
3件のコメント