Originally posted by: Dickiedoda
Well I managed to answer my own question so I figured I would post the solution. The model was defined as:
m = Model(name='linearization')
x = m.binary_var_list(n)
...
After solving the MIP I converted the binary variables to continuous as follows:
for i in range(n):
m.set_var_type(x[i],m.continuous_vartype)
I then resolve to obtain the continuous relaxation which I used to compute the integrality gap.
#CPLEXOptimizers#DecisionOptimization