N-Wouda / ALNS

Adaptive large neighbourhood search (and more!) in Python.
https://alns.readthedocs.io/en/latest/
MIT License
421 stars 122 forks source link

How to solve vehicle routing problem with multiple capacities? #157

Closed Tiara-cmd closed 1 year ago

Tiara-cmd commented 1 year ago

Hello, Working on a problem with a heterogeneous fleet. I have already solved it using google's ortools but need to use alns to tune the solution. Is there a way to keep track of the vehicles in alns in order to determine the correct capacity? Any suggestions are greatly appreciated.

N-Wouda commented 1 year ago

Hi @Tiara-cmd! :wave:

If all you require in terms of heterogeneous fleet is multiple capacities, perhaps have a look at PyVRP. That's project is dedicated exclusively to VRPs, and supports this out-of-the-box!

Tiara-cmd commented 1 year ago

Thx, I'll check it out! Does PyVRP also use adaptive large neighborhood search and allows parameter tuning?

N-Wouda commented 1 year ago

No, it does not. PyVRP uses a genetic algorithm combined with a local search procedure. It does have lots of parameters to tune, but the defaults should be pretty good already.

Tiara-cmd commented 1 year ago

Unfortunately for my project, ALNS is a requirement for additional tuning. But thanks for quick responses!

N-Wouda commented 1 year ago

You could have a look at the CVRP example notebook and adjust that to keep track of which vehicles are assigned to which routes? That might be your best bet if ALNS is a hard requirement.