0

I want to model a scenario where a Job requires multiple pickup and multiple deliveries. Shipment allows only one pickup and delivery location. Service class can help to model this but I want to built affinity among pickup and deliveries belonging to same job. This will ensure that same vehicle(set of vehicles) does pickup and deliveries for given job(job request is raised by customer).

Regards, Amit

Amit AK
  • 11
  • 1

1 Answers1

1

I am not quite sure what you mean by one Job that requires multiple pickup and multiple deliveries, but if you check this stackoverflow post regarding related jobs in Jsprit, you will find an example given by Stefan (job 13 and 21 in same route AND 21 before 13) where two jobs should be in the same route and their sequence is determined - just like a pickup and its associated delivery should be in the same route and that pickup should be before that delivery.

Basically what you need is to define a soft route constraint to reward when two related jobs are inserted in the same route (or a hard route constraint to forbid them to be inserted into two different routes) and a corresponding objective function. Besides, you need a state updater to record which route each job is in. You can refer again to the example.

Moreover, it can be applied to multiple related jobs (see this stackoverflow post).

Community
  • 1
  • 1
He Huang
  • 136
  • 3
  • Thanks He. Details you have provided are helpful and will help me in resolving my problem. – Amit AK May 25 '16 at 10:49
  • I am trying to solve single pickup and multiple deliveries problem. If I have to use "Shipment" class, then for a given order having one pickup and multiple deliveries, I will end up in creating multiple instance of "Shipment" class each representing common pickup location and different delivery location. I can add soft/hard constraints to ensure all shipments belonging to same order get assigned to same set of vehicles. I was wondering if there is a out-of-box way to define pickup and multiple delivery problem using Shipment or equivalent class without adding custom constraints. – Amit AK May 25 '16 at 11:03