Why the extreme ray Groubi retrieved is 0?
AnsweredDuring the callback process(benders decomposition), for one step, when the dual is unbounded, the unbounded ray retrieved by Gorubi is 0vector.
I write this model to an lp file, read and optimize it. The model is feasible and unbounded but shows that the extreme ray can not be extracted.
What would that happen?
The code
from gurobipy import *
m = read('extreme_ray.lp')
m.optimize()
print(m.getVarByName("w_3[1,0]").UnbdRay)
The lp file
https://drive.google.com/file/d/1clayLGr79B8Ia_TxJurY_5QY20skYE1h/view?usp=sharing
The code result:
AttributeError: Unable to retrieve attribute 'UnbdRay'

To query unbounded ray information, you have to set the InfUnbdInfo parameter before optimizing your model.
m = read('extreme_ray.lp')
m.setParam("InfUnbdInfo",1)
m.optimize()Best regards,
Jaromił0 
Hi, I have fixed the error and retrieved the extreme ray. The extreme ray is a 0vector. It is abnormal. Why gurobi fail to give a valid extreme ray?
Thank you so much.
0 
The extreme ray is a 0vector. It is abnormal. Why gurobi fail to give a valid extreme ray?
The following code does not give me a 0vector. Could you double check on your side?
import gurobipy as gp
m = gp.read('extreme_ray.lp')
m.setParam("InfUnbdInfo",1)
m.optimize()
for v in m.getVars():
if (v.UnbdRay != 0):
print("%s: %f"%(v.VarName,v.UnbdRay))The output is
Read LP format model from file extreme_ray.lp
Reading time = 0.03 seconds
: 20000 rows, 1532 columns, 78025 nonzeros
Set parameter InfUnbdInfo to value 1
Gurobi Optimizer version 9.5.2 build v9.5.2rc0 (mac64[x86])
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 20000 rows, 1532 columns and 78025 nonzeros
Model fingerprint: 0x94605b2e
Coefficient statistics:
Matrix range [1e+00, 1e+00]
Objective range [1e07, 2e+01]
Bounds range [3e+01, 3e+01]
RHS range [2e01, 2e01]
Concurrent LP optimizer: dual simplex and barrier
Showing barrier log only...
Presolve removed 0 rows and 10 columns
Presolve time: 0.01s
Barrier performed 0 iterations in 0.02 seconds (0.01 work units)
Barrier solve interrupted  model solved by another algorithm
Solved with dual simplex
Solved in 314 iterations and 0.03 seconds (0.01 work units)
Unbounded model
r_dual[10,0]: 2.0000000
Please sign in to leave a comment.
Comments
3 comments