Gurobi model is stuck not even assigning variables
Awaiting user inputm = gp.Model('firestations_location')
print('hi')
m.setParam('TimeLimit', 5*60)
X = m.addVars(N, vtype=GRB.BINARY, name='X')
print(1)
F = m.addVars(N,N, vtype=GRB.CONTINUOUS, name='F')
y = m.addVars(N,N, vtype=GRB.BINARY, name='y')
print('hi')
m.addConstrs((1-Y[i]>=X[i] for i in range(N)),name="C1")
m.addConstrs((F[(i,i)]==0 for i in range(N)),name="C2")
m.addConstrs((DIST[(i,j)]-S<=M1*y[(i,j)] for i in range(N) for j in range(N)),name="C3")
m.addConstrs((F[(i,j)]<=M2*(1-y[(i,j)]) for i in range(N) for j in range(N)),name="C4")
m.addConstrs((GRB.quicksum(F[(i,j)]*(C[j]*Y[j]+C_new*X[j])) >= FR[i] for i in range(N) for j in range(N)),name="C5")
print("hi")
obj=GRB.quicksum(X[i] for i in range(N))
m.setObjective(obj,GRB.MINIMIZE)
(MODEL IN JUPYTER NOTEBOOK)
I tried debugging by understanding where it might have stucked, but its not working. Any idea on how to understand where the issue might be. Similar problem on small data worked in AMPL, so I am thinking there might be some syntax issue. Please advise!
0
-
Your code snippet is not reproducible. There are multiple definition missing, e.g., \(\texttt{N, Y, DIST, S, M1, C, C_new, FR}\)
Could you please generate a minimal reproducible example?
0
Please sign in to leave a comment.
Comments
1 comment