Hello optaplanner community. Greetings and always grateful for your answers.
I have a VRP problem where I have a fleet of vehicles and the list of visits. Each visit has a delivery point (D delivering) and a picking point (P picking). The restriction is that each visit is attended by a single vehicle and the vehicle must first go to the pickup point to load what the visit demands and then go to deliver. If the demand of the delivery point is greater than the capacity, it must not be broken down into trips. If there is no other vehicle with a greater capacity capable of supporting this visit, it must ignore the visit in this planning. Above all because there are visits whose demand cannot be divided and therefore the vehicle must transport it in the same trip.
1- I would like to know if this problem I have can be modelled as VRPPD even though each vehicle must go only once to a delivery point? I understand that although each vehicle must go only once to a delivery point, there must be an order between visits and each pickup point must be made before the delivery point. I understand that each visit does not have multipicking, as the vehicle only goes once, but the entire route does have multiple pick-ups and deliveries.
2- I have made some assumptions to solve my problem. Do you have any suggestions that I can make to model it? Are my assumptions correct? I am a novice with Optaplanner and any suggestions would be very useful.
I've analyzed that maybe I can solve my VRPPPD by registering all the points as visits, where the delivery and pick-up point of a visit would be in the same location. Each visit would have a type to know which is Picking (P) and which is Delivering (D). It would have to manage a shadow variable to update the capacity of the vehicle, since in each P the capacity increases and in the D it decreases. And my hard restrictions would be one for the capacity, a restriction so that each P and D have the same vehicle, and another restriction so that each P is done before the D.
3- On the other hand, I thought to use the example "optaplanner-mixedvrp-experiment" by Geoffrey? I understand that this example is for multiple trips where the vehicle breaks up the trips to the customer into multiple trips, so I understand that the vehicle goes to the customer multiple times, so I understand that I must make some modifications.
What changes can I make in this example "optaplanner-mixedvrp-experiment" to mix pick-ups and deliveries, but never from the same customer. This is exactly my requirement.
Is it possible that 4 and 5 are solved by applying this example?
4- How can I manage that when there are visits with nearby collection points, I go perhaps first to several collection points and then to make the deliveries.
(P1 P2 D1 D2 P3 D3) where P1 and P2 are nearby, first pick up and then deliver
5- How can I manage that when there are visits with the same delivery point, the vehicle can load what is demanded by these visits at the same time, so that it does not have to return to the same point? Since I understand that the distances and time between visits should not be doubled, given that although they are different visits they have the same location.
(P1 D1 D2 P3 D3) where D1 and D2 have the same pickup point (P1) and the vehicle has sufficient capacity to load the demand of points D1 and D2 at P1.
6- How can I make the vehicle leave the depot with zero capacity and go directly to the 1st pickup point?