Non-fixed end depot - TRS example modification
Hi, I'm triying to modify the TRS example so that the end depot can be different than the start depot. First I removed the following lines:
for k in technicians:
for d in D:
if k.depot != d:
for i in L:
y[i,d,k.name].ub = 0
###y[d,i,k.name].ub = 0
Then, I created a second list of depots called E, just like D:
E = list(set([t.depot for t in technicians]))
And modifiy the end depot constraint as:
m.addConstrs((gp.quicksum(y[e,j,k] for j in J for e in E) == u[k] for k in K),\
name="diffDepot2")
Finally, for testing, I considered only Albert, still starting from Heidelberg, but reducing the distances to Freiburg im Breisgau significantly (about 90%) from every customer. By any measure, he should end his trip in Freiburg im Breisgau.
Those changes on the constraint did not work, because the model still forces Albert to return to his start depot. Can you help with any tips on how to make the end depot flexible?
-
正式なコメント
This post is more than three 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.
投稿コメントは受け付けていません。
コメント
1件のコメント