Module 2/5 · Weeks 4–6 · 27 h

Routing

UAT 363 Unmanned Aircraft Systems Technology for Transportation and Smart Warehousing

About 90 minDraft, awaiting reviewLast updated 27 September 2026

Lesson

By the end of this module you will be able to

  1. Compute the distance and energy of multi-stop delivery routes
  2. Find the shortest route by exhaustive search and compare it with the nearest-neighbour method
  3. Check energy feasibility including reserve, and split work into several trips
  4. Explain drone–truck routing problems from the research literature

Prerequisites: UAT 363 module 1

Why this matters

The hospital must deliver to four health centres. Flying out and back to each one works but is wasteful. One round trip visiting all four is cheaper, but if the battery is insufficient the drone may come down on the way. A good visiting order cuts distance substantially, and checking energy with reserve before take-off is a safety matter, not just an economy.

The routing problem

Finding the order that visits every point and returns to the start with the shortest total distance is the traveling salesman problem (TSP). The number of possible orders grows very fast: stops have orders (counting both directions). Four stops have only 24, so all can be searched, but 15 stops have more than a trillion. Real systems therefore use heuristics that find good-enough answers quickly, such as the nearest-neighbour method, which always goes to the closest unvisited stop.

A map with the hospital H at the origin and health centres A, B, C and D. Blue arrows show the shortest route H to B to D to A to C and back to H, with a 1 kilometre scale bar
Figure 1. Hospital, health centres and the shortest route

Example 1. Exhaustive search versus nearest neighbour

Assumed coordinates in kilometres; H is the hospital.

import math
from itertools import permutations

SITES = {"H": (0, 0), "A": (1.0, 2.5), "B": (1.5, 0.0), "C": (-2.0, 1.0), "D": (4.0, 0.5)}

def length(order):
    stops = ["H", *order, "H"]
    return sum(math.dist(SITES[a], SITES[b]) for a, b in zip(stops, stops[1:]))

best = min(permutations("ABCD"), key=length)

current, left, greedy = "H", set("ABCD"), []
while left:
    nxt = min(sorted(left), key=lambda s: math.dist(SITES[current], SITES[s]))
    greedy.append(nxt)
    left.remove(nxt)
    current = nxt

print(f"exhaustive: H-{'-'.join(best)}-H = {length(best):.2f} km")
print(f"nearest neighbour: H-{'-'.join(greedy)}-H = {length(greedy):.2f} km "
      f"(+{length(greedy) / length(best) - 1:.0%})")
exhaustive: H-B-D-A-C-H = 13.25 km
nearest neighbour: H-B-A-C-D-H = 17.46 km (+32%)

Nearest neighbour starts well at B but gets stuck at C on the left, then has to fly far across to D on the right, ending about a third longer than the best answer. Heuristics should always be checked against better solutions where possible.

Energy and reserve

Usable energy is the battery capacity times the usable fraction, minus a reserve for the unexpected, such as headwind, waiting to land or turning back mid-route. The team must set the reserve as policy and never cut it to make a flight fit.

Example 2. Energy check and splitting into two trips

Assume 33.3 Wh/km with a 2 kg payload, a 500 Wh battery with 80% usable, and a 20% reserve.

import math
from itertools import combinations, permutations

SITES = {"H": (0, 0), "A": (1.0, 2.5), "B": (1.5, 0.0), "C": (-2.0, 1.0), "D": (4.0, 0.5)}
WH_PER_KM, BATTERY_WH, USABLE, RESERVE = 33.3, 500, 0.8, 0.2
available = BATTERY_WH * USABLE * (1 - RESERVE)

def best_trip(stops):
    def km(order):
        path = ["H", *order, "H"]
        return sum(math.dist(SITES[a], SITES[b]) for a, b in zip(path, path[1:]))
    order = min(permutations(stops), key=km)
    return order, km(order)

order, km = best_trip("ABCD")
print(f"available {available:.0f} Wh; one trip {km:.2f} km needs {km * WH_PER_KM:.0f} Wh "
      f"-> {'OK' if km * WH_PER_KM <= available else 'NOT feasible'}")

plans = []
for pair in combinations("ABCD", 2):
    other = "".join(s for s in "ABCD" if s not in pair)
    trips = [best_trip(pair), best_trip(other)]
    if all(k * WH_PER_KM <= available for _, k in trips):
        plans.append((sum(k for _, k in trips), trips))
total, trips = min(plans)
for o, k in trips:
    print(f"trip H-{'-'.join(o)}-H: {k:.2f} km, {k * WH_PER_KM:.0f} Wh")
print(f"two trips total {total:.2f} km")
available 320 Wh; one trip 13.25 km needs 441 Wh -> NOT feasible
trip H-A-C-H: 8.28 km, 276 Wh
trip H-B-D-H: 8.08 km, 269 Wh
two trips total 16.36 km

A single trip to all four stops needs more energy than is available, so the work is split into two trips. The best pairing is B with D and A with C. The total distance is about 23% longer than one trip, but every trip keeps its full reserve. In strong headwind the energy per kilometre rises, so recalculate before every flight.

Three horizontal bars. One trip to four stops needs 441 watt-hours, shown pink and beyond the dashed line. Trip H-B-D-H needs 269 and trip H-A-C-H 276, shown green and below the dashed line. The vertical dashed line is the 320 watt-hours available after reserve
Figure 2. Energy per trip against energy available

Drones working with trucks

Murray and Chu (2015) proposed the flying sidekick TSP, in which a delivery truck drives its route and a drone flies from the truck to nearby stops and back, so the drone never has to fly far from the depot. The review by Macrina and colleagues (2020) gathers many variants, such as multiple drones, multiple trucks and battery constraints. Where health centres are beyond drone range, this idea could use an ambulance or medicine van as a mobile drone base.

Module lab

Lab: planning medical delivery routes

  1. Find the real coordinates of a hospital and health centres near the university (or use the assumed ones) and convert them to kilometres
  2. Use Example 1 to find the best route and compare it with nearest neighbour
  3. Measure the lab drone’s real energy per kilometre from test flights, then plan trips with Example 2
  4. Check routes against restricted areas and communities, adjust them and recompute energy
  5. Simulate the flights in SITL and record the energy actually used against the plan

Common mistakes

Watch out

  • Using straight lines on the map without considering restricted areas and obstacles
  • Trusting a heuristic without checking its quality
  • Cutting the energy reserve to make the plan fit
  • Using a single energy-per-kilometre value when wind and payload vary
  • Forgetting take-off, landing and waiting time at stops

Summary

  • Ordering delivery stops is a TSP; the number of orders grows factorially
  • Nearest neighbour is fast but can be much longer than the best answer
  • Energy available = capacity × usable fraction × (1 − reserve); if it is not enough, split trips
  • Drones working with trucks extend service range, as in Murray and Chu’s research

Check your understanding

  1. How many orders are possible for five stops (counting both directions)?
  2. A 600 Wh battery with 80% usable and a 25% reserve leaves how much usable energy?
  3. Using question 2 at 30 Wh/km, what is the maximum distance?
  4. Why can the nearest-neighbour method produce long routes?
  5. What is the flying sidekick TSP?
Answers
  1. Wh
  2. km
  3. It chooses one step at a time without seeing the whole picture, and may leave distant stops to the end, forcing a long flight back
  4. A delivery truck acts as a moving base, and a drone flies from the truck to nearby stops and back

Key formulas

Route length
Energy available

Key references

  1. Murray, C. C., & Chu, A. G. (2015). The flying sidekick traveling salesman problem: Optimization of drone-assisted parcel delivery. Transportation Research Part C: Emerging Technologies, 54, 86–109. link
  2. Macrina, G., Di Puglia Pugliese, L., Guerriero, F., & Laporte, G. (2020). Drone-aided routing: A literature review. Transportation Research Part C: Emerging Technologies, 120, 102762. link
  3. Otto, A., Agatz, N., Campbell, J., Golden, B., & Pesch, E. (2018). Optimization approaches for civil applications of unmanned aerial vehicles (UAVs) or aerial drones: A survey. Networks, 72(4), 411–458. link
  4. Stolaroff, J. K., Samaras, C., O'Neill, E. R., Lubers, A., Mitchell, A. S., & Ceperley, D. (2018). Energy use and life cycle greenhouse gas emissions of drones for commercial package delivery. Nature Communications, 9, 409. link

Further reading

Study the assigned knowledge units in advance, review media and take the module quiz

In class / field

Intensive lab and field practice recorded in a lab notebook

Learning evidence: Lab notebook signed by the instructor

Module quiz

This is a formative self-check, not a graded exam

Knowledge domain: Delivery, indoor operations and warehousing · Mathematics, physics and statistics