I have a vehicle routing problem solved by linear programming, but I'm confused about the constraints of it (see the model on figure 1). in the model, u and x are decision variables, and we set node 0 as the depot, nodes 1 to n as customers. constraints 1 & 2 indicate that there can only be one edge for both going into and out of the CUSTOMER nodes. However when I use Gurobi optimizer to solve it, I find the solution always includes the depot (node 0) in (see a solution on figure 2). Even I set the depot to an extremely far location (figure 3&4), the depot is still in the solution. Theoretically, to minimize the objective function, if there's no constraints about the edges into and out of the depot, then x_0i and x_i0 should always be 0. The constraints about the depot can be like sum(x_i0 >= 1), but there's no such constraints in the model.
This is the code used for adding constraints:
mdl.addConstrs( # mdl is the name of the model
quicksum(x[i, j] for j in V if j != i) == 1 for i in N) # only one edge into customer node i
mdl.addConstrs(
quicksum(x[i, j] for i in V if i != j) == 1 for j in N) # only one edge out of customer node i
mdl.addConstrs((x[i, j] == 1) >> (u[i] + q[i] == u[j]) for i, j in A if i != 0 and j != 0)
mdl.addConstrs(u[i] >= q[i] for i in N)
mdl.addConstrs(u[i] <= Q for i in N)
Now I'm confident that my code is not problematic (if anyone want to check it I've put it on my Github: https://github.com/KaiyuWei/VRP-problem-by-Gurobi--Python), then could anyone explain the reason why the depot is always included? Thanks!