-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heuristics for VRPTW #4
Comments
Hi Ben, be sure to check the alternative open source libraries surveyed in my PhD dissertation: https://jyx.jyu.fi/bitstream/handle/123456789/65790/978-951-39-7826-6_vaitos01112019.pdf#page=154 Out of the algorithms in VeRyPy, the local search operators could be quite easily be adapted to check also TW constraint violations (now they check for capacity C and the maximum route length L). Few local search (LS) operators (i.e. two-opt and one point move), together with modified savings and sweep with TW support (see Solomon 1987) would allow generating initial solutions and improving those with LS. This would already generate fairly good solutions for some problems. Also, building metaheuristics on top of that would be fairly straightforward. Also, modified sweep and LS ops for TWs would make it possible to use some quite powerful matheuristics in VeRyPy like the Petal set covering algorithm BR, Foster, B. A. & Ryan, D. M. 1976. An integer programming approach to the vehicle scheduling problem. Journal of the Operational Research Society 27 (2), 367–384. Solomon, M.M., 1987. Algorithms for the vehicle routing and scheduling problems with time window constraints. Operations research, 35(2), pp.254-265. |
For example, 2-opt would require modifications to (at least) these locations:
VeRyPy/local_search/inter_route_operators.py Line 129 in eaac6e2 VeRyPy/local_search/inter_route_operators.py Line 164 in eaac6e2 Here, one should be sure to take reversing the sequence into account (it might violate some TW constraints). Also, one of the assumptions VeRyPy makes is the symmetric distances. It might work for asymmetric distances, but it has not been extensively tested. |
Yes, for a single algortihm such as Savings that would be rather straightforward. Please see the work of Solomon (1987), where he proposes a savings calculation for VRPTW -> https://pubsonline.informs.org/doi/abs/10.1287/opre.35.2.254 |
Hi @s184311 and @bkj , I decided to take a quick jab towards VRPTW support today. I implemented the constraint check for the parallel savings (in To see what I have been up to, please consider checking out the branch vrptw_savings where you can find the file Now, in the callback of Solomon, M. M. (1987). Algorithms for the vehicle routing and scheduling problems with time window constraints. Operations research, 35(2). Van Landeghem, H. R. G. (1988). A bi-criteria heuristic for the vehicle routing problem with time windows. European Journal of Operational Research, 36(2), 217-226. |
Oh the hubris. After a good night sleep I came to conclusion that I underestimated the effort. It turned out that my initial attempt in implementing CVPRTW support for parallel savings was plainly and completely wrong in so many ways. However, I've now pushed some additional code to the vrptw_savings branch. The current implementation still fails to respect the time window constraints but should be much closer to working properly. I've also included some external constraint checking (in file However, now I really have to abandon this for a while and jump on more acute work. Good luck. |
Made few more fixes (see d7cf87b) and now the TW supported savings in vrptw_savings branch produces feasible solutions \o/. Test it with: jussi@Ogre:~/Projects/Research/VeRyPy$ python examples/vrptw_savings_test.py
1) The solution using non TW sensitive savings function was:
SOLUTION: [0, 1, 0, 2, 0, 3, 4, 0, 5, 6, 0, 7, 8, 9, 0, 10, 11, 12, 0,
13, 15, 16, 0, 14, 21, 0, 17, 18, 19, 23, 0, 20, 22, 0, 24, 25, 0]
ALL SERVED: True
IS C FEASIBLE: True
IS TW FEASIBLE: True
SOLUTION K: 11
SOLUTION COST: 2825
SOLUTION LENGTH: 575
ROUTES:
No. Cost Length Load Route
1 128.00 38.00 10.0 [0, 1, 0]
2 132.00 42.00 30.0 [0, 2, 0]
3 216.00 36.00 20.0 [0, 3, 4, 0]
4 218.00 38.00 30.0 [0, 5, 6, 0]
5 311.00 41.00 50.0 [0, 7, 8, 9, 0]
6 347.00 77.00 40.0 [0, 10, 11, 12, 0]
7 351.00 81.00 110.0 [0, 13, 15, 16, 0]
8 263.00 83.00 30.0 [0, 14, 21, 0]
9 442.00 82.00 60.0 [0, 17, 18, 19, 23, 0]
10 205.00 25.00 30.0 [0, 20, 22, 0]
11 212.00 32.00 50.0 [0, 24, 25, 0]
Total 2825.00 575.00
... |
This is a really wonderful collection of heuristics for CVRPs -- great job!
I'm wondering whether there are any algorithms here that are applicable for VRPs with time windows. Alternatively, do you have any good pointers to descriptions / implementations of heuristics for VRPTWs?
Thanks!
~ Ben
The text was updated successfully, but these errors were encountered: