Requirement overview: The trip route can have the following type of task
- Delivery only
- Pickup only
- Pickup from one location and deliver to another location
Condition: Once a trip starts from depot, it should come back only when the trip is completed. During the trip, it shouldn’t come to depot.
As we understand, OR tools need delivery and pickup location for each order else it's giving issues. Ref: https://groups.google.com/g/or-tools-discuss/c/WyEOZAv8IJs/m/PxWb7Lq7AwAJ To overcome this, for all delivery orders we add depot as pick location and for all pick orders, we add depot as the delivery location. This is working fine if all orders are for delivery. However, if orders are having a mix of delivery and pick, in this scenario, during the trip if the depot location is near to the last pick node, the vehicle will go to the depot if OR-tools is optimizing like this (considering the last pick needs to be delivered at depot).
This leads to wrong route optimization. Looking for help here. Please advise if we are missing something or having a wrong understanding.