Skip to content

Break not scheduled after a constrained delivery - shipment dropped as unassigned #1345

Description

@jlannoy

When a shipment keeps the vehicle loaded right up to a delivery time window, and a break's time window opens at/after that delivery deadline, VROOM does not place the break after the drop-off. Instead it reports the shipment as unassigned, even though a valid solution exists (deliver, then take the break while empty, then return).

It looks like the break is only considered for placement in the idle time before the delivery (where the vehicle is still loaded), and is never deferred to the empty period after the delivery.

To reproduce :

{
  "vehicles": [
    {
      "id": 1,
      "profile": "car",
      "start_index": 0,
      "end_index": 0,
      "time_window": [28800, 57600],
      "breaks": [
        { "id": 1, "service": 1800, "time_windows": [[40800, 50400]] }
      ]
    }
  ],
  "shipments": [
    {
      "pickup":   { "id": 10, "location_index": 1, "service": 0 },
      "delivery": { "id": 11, "location_index": 2, "service": 0,
                    "time_windows": [[39900, 40800]] }
    }
  ],
  "matrices": {
    "car": {
      "durations": [
        [   0, 1800, 1800],
        [1800,    0, 1800],
        [1800, 1800,    0]
      ]
    }
  }
}

Here the delivery window is [39900, 40800] (11:05–11:20) and the break window is [40800, 50400] (11:20–14:00), i.e. it opens only after the delivery deadline — so the only possible placement is after the drop-off.

Expected:
one route, 0 unassigned. A valid schedule exists, e.g.
start → pickup(10) → delivery(11) @ 40800 → break(1) @ 40800–42600 → end @ 44400, all within the vehicle and break windows.

Actual: code:
0, summary.unassigned: 2, with pickup 10 and delivery 11 unassigned and no route using the vehicle.

Additional notes:

  • Removing the breaks entry makes the problem solvable (the route itself is feasible).
  • Widening the break window so it opens before the loaded leg (e.g. [28800, 57600]) also makes it solvable — the break is then placed before/around the delivery. The problem only appears when the break window opens during/after the loaded delivery leg, when an after-delivery placement is required.
  • Adding "max_load": [0] to the break (break only when empty) does not change the outcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions