vrp icon indicating copy to clipboard operation
vrp copied to clipboard

Optional pickups and job demand sum

Open qwelias opened this issue 2 years ago • 1 comments

Consider a case where there's three pickup places A, B and C, and a delivery place D, such as:

  • A has [2] items available for pickup
  • B has [1] items available for pickup
  • C has [1] items available for pickup
  • D has demand of [3]
  • We don't know if it's cheaper to pickup A+B or A+C, so it should be up to VRP

Such problem model does not seem to be possible because of at least two hard requirements:

  1. sum of pickup demand should be equal to sum of delivery demand

  2. all pickup/delivery tasks should be done or none of them

The first one is violated because pickups would need to have more demand than delivery in order to model that case.

The second one is violated because it is possible to specify demand only on the task and all tasks have to be completed, but this case requires modelling an extra pickup task because we don't know which is more optimal.

qwelias avatar Jul 27 '23 13:07 qwelias

Yes, these are the hard requirements of multi-jobs.

Possible work-arounds for your use case:

Option 1: tour order

  • use tour order feature to have pickups ordered strictly before delivery
  • post-processing if delivery cannot be done or pickups are not optimal

Can be an solution if all pickups from all jobs should be done before any of deliveries (or you can have this split in less strict form somehow )

Option 2: alternative places

  • merge definitions of optional pickups with the same demand into a single pickup but with alternative places

See job.tasks.places definition: https://reinterpretcat.github.io/vrp/concepts/pragmatic/problem/jobs.html#tasks https://github.com/reinterpretcat/vrp/blob/master/vrp-pragmatic/src/format/problem/model.rs#L76

This can work if demand for B and C is equal all the time. If this rule holds, then this is the best solution I think.

reinterpretcat avatar Jul 27 '23 20:07 reinterpretcat