Originally posted by: zoldfish
Hi
I am using CPlex 12.1, Concert Technology. I have some problems on finding and using extreme rays.
1. Here is the FAQ I consult:
Link:
http://www-01.ibm.com/support/docview.wss?uid=swg21400058 It says that if the primal problem is infeasible which is my situation and primal simplex optimizer is in use, I should use getDuals function. However, here is the description of method getDuals in the C++ API manual:
getDuals
public void getDuals(IloNumArray val, const IloRangeArray con) const
This method puts the dual values associated with the ranges in the array con into the array val. Array val is resized to the same size as array con, and val[i] will contain the dual value for constraint con[i].
Then how should I use this method to get extreme rays? Is it the situation that when the primal function is infeasiable when I use this method it will automatically give me the extreme ray instead of the dual solutions of the primal problem?
2.According to the link above, if the primal problem is infeasible and dual simplex optimizer is in use, then I can simply use getRay method to get extreme rays. I also wonder how should I use this method and what it will give me in return.
3.If the primal problem is unbounded naturally I can use getRay to get extreme rays. But here is the description of this method:
getRay
public void getRay(IloNumArray vals, IloNumVarArray vars) const
This method returns an unbounded direction (also known as a ray) corresponding to the present basis for an LP that has been determined to be an unbounded problem. CPLEX puts the the nonzero values of the unbounded direction into the array vals, and it puts the corresponding variables of the extracted model into the array vars.
I noticed that it only returns the nozero values of the direction instead of all values. If I am under this situation:
Primal problem has 3 variables x1, x2, x3, and this problem is proven unbounded. Then I use method getRay(IloNumArray vals, IloNumVarArray vars) and in result vars contains only x1 and x3, with their corresponding values in vals. If I want to calculate the numerical result of function x1+x2+x3, how should I write the code? The premise is that I don't know what variables will be nonzero before I call getRay. I am quite confused about this and I wish you chould help me.
I am a freshman to CPlex so these problems may seem too simple. Thank you for your warm reples!
#CPLEXOptimizers#DecisionOptimization