Nexma

Optimize a delivery fleet

Routing at scale

In this tutorial you will optimize a full day of deliveries for a vehicle fleet — from raw stops and depots to balanced, time-window-respecting routes, with a daily re-optimization scheduled to run on its own. You will learn how to create a project with the Logistics skill, load depots, vehicles, and stops with time windows, ask Jax to build optimal routes with Nexma MathEngine, inspect routes on the Globe, compare scenarios, and schedule an automation. The only prerequisite is an account in an organization; see Quickstart if you need one.

What you'll build

A solved vehicle-routing problem for one depot and a fleet: every stop assigned to a route, sequenced to honor delivery time windows, kept under vehicle capacity and driver hours-of-service. You will end with routes you can hand to drivers, a side-by-side scenario comparison, and an automation that re-optimizes the routes every morning.

1. Create the project

From Projects → New, name the project (for example, "Tri-County Delivery") and bind its world model:

  1. Pick the Logistics ontology — Warehouse, DistributionCenter, Vehicle, Shipment, Order, Inventory, Route.
  2. Add the Logistics skill, which carries the vehicle classes, default dwell times, and the routing constraints (capacity, time windows, driver hours).
  3. Click create. The project opens with its own Globe view and Jax session.

See Projects and Skills overview.

2. Load depots, vehicles, and stops

Open the Globe and place your depot — search to its address and drop a Warehouse entity, or import it through Nexma SyncEngine.

Then bring in the work:

  • Stops. Connect an orders feed, each carrying a location, a weight or volume, a service (dwell) time, and a delivery time window. With no feed, ask Jax to load a sample: "Place 80 delivery stops across the service area, each with a weight and a two-hour delivery window."
  • Vehicles. Define the fleet: "Add 12 box trucks to the depot, each with a 900 kg capacity and a 10-hour shift starting at 07:00."

Click a few stops to confirm weights and windows look right before routing.

3. Design with Jax

Open the Jax panel and describe the day you want planned, naming every constraint that matters:

Plan tomorrow's routes for all 12 vehicles out of this depot. Honor every stop's delivery window, keep each truck under its capacity, and hold shifts under 10 hours including service time. Minimize total drive time.

Jax formulates this as a vehicle-routing problem with time windows and dispatches it to Nexma MathEngine. Routes stream onto the Globe as colored polylines from the depot, vehicles as markers along them, stops graduated by load.

Push on the result:

  • "Which route is tightest on time?"
  • "Are any vehicles underused?"
  • "Why is this stop last on its route?"

4. Optimize and validate

The first solve gives a feasible plan; now tune it and confirm it holds. Ask Jax to rebalance:

Balance load across the fleet so no truck runs more than 30 minutes longer than the shortest. Keep all windows and capacity. Re-optimize for total drive time.

Then validate explicitly:

Run the capacity check, the time-window check, and the hours-of-service check across every route. Flag any violation.

Any infeasible stop is flagged on the Globe. If a window cannot be met, ask Jax to handle it — "move the violating stops to a 13th vehicle and re-route" — and re-validate. See the Logistics skill and Running an optimization.

5. Review and compare scenarios

Review on the Globe. Click a route to read its sequence and arrival-time estimates; hover a stop for service time and cumulative load.

Now compare alternatives. Branch the DataStore to test a smaller fleet:

On a new branch, re-solve with 10 vehicles instead of 12, allowing 11-hour shifts. Then compare against main — total drive time, vehicles used, and any window violations.

Compare the branch against main the way a reviewer reads a pull request: routes rewired, constraints checked, totals side by side. Keep whichever scenario meets your service level at the lower cost. See Spatial Branches.

6. Operate — schedule a daily re-optimization

Routes are only useful if they stay current. Export today's plan from Project → Export as route sheets, a TMS import file, or GeoJSON. Then make the re-optimization recurring:

Create a daily automation that, every morning at 05:00, pulls the latest orders feed, re-solves the routes for the available fleet under the same constraints, and writes the new routes to the project.

The automation runs on its own each morning, so dispatchers open the project to a fresh, feasible plan. When orders are added or cancelled mid-day, ask Jax to replan the affected routes in place. See live data.

Recap

You created a Logistics project, loaded a depot, a fleet, and stops with time windows, solved the routing problem with Jax and MathEngine, rebalanced and validated against capacity, windows, and driver hours, compared a smaller-fleet scenario on a branch, exported route sheets, and scheduled a daily re-optimization. Every step was a real, reversible change grounded in the project's world model.

Where to go next

Optimize a delivery fleet