Finding the domain(s) of variables in a Linear Program using the constraints? (Constraint programming/Linear programming)
Answered
I have a very trivial constraint set from variables of continuous domains (the constraints of a linear program). However, this problem will have to be solved at scale (hence Gurobi). All constraints are equality constraints. I'll give a small example (but will have to code the solution to scale):
x1=0.01
x1+x2=0.02
x1+x2+x3=0.02
x1+x2+x3+x4+x5=0.05
x1, x2, x3, x4, x5<=1
The solution will be something like this:
x1=0.01
x2=0.01
x3=0.0
x4=[0,0.03]
x5=[0,0.03]`
Now the first three variables could be obtained by row reduction ; the other variables may also be confined to smaller domains by pre-solve. If this is the case, is there a way to output these results before going on to solve the linear program?
Thank you in advance for any answers or suggestions
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
You cannot obtain a partial solution after presolving. Most likely, Gurobi does the presolving reductions and implications automatically in such a case. You should still consider a different modeling approach if you already know the values for a large part of the solution.
Cheers,
Matthias1 -
Hello Matthias,
Thank you so much for the prompt response. I just wanted to clarify; that the pre solve solution's row reductions do not even give the exact values (x1, x2 and x3 in my example) which are removed from the optimization model; if I were to assign an object, m=model.presolve() on the Python API, I cannot query the eliminated variables (x1, x2, x3) in any way?
Regarding x4 and x5, I do understand their ranges can possibly not be queried. Thanks again!
0 -
Dear Prasanna,
You cannot query partial solutions. You need to have at least one feasible solution to query the values of the variables in this solution. Bound reductions ar fixings can also not be queried.
Cheers,
Matthias0
Post is closed for comments.
Comments
4 comments