After creating a LP model, I want to parse the constraints to get some constraint-variable information
For example.
I want to find out what constraints used a specific variable.
if I want to search for variable 'x' and the constraints used in lp are the following
c0: x + y <= 2
c1: x + z <= 5
c2: y + z <= 10
I should get c0 and c1 as the constraints that use x.
Another reason is that I would like to find out what variables a particular constraint is using
if constraint is c0: x + y + z <= 2
I want to return variables x, y and z as the variables used in this constraint
I know I can get the variables and their values in gurobi, but have not been able to find anything regarding the question I have posed here
You do this via a programming language. Here is some sample code in Python: