Hello there!
I am working on construction waste collection vehicle routing problem with python. The scenario is that:
(1) There are 2775 orders with different demands generated by 290 clients. Each order is linked with a client index and a time window.
(2) There are 680 trucks available to serve these orders. Trucks also have different maximum load capacity.
(3) Assume that each truck sets off from a depot and serves orders within the time window constraints. I only need to make sure that the demand of each order a truck served ≤ truck's load capacity instead of accumulative demands of all orders served by each truck ≤ truck's load capacity. After a day's work, truck need to go back to the depot.
The key constrains I want to set is:
(1) the demand of each order it served ≤ truck's load capacity;
(2) time window constraint of each order
(3) limit the number of clients ≤ 4 (2775 orders from 290 clients, so one client can have multiple orders, I want to limit the the number of clients each truck serves)
The objective is:
(1) minimize the total distance of all routes
(2) on top of that, minimize the number of trucks used (I learned from some tutorials that this can be realized by adding penalty)
I have distance_matrix and duration_matrix from order to order, time_window of each order, load capacity of trucks, and demands of each order.
(1) What is the objective of this CVRPTW example? It seems to be the total cost. What should I do if I want to set _the total distance_ as my objective?
(2) How can I get and print the route distance of each vehicle?
(3) What is the role of the "box_size" in your coding?
(4) How can I limit the demand of each order a truck served ≤ truck's load capacity?
(5) How can I limit the number of clients in each route?
Please see the code in the attachment. It's not working. Error in the terminal is:
Sorry if this is too long. I am a beginner of Python. I really hope to get help from you experts with regards to the aforementioned questions and the coding.
Thank you!