USE CASE / MULTI-STOP-DELIVERY

Multi-stop delivery: don't bury the first stop

A delivery van loads for several stops in one trip - a tight load is worthless if the first stop's crate ends up behind the last one's.

WHEN YOU NEED THIS

Route planning for last-mile or multi-drop delivery, where the loading order matters as much as the packing itself - a driver cannot re-pack the van at the kerb.

pack() places the items; a second, separate call reads those placements back and reports, per item, whether it can be reached without moving anything blocking it - the loading question and the fitting question are answered by two different tools, not conflated into one.

RULES IN PLAY
SHOWN IN Node / JavaScript
import { pack, placementReachability } from '@packvium/engine';

const request = {
  items: [
    { id: 'stop-1-crate', quantity: 1, weight: '10 kg',
      dimensions: { length: '300', width: '300', height: '300' } },
    { id: 'stop-2-crate', quantity: 1, weight: '10 kg',
      dimensions: { length: '300', width: '300', height: '300' } },
  ],
  containers: [
    { id: 'van', cost_minor: 100, max_payload: '200 kg',
      inner_dimensions: { length: '600', width: '300', height: '300' } },
  ],
};

const result = pack(request);
const container = result.containers[0];
const mm = (scalar) => Number(scalar.value);
const boxes = container.placements.map((placement) => ({
  origin: { x: mm(placement.position.x), y: mm(placement.position.y), z: mm(placement.position.z) },
  dimensions: {
    length: mm(placement.dimensions.length),
    width: mm(placement.dimensions.width),
    height: mm(placement.dimensions.height),
  },
}));
const dims = {
  length: mm(container.inner_dimensions.length),
  width: mm(container.inner_dimensions.width),
  height: mm(container.inner_dimensions.height),
};
// Stop order matches placement order here; a real caller looks it up per item id.
const stops = [0, 1];

console.log(placementReachability(boxes, dims, stops));
WHAT COMES BACK

The crate for stop 1 comes back reachable: true. The crate for stop 2 comes back reachable: false, blocked_by_route: [0] - it sits behind the first crate, which is exactly where it should be, since it isn't due out until the first crate already is.

THE PACKED RESULT, IN 3D
200×100×100 · 25.0% used
first × 1second × 1
WHAT A REFUSAL LOOKS LIKE HERE
multi-stop-delivery

blocked_by_route blocked_by_route

placementReachability names the earlier stop's crate as the obstruction, by its index in the placement list - not a generic 'cannot unload' with no cause. Once that crate is out, the same call reports the second one reachable.

WHAT CHANGES IN YOUR PROCESS
TODAY
  • The van is loaded in whatever order the goods reach the bay, and the driver digs for each stop's goods at the kerb.
  • Time at every stop grows with how deep its goods are buried.
  • Loaders work from memory of the route, which changes daily.
WITH PACKVIUM
  • The van is loaded so every stop's goods are in front of the goods for later stops.
  • The loader follows a step list that goes in through the door without passing anything already loaded.
  • The route from the planning system drives the load directly, so a new route needs no new habits.
WHAT TO MEASURE
  • Average time spent at each stop
  • Stops where goods had to be moved to reach the delivery
  • Loading time per vehicle

Run a month of past orders through the same request and compare these numbers with what you actually shipped. That comparison, on your own data, is the only figure worth quoting.

WHY PACKVIUM

A van packed for maximum density and packed for a deliverable route are two different problems, and optimising only the first one costs time at every stop the load fights back at. Reachability is checked against the route, not assumed from how tightly things fit.

Open this request
INSTALL
npm install @packvium/engine