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
-
Official comment
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Javier,
If you run the command
print(x)
the error will become apparent.
- Riley
0
Post is closed for comments.
Comments
2 comments