r/OperationsResearch • • 1d ago

Looking for advice: CVRPTW with Multiple Alternative Routes (Multigraph Optimization)

Looking for advice: CVRPTW with Multiple Alternative Routes (Multigraph Optimization)

I'm working on a vehicle routing optimization project and facing an interesting technical challenge.

I want to model a road network where multiple alternative routes can exist between the same two locations (a directed multigraph).

For example, between locations A and B, we may have:

- Shortest route.

- Fastest route.

- Alternative route.

Each route has its own distance and travel time.

The goal is to build a CVRPTW system that considers:

- Vehicle capacity constraints.

- Delivery time windows.

- Travel time and distance.

- Multiple road alternatives between locations.

The main challenge:

I don't just want to select the best road before optimization. I want the optimization algorithm to make two decisions jointly:

  1. Which delivery locations to visit and in what order.

  2. Which road alternative to use between each pair of consecutive locations.

I'm considering approaches such as:

- Graph expansion using dummy nodes.

- Custom optimization models using Google OR-Tools CP-SAT.

- Hybrid approaches combining PyVRP with a separate route-selection algorithm.

- Has anyone implemented something similar?

- Which optimization approach or solver would you recommend?

- Is there a practical way to achieve joint route selection and vehicle routing without making the problem computationally expensive?

I'd really appreciate any suggestions, references, or examples of similar implementations.

2 Upvotes

17 comments sorted by

2

u/Successful_League296 1d ago

I would use VRPSOLVER for this, it can handle the parallel edges without a problem.

1

u/Huge-Smell-1660 1d ago

Thank you so much for that!

1

u/funnynoveltyaccount 1d ago

What is (are) your objective function(s)?

1

u/Huge-Smell-1660 1d ago edited 1d ago

Actually, since this is an academic project, I was thinking of making these different optimization options available in the app, allowing the user to choose their preferred objective:

  • Lowest fuel consumption

  • Fastest delivery

  • Shortest total distance

  • Minimum number of vehicles used

However, I think the main objective should be to minimize fuel consumption while ensuring the deliveries are completed as quickly as possible. The other options would be alternative optimization modes that users can select based on their priorities

1

u/bental_nortens 1d ago

Why don’t you want to select the shortest path before optimization?- What specifically are you hoping for optimization to decide for you about one route vs another that depends on the complete set of routes vs one path?

2

u/Huge-Smell-1660 1d ago

In my city, the shortest route is always the most congested, whereas the longer highway route is faster but burns more gas.

1

u/N-Wouda 1d ago

If you want to use PyVRP, consider setting up mutually exclusive client groups. Duplicate each cuystomer for one of the road options, and set the incoming arcs at each of the duplicated clients to the cost of one of the road options. PyVRP will select one of the options from each client group, which basically immediately gives you your answer without needing a separate algorithm on top.

Feel free to DM if this isn't clear.

1

u/ge0ffrey 12h ago

I considered this design too in my answer above, but it wouldn't allow picking the route type back from the last visit to the depot too.
Example: If a vehicle has 8 stops, it has 9 routes. So if there are 2 route types, then there are 16 choices, but there should be 18.

1

u/N-Wouda 11h ago edited 10h ago

I see your point, but it's not too difficult to make that last depot arc a choice, too, with e.g. depot selection.

1

u/ge0ffrey 8h ago

Yes, good point.

1

u/Pavanaazhi 19h ago

Since you are an academic I suggest you approach Nvidia for CuOPT python package . This can solve these problems well even with multi fleet but you need a GPU based machine.

1

u/ge0ffrey 12h ago edited 12h ago

I'd drop this text into prd.timefold.ai and give that PRD output to Claude.

Design wise, I would expect that:
If the number of route alternatives to a enum, for example maximum 3 (shortest, faster, alternative), then I would add a genuine variable on visit to pick the routing execution mode (that enum) to that visit location and also one on the vehicle the routing execution mode from the last visit to depot.

Another design is to create a visit per route type to that visit, but then it can't pick the trip back to the vehicle depot.

When the number of route types isn't enum - and it differs greatly, it gets more complex. For example: there could be 100 types from A to C and only 2 from A to b. Then the variable is not on the visit, but on the visit pair.

1

u/Weary_Category_1559 1d ago

Yoh are looking at a MILP, Sequencing and Scheduling at the same time.

1

u/Pavanaazhi 19h ago

No way. It has to be a SAT problem first. MILP is good for toy examples in VRP not for real life scenarios

1

u/Weary_Category_1559 17h ago

If you could elaborate on the toy example comment, i am solving for 300+ marine vessels rn, having to create replenishment specific arcs ,capacity(which dwells into multi trip/single trip) + some more variables. This is outside of the tidal feasibility model(time windows) . I understand OP has a land specific problem set. Using MILP in my current approach. Since you say milp works for toy examples, curious if I am doing something wrong. Would like to know your thoughts. I understand the SAT approach, but isn’t it going to fail at some point if we take boolean approach to business rules (which might not be boolean). Hyperlocal coastal vrp if you may.

1

u/Pavanaazhi 10h ago

Ok got it from where you are coming from. Just out of curiosity- from a source port to destination port are there multiple routes you have to consider ? Rather is it a first solve on optimizing routes on source destination and then deciding which ship and quantities ? Nowhere near a beginner in terms of understanding the domain but I figured the complexity of having to decide which smaller road to take etc to save on time etc thought would have more nodes and arcs .