Jsprit for scheduled pickup, deliveries and roundtrip with service time

Hi,

I am new to vrpl and jsprit (https://github.com/graphhopper/jsprit) world.
I have a requirement to implement route planner for laundry service provider.
First I’ll explain the requirement.
We will get requests from customers for pickup clothes and then get them washed and deliver back to them.
Here few customers have specific requirement to pickup and deliver during specific timings only and few doesn’t mind with any time.
And also some times few people will give items at store on their own they just want home delivery.
Few people will only give items at home for pickup and they will collect the delivery on their own.
After bringing the items for laundry, it needs 2 hours for washing and drying.
And another constraint is during initial pickup van can take only one bag from home and during delivery van can take three bags mainly due to unwashed items should not be clubbed.

I am very much impressed with Jsprit features.
So I’m using jsprit for above requirement.

I’ve looked at How to use JSprit to solve VRP whose shipment has some available deliver locations?

And I have modified MultipleProductsWithLoadConstraintExample considering Bananas as initial pickup from home and Apples as washed clothes pickup for dropback.

I am getting below things properly.
1. Pickup and Delivery load constraints are working fine
But I am facing below problems.
1. Without items pickup, dropback job is kicking in
2. Few items are left as uncompleted jobs
3. Can we specify relation between jobs?
4. Can we specify job itself as constraint? like do one job, after particular job completion only. (Dropback only after pickup)
I am hoping it can be acheived with constraints, but I am unable to do it.

1, 3, and 4 can be addressed by a constraint. See the following post where a few relations b/w jobs can be modeled, and your problem matches the realtion “job 13 and 21 in same route AND 21 before 13”. Note that in the code a soft constraint is used, but in your case you might want to use a hard constraint.

I suppose your problem 2 is that some items are picked up but not dropped back. Unfortunately it cannot be address by the current version of Jsprit, as there is no “hard” way to prevent a job from being unassigned. There are “soft” ways, though. For example, you can set high priority for those jobs. It might solve your problem, but not guaranteed.

Hopefully the above helps.

Best regards,
He

1 Like

Thank you for the pointers. I will try it and will get back with update. Thanks once again.