Suboptimal solution returned as optimal in MIP
Awaiting user inputHi,
I am running an MIP formulation (in Python) that ends with aprox. 0.01% optimality gap. However, I found the solution is not optimal. I tried then providing an initial starting point, and then (1), the log says "User MIP start did not produce a new incumbent solution", and (2) the obtained solution remains suboptimal. I was wondering if I am making a mistake, or if there is any setting that I should be using.
Find below the model and the output log. FYI, I tried with the pre solve off and it was the same solution.
Thanks!
#Model defitinion:
# Create a new model
m = gp.Model("Baby Model")
m.Params.NonConvex = 2
m.Params.DUAL_REDUCTIONS = 0
m.Params.InfUnbdInfo = 1
m.Params.FuncPieces = -1
#m.Params.FuncPieceError = 0.0001
m.Params.FuncPieceError = 0.01
m.Params.FuncPieceRatio = 0
#m.Params.FeasibilityTol = 1e-2
m.Params.MIPFocus = 2
m.Params.Presolve = 1
m.Params.IntFeasRol = 1e-4
m.Params.timeLimit= 100000.0
# Create variables
n = m.addVars(mobil, lb=0.1, ub=float('inf'), vtype=GRB.INTEGER, name="deliveries")
d = m.addVar(lb=0.1, ub=float('inf'), vtype=GRB.INTEGER, name="openPODs")
delta1 = m.addVars(mobil, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="delta1")
deltax = m.addVars(mobil, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="deltax")
alpha = m.addVars(populations, vtype=GRB.CONTINUOUS, name="alpha")
t = m.addVars(epoch_e,epoch_l,mobil, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="t")
rr = m.addVars(populations, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="rr")
h = m.addVars(pods,dcs, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="schd_delay")
hf = m.addVars(populations,dcs, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="schd_delay_f")
Q = m.addVars(pods,dcs,sub_e2, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="Q") #Relaxed
Qf = m.addVars(populations,dcs,sub_e2, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="Qf") #Relaxed
q = m.addVars(populations,mobil, lb=0.1, ub=float('inf'), vtype=GRB.CONTINUOUS, name="q") #Relaxed
xpod = m.addVars(pods, lb=0.0, ub=a, vtype=GRB.CONTINUOUS, name="xpod")
ypod = m.addVars(pods, lb=0.0, ub=b, vtype=GRB.CONTINUOUS, name="ypod")
x = m.addVars(populations,epoch_e,epoch_l, lb=0.0, ub=a, vtype=GRB.CONTINUOUS, name="x")
y = m.addVars(populations,epoch_e,epoch_l, lb=0.0, ub=b, vtype=GRB.CONTINUOUS, name="y")
bin_lambda = m.addVars(pods,dcs,sub_e2, vtype=GRB.BINARY, name="bin_lambda")
bin_tau = m.addVars(populations,pods, vtype=GRB.BINARY, name="bin_tau")
bin_rho = m.addVars(pods, vtype=GRB.BINARY, name="bin_rho")
bin_sigma = m.addVars(epoch_e,mobil, vtype=GRB.BINARY, name="bin_sigma")
bin_phif = m.addVars(populations,dcs,sub_e2, vtype=GRB.BINARY, name="bin_phif")
bina = m.addVars(populations, vtype=GRB.BINARY, name="binaryx")
binb = m.addVars(populations, vtype=GRB.BINARY, name="binaryy")
Ztran = m.addVar(vtype=GRB.CONTINUOUS, name="Ztran")
Zfixc = m.addVar(vtype=GRB.CONTINUOUS, name="Zfixc")
Zdepr = m.addVar(vtype=GRB.CONTINUOUS, name="Zdep")
Zwalk = m.addVar(vtype=GRB.CONTINUOUS, name="Zwalk")
zdep1 = m.addVars(populations,mobil, lb=0.0, ub=1000, vtype=GRB.CONTINUOUS, name="aux_dep_cost_funct_1")
zdepx = m.addVars(populations,mobil, lb=0.0, ub=1000, vtype=GRB.CONTINUOUS, name="aux_dep_cost_funct_1")
dist = m.addVars(pods,dcs, lb=0.0, ub=1000, vtype=GRB.CONTINUOUS, name="aux_distance")
distf = m.addVars(populations,dcs, lb=0.0, ub=1000, vtype=GRB.CONTINUOUS, name="aux_distancef")
aux1 = m.addVars(populations,mobil, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="aux_delta1")
auxx = m.addVars(populations,mobil, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="aux_deltax")
auxn = m.addVars(populations,mobil, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="aux_deltax_n")
aux2 = m.addVars(pods,dcs, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="aux_distance_2")
aux21 = m.addVar(lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="aux_distance_2.1")
aux2f = m.addVars(populations,dcs, lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="aux_distance_2f")
aux21f = m.addVar(lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="aux_distance_2.1f")
aux3 = m.addVar(lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="aux_location")
aux4 = m.addVars(populations,lb=0.0, ub=float('inf'), vtype=GRB.CONTINUOUS, name="aux_location_2")
A = m.addVars(populations,pods, vtype=GRB.CONTINUOUS, name="attractPODs")
# Set objective:
m.setObjective(Ztran + Zfixc + Zdepr + Zwalk, GRB.MINIMIZE)
# Add constraints
m.addConstr(
(Ztran>=(c/w)*aux21+(c/w)*aux21f), "Ztransport cost")
m.addConstrs(
(aux2[j,k]==((xdc[k]-xpod[j])*(xdc[k]-xpod[j]))+((ydc[k]-ypod[j])*(ydc[k]-ypod[j]))
for j in pods for k in dcs), "auxiliary distance 2")
for j in pods:
for k in dcs:
m.addGenConstrPow(aux2[j,k], dist[j,k], 0.5)
m.addConstr(
(aux21==quicksum(dist[j,k]*bin_lambda[j,k,e] for j in pods for k in dcs for e in sub_e2)), "auxiliary distance 2.1")
m.addConstrs(
(aux2f[i,k]==((xdc[k]-x_t0[i])*(xdc[k]-x_t0[i]))+((ydc[k]-y_t0[i])*(ydc[k]-y_t0[i]))
for i in populations for k in dcs), "auxiliary distance 2 f")
for i in populations:
for k in dcs:
m.addGenConstrPow(aux2f[i,k], distf[i,k], 0.5)
m.addConstr(
(aux21f==quicksum(distf[i,k]*bin_phif[i,k,e] for i in populations for k in dcs for e in sub_e2)), "auxiliary distance 2.1 f")
m.addConstr(
(Zfixc>=cprim*d), "Zfix cost")
m.addConstr(
(Zdepr>=quicksum(p[i,o]*beta1[i,o]*(zdep1[i,o]+auxn[i,o]) for i in populations for o in mobil)), "Zdeprivation cost")
m.addConstrs(
(aux1[i,o]==beta2[i,o]*delta1[o]
for i in populations for o in mobil), "auxiliary delta1")
m.addConstrs(
(auxx[i,o]==beta2[i,o]*deltax[o]
for i in populations for o in mobil), "auxiliary deltax")
for i in populations:
for o in mobil:
m.addGenConstrExp(aux1[i,o], zdep1[i,o])
m.addGenConstrExp(auxx[i,o], zdepx[i,o])
m.addConstrs(
(auxn[i,o]==n[o]*zdepx[i,o]
for i in populations for o in mobil), "auxiliary zdepx")
m.addConstr(
(Zwalk>=quicksum(v[i]*g[i]*p[i,2]*rr[i] for i in populations) ), "Zwalking cost")
m.addConstrs(
(deltax[o]*n[o] == T - delta1[o] - (n[o]*q[i,o]/(u*p[i,o]))
for i in populations for o in mobil), "time conservation")
m.addConstrs(
(Q.sum('*',k,'*') + Qf.sum('*',k,'*') <= s[k]
for k in dcs), "supplies availabilitym")
###This one:
m.addConstrs(
(q[i,o] >= u*f*p[i,o]
for i in populations for o in mobil), "supply minimum")
m.addConstrs(
(quicksum(q[i,2]*bin_tau[i,j] for i in populations) <= M*(1-bin_sigma[e+1,2]) + Q.sum(j,'*',e)
for j in pods for e in sub_e2), "inventory conservation")
m.addConstrs(
(q[i,1] <= M*(1-bin_sigma[e+1,1]) + Qf.sum(i,'*',e)
for i in populations for e in sub_e2), "inventory conservation f")
#Probably won't need this again
#m.addConstrs(
# (q.sum('*') <= M*(1-bin_sigma[e+1]) + Q.sum('*','*',e)
# for e in sub_e2), "inventory conservation2")
m.addConstrs(
(Q[j,k,e] <= M*bin_lambda[j,k,e]
for j in pods for k in dcs for e in sub_e2), "inventory conservation3")
m.addConstrs(
(Q.sum(j,'*','*') <= M*bin_tau.sum('*',j)
for j in pods), "inventory conservation4")
m.addConstrs(
(Qf[i,k,e] <= M*bin_phif[i,k,e]
for i in populations for k in dcs for e in sub_e2), "inventory conservation5")
m.addConstrs(
(p[i,1] >= bin_phif[i,k,e]
for i in populations for k in dcs for e in sub_e2), "inventory conservation6")
m.addConstrs(
(t[e,1,o]<=t[e,2,o]
for e in epoch_e for o in mobil), "time conservation 1a")
m.addConstrs(
(t[e,2,o]<=t[e,3,o]
for e in epoch_e for o in mobil), "time conservation 1b")
m.addConstrs(
(t[1,1,2]<= rr[i]
for i in populations), "arrival a")
m.addConstrs(
(t[1,2,2] >= rr[i]
for i in populations), "arrival a")
m.addConstrs(
(rr[i] <= vprim[i]
for i in populations), "max walking time")
m.addConstrs(
(t[1,2,o]==delta1[o]
for o in mobil), "time conservation 2")
###Thest the code without this one: it is not in the overleaf formulation
#m.addConstr(
# (t[1,2]<=T), "time conservation 3")
####
m.addConstrs(
(bin_sigma[e,o]*(t[e,2,o]-t[e-1,3,o])==deltax[o]*bin_sigma[e,o]
for e in sub_e for o in mobil), "time conservation 3")
m.addConstrs(
(bin_sigma[e,o]*(t[e,3,o]-t[e,2,o])==(q[i,o]/(u*p[i,o]))*bin_sigma[e,o]
for e in epoch_e for i in populations for o in mobil), "time conservation 4")
m.addConstrs(
(vsq[i]*aux3==((x[i,1,1]-x_t0[i])*(x[i,1,1] - x_t0[i]))+((y[i,1,1]-y_t0[i])*(y[i,1,1]-y_t0[i]))
for i in populations), "location t1")
m.addConstr((aux3==(t[1,1,2]*t[1,1,2])), "aux location t1")
m.addConstrs(
(vsq[i]*aux4[i]==((x[i,1,2] - x[i,1,1])*((x[i,1,2] - x[i,1,1])) + ((y[i,1,2] - y[i,1,1])*(y[i,1,2] - y[i,1,1])))
for i in populations), "location tao1")
m.addConstrs(
(aux4[i]==(rr[i]-t[1,1,2])*(rr[i]-t[1,1,2])
for i in populations), "aux location t1")
m.addConstrs(
(bin_phi[i,k]*((ydc[k] - y_t0[i])*(x[i,1,1] - x_t0[i])) == bin_phi[i,k]*((y[i,1,1] - y_t0[i])*(xdc[k] - x_t0[i]))
for i in populations for k in dcs), "trajectory t0 to t1")
m.addConstrs(
(bin_phi[i,k]*bina[i]*(xdc[k] - x_t0[i]) >= 0
for i in populations for k in dcs), "trajectory aux1")
m.addConstrs(
(bin_phi[i,k]*(1-bina[i])*(xdc[k] - x_t0[i]) <= 0
for i in populations for k in dcs), "trajectory aux2")
m.addConstrs(
(x[i,1,1]>=bina[i]*x_t0[i]
for i in populations), "trajectory aux3")
m.addConstrs(
((1-bina[i])*x[i,1,1]<=x_t0[i]
for i in populations for k in dcs), "trajectory aux4")
m.addConstrs(
(bin_phi[i,k]*binb[i]*(ydc[k] - y_t0[i]) >= 0
for i in populations for k in dcs), "trajectory aux5")
m.addConstrs(
(bin_phi[i,k]*(1-binb[i])*(ydc[k] - y_t0[i]) <= 0
for i in populations for k in dcs), "trajectory aux6")
m.addConstrs(
(y[i,1,1]>=binb[i]*y_t0[i]
for i in populations), "trajectory aux7")
m.addConstrs(
((1-binb[i])*y[i,1,1]<=y_t0[i]
for i in populations for k in dcs), "trajectory aux8")
###### Attractiveness ######
m.addConstrs(
(alpha[i] >= quicksum(A[i,j]*bin_tau[i,j] for j in pods)
for i in populations), "attractiveness of pods 1")
m.addConstrs(
(alpha[i] <= A[i,j]
for i in populations for j in pods), "attractiveness of pods 2")
m.addConstrs(
(A[i,j] == (((xpod[j]-x[i,1,1])*(xpod[j]-x[i,1,1]))+((ypod[j]-y[i,1,1])*(ypod[j]-y[i,1,1])))
for i in populations for j in pods), "attractiveness of pods 23")
###############################
###This one:
m.addConstrs(
(x[i,1,2]*bin_tau[i,j] == xpod[j]*bin_tau[i,j]
for i in populations for j in pods), "location x pods")
###This one:
m.addConstrs(
(y[i,1,2]*bin_tau[i,j] == ypod[j]*bin_tau[i,j]
for i in populations for j in pods), "location y pods")
m.addConstrs(
(xpod[j] <= M*quicksum(bin_tau[i,j] for i in populations)
for j in pods), "location x pods2")
m.addConstrs(
(ypod[j] <= M*quicksum(bin_tau[i,j] for i in populations)
for j in pods), "location y pods2")
m.addConstrs(
((1/w) * dist[j,k] * bin_lambda[j,k,1] == (t[1,1,2] - h[j,k]) * bin_lambda[j,k,1]
for j in pods for k in dcs), "shceduled delivery")
m.addConstrs(
((1/w) * distf[i,k] * bin_phif[i,k,1] == (t[1,2,1] - hf[i,k]) * bin_phif[i,k,1]
for i in populations for k in dcs), "shceduled delivery")
m.addConstrs(
(bin_tau.sum(i,'*') ==1
for i in populations), "bin pop-pod")
########
m.addConstrs(
(h[j,k] <= bin_rho[j]*M
for j in pods for k in dcs), "rho1")
m.addConstrs(
(Q[j,k,e] <= bin_rho[j]*M
for j in pods for k in dcs for e in sub_e2), "rho2")
m.addConstrs(
(xpod[j] <= bin_rho[j]*M
for j in pods), "rho3")
m.addConstrs(
(ypod[j] <= bin_rho[j]*M
for j in pods), "rho4")
m.addConstrs(
(bin_tau[i,j] <= bin_rho[j]*M
for i in populations for j in pods), "rho5")
#m.addConstrs(
# (bin_lambda[j,k,e] <= bin_rho[j]*M
# for j in pods for k in dcs for e in sub_e2), "rho6")
m.addConstrs(
(bin_rho[j-1] >= bin_rho[j]
for j in sub_pods), "rhoa")
m.addConstr(
(quicksum(bin_rho[j] for j in pods) == d), "rhob")
m.addConstrs(
(t[e,l,o] <= bin_sigma[e,o]*M
for e in epoch_e for l in epoch_l for o in mobil), "sigma1")
m.addConstrs(
(Q[j,k,e] <= bin_sigma[e+1,2]*M
for j in pods for k in dcs for e in sub_e2), "sigma2")
m.addConstrs(
(Qf[i,k,e] <= bin_sigma[e+1,1]*M
for i in populations for k in dcs for e in sub_e2), "sigma2f")
m.addConstrs(
(x[i,e,l] <= bin_sigma[e,2]*M
for i in populations for e in epoch_e for l in epoch_l), "sigma3")
m.addConstrs(
(y[i,e,l] <= bin_sigma[e,2]*M
for i in populations for e in epoch_e for l in epoch_l), "sigma4")
m.addConstrs(
(bin_sigma[e-1,o] >= bin_sigma[e,o]
for e in sub_e for o in mobil), "sigmaa")
m.addConstrs(
(quicksum(bin_sigma[e,o] for e in epoch_e) == n[o]+1
for o in mobil), "sigmab")
n[1].start=3
n[2].start=9
m.optimize()
______________________
Changed value of parameter NonConvex to 2
Prev: -1 Min: -1 Max: 2 Default: -1
Changed value of parameter DUAL_REDUCTIONS to 0
Prev: 1 Min: 0 Max: 1 Default: 1
Changed value of parameter InfUnbdInfo to 1
Prev: 0 Min: 0 Max: 1 Default: 0
Changed value of parameter FuncPieces to -1
Prev: 0 Min: -2 Max: 200000000 Default: 0
Changed value of parameter FuncPieceError to 0.01
Prev: 0.001 Min: 1e-06 Max: 1000000.0 Default: 0.001
Changed value of parameter FuncPieceRatio to 0.0
Prev: -1.0 Min: -1.0 Max: 1.0 Default: -1.0
Changed value of parameter MIPFocus to 2
Prev: 0 Min: 0 Max: 3 Default: 0
Changed value of parameter Presolve to 1
Prev: -1 Min: -1 Max: 2 Default: -1
No parameters matching 'IntFeasRol' found
Changed value of parameter timeLimit to 100000.0
Prev: inf Min: 0.0 Max: inf Default: inf
Gurobi Optimizer version 9.0.2 build v9.0.2rc0 (win64)
Optimize a model with 743 rows, 578 columns and 1591 nonzeros
Model fingerprint: 0x57b0b44f
Model has 170 quadratic constraints
Model has 11 general constraints
Variable types: 471 continuous, 107 integer (104 binary)
Coefficient statistics:
Matrix range [1e-01, 1e+04]
QMatrix range [6e-02, 2e+00]
QLMatrix range [1e+00, 1e+04]
Objective range [1e+00, 1e+00]
Bounds range [1e-01, 1e+03]
RHS range [1e+00, 1e+04]
QRHS range [1e+00, 1e+04]
Warning: Completing partial solution with 105 unfixed non-continuous variables out of 107
User MIP start did not produce a new incumbent solution
Presolve added 0 rows and 2037 columns
Presolve removed 83 rows and 0 columns
Presolve time: 0.04s
Presolved: 1520 rows, 2851 columns, 9974 nonzeros
Presolved model has 9 SOS constraint(s)
Presolved model has 25 bilinear constraint(s)
Variable types: 2753 continuous, 98 integer (96 binary)
Root relaxation: objective 5.544015e+03, 346 iterations, 0.01 seconds
Another try with MIP start
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 5544.01481 0 39 - 5544.01481 - - 0s
0 0 5688.79342 0 86 - 5688.79342 - - 0s
0 0 5806.27731 0 74 - 5806.27731 - - 0s
0 0 5813.89676 0 80 - 5813.89676 - - 0s
0 0 6034.03112 0 91 - 6034.03112 - - 0s
0 0 6065.66356 0 91 - 6065.66356 - - 0s
0 0 6237.90489 0 80 - 6237.90489 - - 1s
0 0 6241.68288 0 83 - 6241.68288 - - 1s
0 0 6309.42340 0 86 - 6309.42340 - - 1s
0 0 6315.98542 0 86 - 6315.98542 - - 1s
0 0 6390.46027 0 79 - 6390.46027 - - 1s
0 0 6396.00968 0 77 - 6396.00968 - - 1s
0 0 6466.54736 0 73 - 6466.54736 - - 1s
0 0 6475.12922 0 82 - 6475.12922 - - 1s
0 0 6530.18417 0 82 - 6530.18417 - - 1s
0 0 6537.74124 0 88 - 6537.74124 - - 1s
0 0 6551.85594 0 73 - 6551.85594 - - 1s
0 0 6560.48748 0 78 - 6560.48748 - - 1s
0 0 6597.61280 0 73 - 6597.61280 - - 1s
0 0 6599.37835 0 73 - 6599.37835 - - 1s
0 0 6608.22086 0 82 - 6608.22086 - - 2s
0 0 6609.10829 0 77 - 6609.10829 - - 2s
0 0 6626.15025 0 70 - 6626.15025 - - 2s
0 0 6628.36816 0 80 - 6628.36816 - - 2s
0 0 6698.97362 0 80 - 6698.97362 - - 2s
0 0 6705.50274 0 80 - 6705.50274 - - 2s
0 0 6718.12324 0 77 - 6718.12324 - - 2s
0 0 6728.21095 0 83 - 6728.21095 - - 2s
0 0 6738.24363 0 76 - 6738.24363 - - 2s
0 0 6743.84773 0 80 - 6743.84773 - - 2s
0 0 6773.61450 0 80 - 6773.61450 - - 2s
0 0 6774.91813 0 80 - 6774.91813 - - 2s
0 0 6784.04247 0 83 - 6784.04247 - - 2s
0 0 6784.04247 0 83 - 6784.04247 - - 2s
0 2 6784.04247 0 83 - 6784.04247 - - 2s
1034 686 14384.8076 18 60 - 9952.89104 - 12.9 5s
* 2159 874 58 28894.280474 9952.89104 65.6% 13.4 5s
H 2227 815 28893.374778 9952.89104 65.6% 13.2 6s
* 3285 929 47 25347.066269 10565.6386 58.3% 11.2 7s
* 3521 1000 51 25346.516587 10648.6407 58.0% 11.1 7s
* 3526 999 53 25346.337160 10648.6407 58.0% 11.0 7s
* 3528 999 53 25346.298861 10648.6407 58.0% 11.0 7s
* 5348 1498 54 24926.139783 10911.7472 56.2% 9.5 8s
* 5349 1497 54 24925.519470 10911.7472 56.2% 9.5 8s
* 7213 2073 60 24907.378887 11234.1390 54.9% 8.6 9s
H 7492 1994 23757.556933 11278.8271 52.5% 8.5 9s
7519 2011 16863.7731 24 13 23757.5569 11278.8271 52.5% 8.5 10s
14638 3436 infeasible 30 23757.5569 12512.1660 47.3% 7.4 15s
*16564 3832 85 23530.904517 12885.1354 45.2% 7.3 16s
*16565 3832 85 23530.902241 12885.1354 45.2% 7.3 16s
*16566 3832 84 23530.899842 12885.1354 45.2% 7.3 16s
*16567 3832 83 23530.897315 12885.1354 45.2% 7.3 16s
*16568 3832 82 23530.894656 12885.1354 45.2% 7.3 16s
*19009 4221 50 23355.730582 13155.9584 43.7% 7.1 17s
22752 4817 14151.4527 26 13 23355.7306 13395.4596 42.6% 6.8 20s
31189 5956 15755.0571 28 12 23355.7306 13816.8647 40.8% 6.5 25s
40485 7190 21394.0706 32 16 23355.7306 14162.5339 39.4% 6.3 30s
*40926 7135 62 23128.678047 14176.8797 38.7% 6.3 30s
*43716 7479 64 23015.966057 14250.8943 38.1% 6.2 31s
*45822 7737 72 23010.309911 14300.4162 37.9% 6.2 33s
*49080 8129 67 23002.271049 14380.4729 37.5% 6.1 34s
49710 8209 14445.2161 28 10 23002.2710 14391.9058 37.4% 6.1 35s
58745 9285 15210.6247 29 14 23002.2710 14619.0750 36.4% 6.0 40s
*68187 10219 66 22926.527633 14899.3675 35.0% 5.9 44s
68866 10259 14997.1826 29 16 22926.5276 14918.7946 34.9% 5.9 45s
77277 10867 infeasible 35 22926.5276 15192.8803 33.7% 5.9 50s
86401 11756 18410.3639 28 16 22926.5276 15452.7230 32.6% 5.9 55s
*91288 12115 64 22873.532433 15571.5403 31.9% 5.8 57s
96403 12360 20703.0099 35 12 22873.5324 15732.2383 31.2% 5.8 60s
105657 12886 17901.8325 27 8 22873.5324 15978.6237 30.1% 5.8 65s
114004 13055 infeasible 28 22873.5324 16230.9210 29.0% 5.8 70s
122315 13144 22303.9815 34 8 22873.5324 16468.0075 28.0% 5.8 75s
129725 13193 cutoff 35 22873.5324 16665.1068 27.1% 5.9 80s
137485 13301 21300.7452 35 13 22873.5324 16822.2013 26.5% 5.8 85s
144871 13393 cutoff 27 22873.5324 16946.5411 25.9% 5.8 90s
150906 13441 18762.5704 27 10 22873.5324 17064.7649 25.4% 5.8 95s
157352 13389 17213.1779 27 13 22873.5324 17213.1779 24.7% 5.7 100s
161692 13364 20000.8178 17 11 22873.5324 17331.5252 24.2% 5.7 105s
168360 13281 cutoff 36 22873.5324 17496.9437 23.5% 5.7 110s
173902 13115 infeasible 30 22873.5324 17635.6487 22.9% 5.7 115s
*178803 12998 63 22871.197256 17731.9327 22.5% 5.7 118s
*178807 12998 64 22871.197104 17731.9327 22.5% 5.7 118s
180312 13017 infeasible 37 22871.1971 17763.5573 22.3% 5.7 120s
186632 12986 17886.8643 28 10 22871.1971 17886.8643 21.8% 5.7 125s
193006 12950 18008.2093 32 10 22871.1971 18008.2093 21.3% 5.6 130s
199239 12732 20421.5142 30 13 22871.1971 18131.9273 20.7% 5.6 135s
204380 12597 18245.1857 32 10 22871.1971 18245.1857 20.2% 5.6 140s
210588 12468 cutoff 34 22871.1971 18393.1956 19.6% 5.6 145s
215991 12265 20814.5248 28 10 22871.1971 18501.4464 19.1% 5.5 150s
222037 12087 infeasible 34 22871.1971 18635.6635 18.5% 5.5 155s
228245 11953 18743.5855 26 9 22871.1971 18743.5855 18.0% 5.5 160s
233521 11739 19069.3630 31 14 22871.1971 18871.1331 17.5% 5.5 165s
239766 11499 cutoff 29 22871.1971 19004.6010 16.9% 5.4 170s
244786 11250 19097.2989 29 10 22871.1971 19097.2989 16.5% 5.4 175s
250125 10960 infeasible 38 22871.1971 19215.5869 16.0% 5.4 180s
255419 10716 infeasible 34 22871.1971 19339.0480 15.4% 5.4 185s
260571 10402 cutoff 26 22871.1971 19446.9218 15.0% 5.3 190s
265421 10106 19551.4153 29 10 22871.1971 19551.4153 14.5% 5.3 195s
269835 9767 19671.9962 29 13 22871.1971 19671.9962 14.0% 5.3 200s
274187 9375 19845.8157 29 12 22871.1971 19781.3743 13.5% 5.3 205s
278535 9013 20194.8078 19 13 22871.1971 19885.3520 13.1% 5.3 210s
283848 8577 cutoff 32 22871.1971 19997.5115 12.6% 5.3 215s
288397 7997 21257.5445 34 12 22871.1971 20173.5093 11.8% 5.3 220s
291948 7336 infeasible 24 22871.1971 20342.2819 11.1% 5.3 225s
295624 6691 infeasible 34 22871.1971 20541.0609 10.2% 5.3 230s
*296408 6527 69 22856.454879 20575.6517 10.0% 5.3 231s
*296410 6527 70 22856.454853 20575.6517 10.0% 5.3 231s
298664 6030 21162.3697 30 10 22856.4549 20694.0302 9.46% 5.3 235s
301722 5285 infeasible 27 22856.4549 20877.5152 8.66% 5.3 240s
305531 4375 infeasible 31 22856.4549 21139.2608 7.51% 5.3 245s
308661 3681 infeasible 36 22856.4549 21380.9499 6.46% 5.3 250s
311837 2865 cutoff 30 22856.4549 21652.3544 5.27% 5.3 255s
315652 1985 22497.4404 44 12 22856.4549 22017.4032 3.67% 5.3 261s
318672 1400 22530.0737 42 13 22856.4549 22294.9389 2.46% 5.3 265s
*321943 972 66 22856.369995 22549.5557 1.34% 5.3 268s
*322528 943 72 22855.884193 22591.0019 1.16% 5.3 269s
*322529 943 72 22855.864959 22591.0019 1.16% 5.3 269s
323250 876 22633.6560 44 16 22855.8650 22632.5928 0.98% 5.3 270s
*327034 436 75 22855.168540 22790.6060 0.28% 5.2 274s
*327044 432 79 22855.050942 22790.6060 0.28% 5.2 274s
*327045 432 79 22855.044936 22790.6060 0.28% 5.2 274s
*327046 430 78 22855.038619 22790.6060 0.28% 5.2 274s
328824 230 cutoff 56 22855.0386 22839.8348 0.07% 5.2 275s
*328922 230 77 22855.034849 22839.8348 0.07% 5.2 275s
*328924 230 75 22855.009242 22839.8348 0.07% 5.2 275s
*330323 203 80 22854.957680 22848.6399 0.03% 5.2 276s
*330327 203 82 22854.957672 22848.6399 0.03% 5.2 276s
*330329 203 83 22854.957666 22848.6399 0.03% 5.2 276s
*330342 203 90 22854.957133 22848.6399 0.03% 5.2 276s
Cutting planes:
Gomory: 9
Cover: 25
Implied bound: 99
Projected implied bound: 2
Clique: 7
MIR: 14
Flow cover: 95
RLT: 37
Relax-and-lift: 26
BQP: 2
Explored 331712 nodes (1727866 simplex iterations) in 277.19 seconds
Thread count was 8 (of 8 available processors)
Solution count 10: 22855 22855 22855 ... 22855.2
Optimal solution found (tolerance 1.00e-04)
Warning: max constraint violation (2.9212e-03) exceeds tolerance
Warning: max general constraint violation (2.9212e-03) exceeds tolerance
(model may be infeasible or unbounded - try turning presolve off)
Best objective 2.285495713262e+04, best bound 2.285462660876e+04, gap 0.0014%
-
Sending the log again:
Changed value of parameter NonConvex to 2
Prev: -1 Min: -1 Max: 2 Default: -1
Changed value of parameter DUAL_REDUCTIONS to 0
Prev: 1 Min: 0 Max: 1 Default: 1
Changed value of parameter InfUnbdInfo to 1
Prev: 0 Min: 0 Max: 1 Default: 0
Changed value of parameter FuncPieces to -1
Prev: 0 Min: -2 Max: 200000000 Default: 0
Changed value of parameter FuncPieceError to 0.01
Prev: 0.001 Min: 1e-06 Max: 1000000.0 Default: 0.001
Changed value of parameter FuncPieceRatio to 0.0
Prev: -1.0 Min: -1.0 Max: 1.0 Default: -1.0
Changed value of parameter MIPFocus to 2
Prev: 0 Min: 0 Max: 3 Default: 0
Changed value of parameter Presolve to 1
Prev: -1 Min: -1 Max: 2 Default: -1
No parameters matching 'IntFeasRol' found
Changed value of parameter timeLimit to 100000.0
Prev: inf Min: 0.0 Max: inf Default: inf
Gurobi Optimizer version 9.0.2 build v9.0.2rc0 (win64)
Optimize a model with 743 rows, 578 columns and 1591 nonzeros
Model fingerprint: 0x57b0b44f
Model has 170 quadratic constraints
Model has 11 general constraints
Variable types: 471 continuous, 107 integer (104 binary)
Coefficient statistics:
Matrix range [1e-01, 1e+04]
QMatrix range [6e-02, 2e+00]
QLMatrix range [1e+00, 1e+04]
Objective range [1e+00, 1e+00]
Bounds range [1e-01, 1e+03]
RHS range [1e+00, 1e+04]
QRHS range [1e+00, 1e+04]
Warning: Completing partial solution with 105 unfixed non-continuous variables out of 107
User MIP start did not produce a new incumbent solution
Presolve added 0 rows and 2037 columns
Presolve removed 83 rows and 0 columns
Presolve time: 0.04s
Presolved: 1520 rows, 2851 columns, 9974 nonzeros
Presolved model has 9 SOS constraint(s)
Presolved model has 25 bilinear constraint(s)
Variable types: 2753 continuous, 98 integer (96 binary)
Root relaxation: objective 5.544015e+03, 346 iterations, 0.01 seconds
Another try with MIP start
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 5544.01481 0 39 - 5544.01481 - - 0s
0 0 5688.79342 0 86 - 5688.79342 - - 0s
0 0 5806.27731 0 74 - 5806.27731 - - 0s
0 0 5813.89676 0 80 - 5813.89676 - - 0s
0 0 6034.03112 0 91 - 6034.03112 - - 0s
0 0 6065.66356 0 91 - 6065.66356 - - 0s
0 0 6237.90489 0 80 - 6237.90489 - - 1s
0 0 6241.68288 0 83 - 6241.68288 - - 1s
0 0 6309.42340 0 86 - 6309.42340 - - 1s
0 0 6315.98542 0 86 - 6315.98542 - - 1s
0 0 6390.46027 0 79 - 6390.46027 - - 1s
0 0 6396.00968 0 77 - 6396.00968 - - 1s
0 0 6466.54736 0 73 - 6466.54736 - - 1s
0 0 6475.12922 0 82 - 6475.12922 - - 1s
0 0 6530.18417 0 82 - 6530.18417 - - 1s
0 0 6537.74124 0 88 - 6537.74124 - - 1s
0 0 6551.85594 0 73 - 6551.85594 - - 1s
0 0 6560.48748 0 78 - 6560.48748 - - 1s
0 0 6597.61280 0 73 - 6597.61280 - - 1s
0 0 6599.37835 0 73 - 6599.37835 - - 1s
0 0 6608.22086 0 82 - 6608.22086 - - 2s
0 0 6609.10829 0 77 - 6609.10829 - - 2s
0 0 6626.15025 0 70 - 6626.15025 - - 2s
0 0 6628.36816 0 80 - 6628.36816 - - 2s
0 0 6698.97362 0 80 - 6698.97362 - - 2s
0 0 6705.50274 0 80 - 6705.50274 - - 2s
0 0 6718.12324 0 77 - 6718.12324 - - 2s
0 0 6728.21095 0 83 - 6728.21095 - - 2s
0 0 6738.24363 0 76 - 6738.24363 - - 2s
0 0 6743.84773 0 80 - 6743.84773 - - 2s
0 0 6773.61450 0 80 - 6773.61450 - - 2s
0 0 6774.91813 0 80 - 6774.91813 - - 2s
0 0 6784.04247 0 83 - 6784.04247 - - 2s
0 0 6784.04247 0 83 - 6784.04247 - - 2s
0 2 6784.04247 0 83 - 6784.04247 - - 2s
1034 686 14384.8076 18 60 - 9952.89104 - 12.9 5s
* 2159 874 58 28894.280474 9952.89104 65.6% 13.4 5s
H 2227 815 28893.374778 9952.89104 65.6% 13.2 6s
* 3285 929 47 25347.066269 10565.6386 58.3% 11.2 7s
* 3521 1000 51 25346.516587 10648.6407 58.0% 11.1 7s
* 3526 999 53 25346.337160 10648.6407 58.0% 11.0 7s
* 3528 999 53 25346.298861 10648.6407 58.0% 11.0 7s
* 5348 1498 54 24926.139783 10911.7472 56.2% 9.5 8s
* 5349 1497 54 24925.519470 10911.7472 56.2% 9.5 8s
* 7213 2073 60 24907.378887 11234.1390 54.9% 8.6 9s
H 7492 1994 23757.556933 11278.8271 52.5% 8.5 9s
7519 2011 16863.7731 24 13 23757.5569 11278.8271 52.5% 8.5 10s
14638 3436 infeasible 30 23757.5569 12512.1660 47.3% 7.4 15s
*16564 3832 85 23530.904517 12885.1354 45.2% 7.3 16s
*16565 3832 85 23530.902241 12885.1354 45.2% 7.3 16s
*16566 3832 84 23530.899842 12885.1354 45.2% 7.3 16s
*16567 3832 83 23530.897315 12885.1354 45.2% 7.3 16s
*16568 3832 82 23530.894656 12885.1354 45.2% 7.3 16s
*19009 4221 50 23355.730582 13155.9584 43.7% 7.1 17s
22752 4817 14151.4527 26 13 23355.7306 13395.4596 42.6% 6.8 20s
31189 5956 15755.0571 28 12 23355.7306 13816.8647 40.8% 6.5 25s
40485 7190 21394.0706 32 16 23355.7306 14162.5339 39.4% 6.3 30s
*40926 7135 62 23128.678047 14176.8797 38.7% 6.3 30s
*43716 7479 64 23015.966057 14250.8943 38.1% 6.2 31s
*45822 7737 72 23010.309911 14300.4162 37.9% 6.2 33s
*49080 8129 67 23002.271049 14380.4729 37.5% 6.1 34s
49710 8209 14445.2161 28 10 23002.2710 14391.9058 37.4% 6.1 35s
58745 9285 15210.6247 29 14 23002.2710 14619.0750 36.4% 6.0 40s
*68187 10219 66 22926.527633 14899.3675 35.0% 5.9 44s
68866 10259 14997.1826 29 16 22926.5276 14918.7946 34.9% 5.9 45s
77277 10867 infeasible 35 22926.5276 15192.8803 33.7% 5.9 50s
86401 11756 18410.3639 28 16 22926.5276 15452.7230 32.6% 5.9 55s
*91288 12115 64 22873.532433 15571.5403 31.9% 5.8 57s
96403 12360 20703.0099 35 12 22873.5324 15732.2383 31.2% 5.8 60s
105657 12886 17901.8325 27 8 22873.5324 15978.6237 30.1% 5.8 65s
114004 13055 infeasible 28 22873.5324 16230.9210 29.0% 5.8 70s
122315 13144 22303.9815 34 8 22873.5324 16468.0075 28.0% 5.8 75s
129725 13193 cutoff 35 22873.5324 16665.1068 27.1% 5.9 80s
137485 13301 21300.7452 35 13 22873.5324 16822.2013 26.5% 5.8 85s
144871 13393 cutoff 27 22873.5324 16946.5411 25.9% 5.8 90s
150906 13441 18762.5704 27 10 22873.5324 17064.7649 25.4% 5.8 95s
157352 13389 17213.1779 27 13 22873.5324 17213.1779 24.7% 5.7 100s
161692 13364 20000.8178 17 11 22873.5324 17331.5252 24.2% 5.7 105s
168360 13281 cutoff 36 22873.5324 17496.9437 23.5% 5.7 110s
173902 13115 infeasible 30 22873.5324 17635.6487 22.9% 5.7 115s
*178803 12998 63 22871.197256 17731.9327 22.5% 5.7 118s
*178807 12998 64 22871.197104 17731.9327 22.5% 5.7 118s
180312 13017 infeasible 37 22871.1971 17763.5573 22.3% 5.7 120s
186632 12986 17886.8643 28 10 22871.1971 17886.8643 21.8% 5.7 125s
193006 12950 18008.2093 32 10 22871.1971 18008.2093 21.3% 5.6 130s
199239 12732 20421.5142 30 13 22871.1971 18131.9273 20.7% 5.6 135s
204380 12597 18245.1857 32 10 22871.1971 18245.1857 20.2% 5.6 140s
210588 12468 cutoff 34 22871.1971 18393.1956 19.6% 5.6 145s
215991 12265 20814.5248 28 10 22871.1971 18501.4464 19.1% 5.5 150s
222037 12087 infeasible 34 22871.1971 18635.6635 18.5% 5.5 155s
228245 11953 18743.5855 26 9 22871.1971 18743.5855 18.0% 5.5 160s
233521 11739 19069.3630 31 14 22871.1971 18871.1331 17.5% 5.5 165s
239766 11499 cutoff 29 22871.1971 19004.6010 16.9% 5.4 170s
244786 11250 19097.2989 29 10 22871.1971 19097.2989 16.5% 5.4 175s
250125 10960 infeasible 38 22871.1971 19215.5869 16.0% 5.4 180s
255419 10716 infeasible 34 22871.1971 19339.0480 15.4% 5.4 185s
260571 10402 cutoff 26 22871.1971 19446.9218 15.0% 5.3 190s
265421 10106 19551.4153 29 10 22871.1971 19551.4153 14.5% 5.3 195s
269835 9767 19671.9962 29 13 22871.1971 19671.9962 14.0% 5.3 200s
274187 9375 19845.8157 29 12 22871.1971 19781.3743 13.5% 5.3 205s
278535 9013 20194.8078 19 13 22871.1971 19885.3520 13.1% 5.3 210s
283848 8577 cutoff 32 22871.1971 19997.5115 12.6% 5.3 215s
288397 7997 21257.5445 34 12 22871.1971 20173.5093 11.8% 5.3 220s
291948 7336 infeasible 24 22871.1971 20342.2819 11.1% 5.3 225s
295624 6691 infeasible 34 22871.1971 20541.0609 10.2% 5.3 230s
*296408 6527 69 22856.454879 20575.6517 10.0% 5.3 231s
*296410 6527 70 22856.454853 20575.6517 10.0% 5.3 231s
298664 6030 21162.3697 30 10 22856.4549 20694.0302 9.46% 5.3 235s
301722 5285 infeasible 27 22856.4549 20877.5152 8.66% 5.3 240s
305531 4375 infeasible 31 22856.4549 21139.2608 7.51% 5.3 245s
308661 3681 infeasible 36 22856.4549 21380.9499 6.46% 5.3 250s
311837 2865 cutoff 30 22856.4549 21652.3544 5.27% 5.3 255s
315652 1985 22497.4404 44 12 22856.4549 22017.4032 3.67% 5.3 261s
318672 1400 22530.0737 42 13 22856.4549 22294.9389 2.46% 5.3 265s
*321943 972 66 22856.369995 22549.5557 1.34% 5.3 268s
*322528 943 72 22855.884193 22591.0019 1.16% 5.3 269s
*322529 943 72 22855.864959 22591.0019 1.16% 5.3 269s
323250 876 22633.6560 44 16 22855.8650 22632.5928 0.98% 5.3 270s
*327034 436 75 22855.168540 22790.6060 0.28% 5.2 274s
*327044 432 79 22855.050942 22790.6060 0.28% 5.2 274s
*327045 432 79 22855.044936 22790.6060 0.28% 5.2 274s
*327046 430 78 22855.038619 22790.6060 0.28% 5.2 274s
328824 230 cutoff 56 22855.0386 22839.8348 0.07% 5.2 275s
*328922 230 77 22855.034849 22839.8348 0.07% 5.2 275s
*328924 230 75 22855.009242 22839.8348 0.07% 5.2 275s
*330323 203 80 22854.957680 22848.6399 0.03% 5.2 276s
*330327 203 82 22854.957672 22848.6399 0.03% 5.2 276s
*330329 203 83 22854.957666 22848.6399 0.03% 5.2 276s
*330342 203 90 22854.957133 22848.6399 0.03% 5.2 276s
Cutting planes:
Gomory: 9
Cover: 25
Implied bound: 99
Projected implied bound: 2
Clique: 7
MIR: 14
Flow cover: 95
RLT: 37
Relax-and-lift: 26
BQP: 2
Explored 331712 nodes (1727866 simplex iterations) in 277.19 seconds
Thread count was 8 (of 8 available processors)
Solution count 10: 22855 22855 22855 ... 22855.2
Optimal solution found (tolerance 1.00e-04)
Warning: max constraint violation (2.9212e-03) exceeds tolerance
Warning: max general constraint violation (2.9212e-03) exceeds tolerance
(model may be infeasible or unbounded - try turning presolve off)
Best objective 2.285495713262e+04, best bound 2.285462660876e+04, gap 0.0014%
0 -
Hi Sofia,
Please note that your code is not reproducible because values for parameters \(\texttt{mobil, populations, epoch_e, epoch_l, pods, dcs, sub_e2, ...}\) are missing.
The final solution is not feasible because it has a high constraint and general constraint violation
Warning: max constraint violation (2.9212e-03) exceeds tolerance
Warning: max general constraint violation (2.9212e-03) exceeds tolerance
(model may be infeasible or unbounded - try turning presolve off)There are multiple things you might want to try to avoid this. You should try updating to the latest version of Gurobi. You are setting the FuncPieceError parameter to a quite high value. In order to increase accuracy you should rather decrease this value. In general, I would recommend experimenting with the FuncPieces value instead of the FuncPieceError parameter. Note that increasing the value of FuncPieces also increases the size of the model and may hurt performance (this always holds when playing with tolerances). I am not sure whether you really need the FuncPieceRatio parameter, I would just leave it at default. Then, I would recommend strictly bounding all variables participating in general constraints (both \(x\) and \(y\) variables), e.g., variables \(\texttt{auxX}\) should all have a tight upper bound. We discuss tackling numerical issues and constraint violations in our Guidelines for Numerical Issues.
In case that your model is declared infeasible, the article How do I determine why my model is infeasible? should be of interest.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
2 comments