Dual values with gurobi

11 views
Skip to first unread message

H.Henke

unread,
Nov 25, 2021, 10:59:16 AM11/25/21
to OSeMOSYS
Hi,
after the previous discussion around how to use dual values, I have started looking into how to get the dual values when running models with gurobi.
When running from the command prompt/terminal I didn't find an option.
However, when using python and gurobipy (the python package by gurobi), I managed to get some dual values following the information in the documentation
I coded something like:

import gurobipy
m = gurobipy.read(lp_file)
m.optimize()
dual = m.Pi

Unfortunately in this code dual turns out to be a list. I tried to figure out if there is an option to specify for which constraint one wants to get the dual but couldn't find anything useful, apart from this questions on stackoverflow - which is unanswered...

If someone know on this it would be great if you could share!
Thanks a lot for your time!

Best regards,
Hauke
Reply all
Reply to author
Forward
0 new messages