Forum Discussion
FICO
3 years agoCommunity Manager
How to improve Xpress solver efficiency and time for VRP projects
Hi all, I have a Vehicle Routing Problem (VRP) which has 7 constraints (including subtour elimination constraint, flow conservation constraint, etc). Xpress tries to apply many heuristic methods bef...
FICO
3 years agoCommunity Manager
It looks like Xpress has a hard time finding a feasible solution. However, for your model there is a trivial solution available: since you have as many routes as pickups, you can create one route for each pickup that just goes from the pickup to the closest delivery stop:
if num_routes >= N_pickup:
# Create very simple routes that just go from the pickup to the
# closest delivery
print('Creating trivial solution')
variables = []
for i in range(num_routes):
j = min(range(N_pickup, N_total), key=lambda x: distances[i, x])
variables.append(x[i, j, i])
prob.addmipsol([1] * len(variables), variables, 'trivial1')Could you try whether things get any better with this?
I also looked at your model and I am wondering some things:
- Isn't the generation of constraint 4 generating each constraint twice? Shouldn't the condition in the loop be i<j rather than i!=j? Otherwise you will generate the same constraint for (i,j) and (j,i).
- Is your model actually correct? Suppose you go from pickup p1 to pickup p2 on a route. Then your flow conservation constraint 3 requires a route p1->p2->...->p1 that does not include any delivery stop. However, constraint 5 requires that a route enters a delivery stop and constraint 6 requires that a route can never leave a delivery stop. Maybe I am missing something but it feels like your flow conservation constraint is not correct. Could you test on small models what happens if you set num_routes=N_pickup-1, i.e., if you forbid the trivial solution I have outlined above? I have the feeling that in this case your problem will be infeasible.
Related Content
Related Content
How to improve Bestbound?
e.g. my optimal solution for this dataset is 116. it reaches 116 within 1000 seconds but bestbound is still close to 0. Optimization part: multiplier=ub_nal * (QUARTERS[-1] - 1) + 1# spread of coef...7 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum4 unread comments4 unread30Views0likes4Comments- 30Views0likes1Comment
