4

I am working on a variant of a VRP and looking to solve it using Optaplanner.

I have a shipping company that has list of all jobs that needs to be fulfilled for the next day (so the demand is generated at least a day earlier). This company has multiple drivers that might be suitable for servicing one or more jobs.

Each job has following elements:

  • Job_ID

  • Pickup Time (Job must be pickup at or after this time)

  • Pickup Location

  • Delivery Time (Job must be drop-off at or before this time)

  • Delivery Location, and

  • List of possible drivers that are eligible to do this job (out of which only one driver will ultimately take up the job.)

One driver may service one or many jobs, but each job must be serviced by only one driver.

Objective is: Using as few drivers as possible, come up with job-assignments to each driver and the sequence he/she should be picking up and delivering the job that will minimize total time to delivery.

Please note that a driver can pick up Job 1, then Job 2, then Job 3, then drop-off Job 2, then pickup Job 4, then drop-off jobs 1, 4 and 3. So there is no ordering in which the jobs needs to be picked up or dropped off. Whichever sequence minimizes the time will be preferred. The only obvious constraint is job must be first picked up before it can be dropped off.

Also each driver can start from their home location (so there is no one fixed depot) and after he/she delivers the last job, company doesn't care where he/she goes (so no need to calculate the time between last drop-off and driver home).

I have solved this using Genetic Algorithm using Watchmaker framework. But I wish to use other meta-heuristics like Tabu Search or Simulated Annealing.

I have read many forum topics here that talk about VRP, but still I am searching for answers. My problem is how to construct CHAINING and use SHADOW VARIABLES so that you have a valid chain of sequence of pickup locations and drop-off locations.

Any pointers will be greatly appreciated...

Thanks,

Vikas

  • Have you looked at [the source code of the Vehicle Routing with Time Windows example](https://github.com/droolsjbpm/optaplanner/tree/master/optaplanner-examples/src/main/java/org/optaplanner/examples/vehiclerouting/domain)? – Geoffrey De Smet Oct 31 '15 at 15:35
  • Thanks Geoffrey. Yes I did. That problem has single depot from where the vehicle departs and in process picks up all the jobs and brings it back to the depot. I can deal with the TimeWindow constraints. But in my case each job has a pickup location and drop-off location and I am struggling to formulate that correctly. How can I keep track of these locations - what and where should I used the shadow variables if I modify the VRP with Time Window example? – Vikas Agrawal Oct 31 '15 at 19:29
  • Split up TimeWindowedCustomer.getLocation() into getPickupLocation() and getDropOffLocation(). The serviceDuration of a TimeWindowedCustomer should the time it takes to go from the pickup location to the dropOff location. – Geoffrey De Smet Nov 01 '15 at 19:27
  • Thanks Geoffrey for your response. But I think in your recommended procedure there is tacit assumption that driver will pick up one job and he will deliver that job first before picking up the next job and so on. In my case, a driver is allowed to pick-up multiple jobs before he can deliver them. For e.g., a driver can pick up Job_1, then Job_2, then deliver Job_1, then pickup Job_3, then pickup Job_4, then deliver Job_4, Job_2 and Job_3. As you see there is no specific ordering in which the jobs were picked up and delivered. – Vikas Agrawal Nov 02 '15 at 12:26
  • Also in my case I need to print this specific sequencing of picking up jobs and delivering them so that company can hand this over to the driver and ask him to follow this sequence as this will minimize the fuel consumption. If you can suggest some pointers, that would be great help. – Vikas Agrawal Nov 02 '15 at 12:27
  • 1
    That's a more difficult VRP variation indeed. Users have done it before. IIRC they had a separate entity for pickup and dropoff and they added custom moves to move the DropOffCustomer if the PickUpCustomer changes (and vica versa). – Geoffrey De Smet Nov 03 '15 at 08:12
  • That's the way I did when I used Genetic Algorithm. I manually created a chain and I had randomly put CustomerPickupLocations and CustomerDropOffLocations in the chain for all customer. Then I wrote a code to make sure every DropOffLocation for a particular customer comes after respective PickUpLocations. That helped me solve that problem. – Vikas Agrawal Nov 03 '15 at 19:52
  • Is there a way to move the entities around in the chain in OptaPlanner? I mean if I can go through each DropOffCustomer and PickUpCustomer and make sure DropOffCustomer comes later than its respective PickUpCustomer, that should solve the problem. – Vikas Agrawal Nov 03 '15 at 19:55
  • 1
    @VikasAgrawal did you figure out how to set this up ? Please let me know – Pavan K Apr 20 '16 at 17:49
  • @VikasAgrawal I'm also interested in this VRP variant. Did you figured it out? – Rafał Sobota Sep 20 '16 at 10:35

0 Answers0