Hi everyone, i'm having a problem withe my restriccions, I get this error: KeyError: ((1, 0), 1) in my first restriction
AnsweredArcos = [(i,j) for i in range(10) for j in range(10) if i!=j]
Dias = range(1,31)
x = model.addVars(Arcos, Dias, vtype = GRB.BINARY, name = "x")
y = model.addVars(Nodos, Dias, vtype = GRB.BINARY, name = "y")
model.addConstrs(((quicksum(x[a,d] for a in [x for x in Arcos if x[1]==j])) == y[j,d] for j in Nodos for d in Dias ), name = "R1")
I cant find the problem...
0
-
Hi Javier,
If you run the command
print(x)
the error will become apparent.
- Riley
0
Please sign in to leave a comment.
Comments
1 comment