Calculadora COMEX Perú

Home / Supply chain, technology and AI / Module 4

4.5 Deciding routes and distribution with AI

AI helps you organize the delivery problem, group deliveries and compare cost scenarios. Distances come from a map, and you check the capacity, the time windows and the final decision.

Module 4: AI applied to logistics, no coding needed · Reviewed on 12/10/2026 · Español

Goal: Check a delivery plan proposed by AI by adding up the load per vehicle, and compare the cost of two plans using kilometers and fixed costs.

Deciding routes and distribution means answering three questions: which customers each vehicle serves, in what order and along which path. Specialists call it the vehicle routing problem: minimizing cost or time while respecting limits such as vehicle capacity, time windows (the hours when the customer receives goods) and the driver's working day. With few stops, you can solve it by hand. With dozens, it gets hard.

Without coding, AI helps you in four ways: organizing the problem (listing data and constraints you forgot), grouping deliveries by zone, proposing a first plan and comparing cost scenarios. Its plans are usually a heuristic: a rule of thumb that gives a reasonable solution quickly, but with no guarantee of being the best. For dozens of stops with real traffic, use a route optimization app. AI is useful for preparing the data and analyzing the results.

There are clear limits. A chat assistant does not know today's traffic or the real distances, and it may make them up. Take distances and times from a map service and paste them into your spreadsheet. Also check that the plan meets the constraints: add up each vehicle's load, check the time windows and make sure each customer appears only once. And ask the drivers: they know about closed streets, difficult access and unloading times that are not in any data.

Measure the result with a few indicators: kilometers per delivery, cost per delivery, vehicle utilization (load ÷ capacity) and compliance with time windows. The plan with the fewest kilometers is not always the best: it may leave the load at 100% with no margin, or arrive late to the most important customer. Also think about contingencies, such as a breakdown or a last-minute cancellation.

The same logic applies to international routes. When the Panama Canal changes the number of transits or the allowed draft, or when a crisis diverts ships to another route, cost and time change. AI does not know which notice is current: check it in the authority's official source and with your freight forwarder, and only then compare scenarios. Also, your customers' addresses may be personal data (Law 29733): use codes or zones when you consult the AI.

Key ideas

DecisionHow AI helpsWhat you check
Assign customers to vehiclesGroups by zone and proposes a first planThat each vehicle's load does not exceed its capacity
Order the stopsSuggests a sequence using a rule of thumbReal distances from a map and time windows
Compare scenariosCalculates costs with the assumptions you give itThat the assumptions are yours and reasonable
Plan for contingenciesProposes protocols for breakdowns or cancellationsThat they can be applied in practice
Choose an international routeSummarizes alternatives and their impactCurrent notices from the authority and the freight forwarder

Worked example

Delivering to 9 corner stores with 2 vans
  1. Lácteos del Valle S.A.C. (a fictional company from Lima) must deliver today to 9 corner stores (bodegas) with 2 vans of 1,000 kg each. Orders in kg. North: N1 180, N2 220, N3 150. Center: C1 250, C2 200, C3 300. South: S1 120, S2 160, S3 140. Total: 550 + 750 + 420 = 1,720 kg.
  2. Calculate the current plan, which fills van 1 in list order (N1, C1, S1, N2, C2, S2, N3, C3, S3). Van 1: N1, C1, S1, N2 and C2 = 180 + 250 + 120 + 220 + 200 = 970 kg. S2 (160) would push it over 1,000, so van 2 carries S2, N3, C3 and S3 = 160 + 150 + 300 + 140 = 750 kg. On a map you measure 74 km and 69 km: 143 km in total.
  3. Prepare the data for the AI: use codes instead of names and addresses, and paste the distance table from the map. Ask: “Group by zone, respect 1,000 kg per van, minimize kilometers and show the load of each one.”
  4. Suppose the AI proposes van 1 with the whole North zone and the whole Center zone, and van 2 with the South zone. It seems logical because it groups by zone. Check: North = 180 + 220 + 150 = 550 kg; Center = 250 + 200 + 300 = 750 kg. Van 1 would carry 550 + 750 = 1,300 kg, which exceeds 1,000 kg. The plan is not feasible.
  5. Ask it to split the Center zone. New plan: van 1 with North and C1 = 550 + 250 = 800 kg; van 2 with C2, C3 and South = 200 + 300 + 420 = 920 kg. Total: 800 + 920 = 1,720 kg, the same as the orders. Utilization is 80% and 92%, with a margin for unexpected events.
  6. Measure the new plan on the map: 52 km and 58 km, 110 km in total. With a cost of S/ 3.20 per km and S/ 90 fixed per route (assumptions for this example), the new plan costs 110 × 3.20 + 2 × 90 = 352 + 180 = S/ 532.00. The current plan costs 143 × 3.20 + 180 = 457.60 + 180 = S/ 637.60.
  7. Ask the driver: C2 only receives goods until 10:00. You make C2 the first stop for van 2 and confirm on the map that the distance stays at 58 km (example data).
  8. Define how you will measure the result: kilometers per delivery = 110 ÷ 9 = 12.2 km (before, 143 ÷ 9 = 15.9 km), utilization of 80% and 92%, and meeting C2's time window. You review the results for a week before setting the plan.

Result: The checked plan costs S/ 532.00 per day versus S/ 637.60 for the current plan: S/ 105.60 less per day, about S/ 2,745.60 a month with 26 delivery days. The AI first proposed a plan that exceeded capacity by 300 kg, and adding up the load caught it.

Real cases

UPS optimizes delivery routes with its ORION system

2015

UPS's sustainability page explains that ORION, its route optimization system, calculates the most fuel-efficient route using data from 250 million addresses. By the end of 2015 it was on 70% of the initial U.S. routes, and full rollout was expected by the end of 2016. With all routes in that country, the company projects a reduction of 100 million miles a year and 100,000 metric tons of CO2. These are company projections, not results measured by a third party.

Optimizing routes with data cuts kilometers, but treat announced savings as projections and measure your own.

Source: UPS – Optimized Network (Committed to More)

The Panama Canal changes transits and maximum draft

16/04/2024

On 16/04/2024, the Panama Canal Authority announced new measures: up to 32 daily transits in total, with 24 through the Panamax locks starting May 16 and 8 through the Neopanamax locks starting June 1. It also raised the maximum draft in the Neopanamax locks to 13.71 m (45 feet) from June 15, compared with 13.41 m (44 feet). The note links draft to water availability and the projections for Gatún Lake. It matters because each change affects the times and costs of those who use that route.

Before choosing an international route, confirm the authority's current notices: AI does not know them.

Source: Autoridad del Canal de Panamá – Panama Canal Announces New Measures Regarding Number of Transits and Maximum Draft

Common mistakes

Practise with the calculators, the COMEX Simulator and the review questions on the main page.

Open this topic in the calculator →
← Previous topic: Comparing transport providers with AI