I am using CPLEX 22.1.0 and docplex library in python to extract the Irreducible Infeasible Subset of a Linear Programming problem. The extraction seems correct but CPLEX is ignoring the time limit that I set. Any idea why this happens?
from docplex.mp.model import Model
import random as rd
import numpy as np
m = 4000 #number of constraints
n = 1000 #number of variables
seed = 0
time_limit = 1.0
rd.seed(seed)
#create matrixes
A = np.random.rand(m, n)
b = np.random.rand(m)
#create model
model = Model()
#create variables
keys = [i for i in range(n)]
x = model.continuous_var_list(keys,name='x')
#constraints
for i in range(m):
model.add_constraint(model.sum(A[i][j]*x[j] for j in range(n)) == b[i])
#conflict refiner
model.parameters.timelimit = time_limit
model.parameters.conflict.display = 2
model.parameters.conflict.algorithm = 0
import time
st_time = time.time()
cplex_model = model.get_cplex()
cplex_model.conflict.refine(cplex_model.conflict.linear_constraints())
# Retrieve and process the IIS
iis_constraints = cplex_model.conflict.get()
finish_time = time.time() - st_time
for i in range(len(iis_constraints)):
value = iis_constraints[i]
if value > 0.5:
print(f"i: {i} ; Value: {value}")
print(f"Finish time: {finish_time:.3f} s")