Module 7/10 · Weeks 10–11 · 14 h

Job scheduling and routing

UAT 457 UAS for Transportation and Autonomous Delivery

About 90 minDraft, awaiting reviewLast updated 1 October 2026

Lesson

By the end of this module you will be able to

  1. Compare first-come-first-served and earliest-due-date dispatching using job lateness
  2. Use utilisation and Little's law to estimate fleet size and time in the system
  3. Model the corridor network as a graph and find shortest routes with Dijkstra's algorithm
  4. Set rules for rescheduling when new jobs arrive or a corridor closes

Prerequisites: Module 6 System architecture and job intake · UAT 104 Computer Programming

Why this matters

Once jobs are accepted, the system must answer two questions whenever a job arrives or a drone becomes free: which job next and which way to fly. They look easy with two or three jobs, but on a morning when several factories order parts at once, a poor order can make an urgent job tens of minutes late even though the drones fly the same distance. And if there are not enough drones, the queue keeps growing however clever the ordering.

This module applies scheduling theory, queueing and graph search to the estate case from module 6. Routing that visits several drop points per flight while accounting for weight and energy (vehicle routing) is covered in modules 1–5 of this course; in this case each drone carries one job per flight.

The job queue and dispatching rules

Suppose one drone has several jobs waiting. Job takes (round trip, landing, hand-over, battery swap) and is due at . It completes at . Its lateness is ; a negative value means early, and jobs with are late. Common measures are the maximum lateness and the number of late jobs.

Three dispatching rules are common.

  • First come, first served (FIFO) feels fair to requesters but ignores deadlines
  • Earliest due date (EDD) sorts by ; scheduling theory proves that on a single machine EDD gives the lowest possible (Pinedo, 2022)
  • Priority classes, for example QC samples holding up a production line go first, combined with another rule inside each class

Note that EDD makes the worst job less late but does not guarantee the fewest late jobs. If the goal is to minimise the number of late jobs, another method is needed, such as the Moore and Hodgson algorithm, which moves long jobs that cause lateness to the end (Pinedo, 2022). Choosing a rule starts with asking what hurts the customer more.

Example 1 The night shift has one drone

The night shift opens one dock with six jobs waiting. Each job takes a round trip along the corridor at 12 m/s plus 6 minutes for landing, hand-over and battery swap (assumed).

# one drone, six queued jobs: compare first-come-first-served (FIFO) with earliest due date (EDD)
route_km = {"F1": 2.09, "F2": 3.23, "F3": 3.59, "F4": 4.85, "F5": 4.20, "F6": 4.79}
V, T_FIX = 12.0, 6.0                       # m/s; landing, hand-over and battery swap per job (min)
jobs = [("A", "F3", 40), ("B", "F1", 25), ("C", "F5", 75),     # (job, drop point, due in min)
        ("D", "F2", 35), ("E", "F1", 20), ("F", "F6", 90)]      # listed in arrival order

def p(dest):                                # round-trip cycle time of one job (min)
    return 2 * route_km[dest] * 1000 / V / 60 + T_FIX

def schedule(order):
    t, out = 0.0, []
    for job, dest, due in order:
        t += p(dest)                        # completion time of this job
        out.append((job, round(t - due, 1)))  # lateness = completion - due
    return t, out

print("cycle times:", {d: round(p(d), 1) for d in route_km})
for name, order in (("FIFO", jobs), ("EDD", sorted(jobs, key=lambda j: j[2]))):
    t, out = schedule(order)
    late = sum(L > 0 for _, L in out)
    print(f"{name}: finish {t:.1f} min, late jobs {late}, max lateness {max(L for _, L in out):.1f} min")
    print("  lateness:", out)
cycle times: {'F1': 11.8, 'F2': 15.0, 'F3': 16.0, 'F4': 19.5, 'F5': 17.7, 'F6': 19.3}
FIFO: finish 91.5 min, late jobs 4, max lateness 52.2 min
  lateness: [('A', -24.0), ('B', 2.8), ('C', -29.6), ('D', 25.4), ('E', 52.2), ('F', 1.5)]
EDD: finish 91.5 min, late jobs 3, max lateness 14.6 min
  lateness: [('E', -8.2), ('B', -1.4), ('D', 3.6), ('A', 14.6), ('C', -2.8), ('F', 1.5)]

Both orders finish all work at 91.5 minutes, because the jobs are the same. Under FIFO, job E, the most urgent, is done fifth and is 52.2 minutes late. EDD cuts the maximum lateness to 14.6 minutes and late jobs from four to three. Ordering does not make the drone fly less; it moves lateness onto jobs that can wait.

Paired bars for jobs A to F, orange for FIFO and blue for EDD: job A minus 24 and 14.6, job B 2.8 and minus 1.4, job C minus 29.6 and minus 2.8, job D 25.4 and 3.6, job E 52.2 and minus 8.2, job F 1.5 under both
Figure 1 Lateness of each job under FIFO and EDD

Workload and fleet size

Dispatching rules help only when there are enough drones. Otherwise the queue grows without limit. The measure that shows this is utilisation , where is the job arrival rate, the mean time one drone spends per job and the number of drones. If , jobs arrive faster than they can be served and the queue never stops growing. Even slightly below 1, waits become very long because jobs do not arrive evenly, so the team sets a ceiling such as 0.85.

Little’s law states that the mean number of jobs in the system equals the arrival rate times the mean time a job spends in the system : . It holds very generally, regardless of the arrival pattern or the dispatching rule. Little (2011) shows that over a finite period that starts and ends with an empty system the relation holds exactly for measured data. Its value is that measuring any two quantities gives the third without tracking jobs one by one.

Example 2 How many drones for the morning peak?

Between 8:00 and 9:00, 18 jobs arrive per hour. The mean time per job for this mix of destinations is 16 minutes, and the team accepts utilisation up to 0.85. Last week’s log shows 15 jobs per hour on average with 7.5 jobs in the system on average (assumed).

# how many drones for the peak hour, and what Little's law says about waiting (assumed values)
lam = 18          # jobs per hour at peak
S = 16.0          # mean drone cycle per job (min), from the demand mix
target = 0.85     # highest utilisation the team accepts

load = lam * S / 60                         # drones kept busy on average
print(f"offered load {load:.2f} drones")
for c in range(4, 8):
    rho = load / c
    print(f"{c} drones: utilisation {rho:.2f} {'ok' if rho <= target else 'too high'}")

# Little's law L = lambda * W, from last week's log
lam_week, L_week = 15, 7.5                  # jobs/h and mean jobs in the system
W = L_week / lam_week * 60
print(f"mean time in system W = {W:.0f} min")
offered load 4.80 drones
4 drones: utilisation 1.20 too high
5 drones: utilisation 0.96 too high
6 drones: utilisation 0.80 ok
7 drones: utilisation 0.69 ok
mean time in system W = 30 min

The peak keeps 4.8 drones busy on average for the whole hour, so four drones can never keep up. Five works in theory at 96% utilisation, but the queue grows long whenever jobs bunch, so the team chooses six. Last week a job spent 30 minutes in the system on average from acceptance to closure, a figure obtained from two averages the dashboard already shows.

The corridor network and shortest routes

On an industrial estate a drone should not fly straight from point to point, because it must avoid chemical tanks, substations, stacks and roofs where people work. The team therefore defines corridors in advance along roads and fence lines, each surveyed and approved. Turning points are waypoints. The network is a graph whose nodes are the service centre, waypoints and drop points, and whose edges are corridors weighted by length.

Shortest paths on a graph with non-negative weights are found with Dijkstra’s algorithm (Dijkstra, 1959), which settles nodes in order of distance from the start and always returns the shortest path. With an estimate of the remaining distance that never overestimates, A* (Hart and colleagues, 1968) returns the same answer while expanding fewer nodes. The estate graph has only a few dozen nodes, so Dijkstra is fast enough. A big advantage of an approved corridor graph is that every route returned has already been checked for safety, rather than invented by an algorithm in unsurveyed space.

Example 3 Finding routes, and finding them again when a corridor closes

Node coordinates are in kilometres from the service centre (assumed). Today a crane is lifting roof trusses next to the W3 to W5 corridor, so the administrator closes that segment.

import heapq, math
# corridor network of the estate: node coordinates in km (assumed)
P = {"H": (0.0, 0.0), "W1": (1.0, 0.6), "W2": (1.4, -0.6), "W3": (2.2, 1.2), "W4": (2.6, -0.2),
     "W5": (3.4, 0.8), "F1": (1.0, -1.0), "F2": (1.6, 1.6), "F3": (2.6, -1.0), "F4": (3.0, 1.8),
     "F5": (4.0, -0.4), "F6": (4.4, 1.0)}
E = [("H", "W1"), ("H", "W2"), ("W1", "W2"), ("W1", "W3"), ("W2", "W4"), ("W3", "W4"), ("W3", "W5"),
     ("W4", "W5"), ("W2", "F1"), ("W3", "F2"), ("W4", "F3"), ("W5", "F4"), ("W4", "F5"), ("W5", "F6"), ("W5", "F5")]

def dijkstra(src, dst, closed=()):
    g = {}
    for a, b in E:
        if (a, b) in closed or (b, a) in closed:
            continue                          # corridor closed (e.g. crane at work)
        w = math.dist(P[a], P[b])
        g.setdefault(a, []).append((b, w)); g.setdefault(b, []).append((a, w))
    dist, prev, pq = {src: 0.0}, {}, [(0.0, src)]
    while pq:
        d, u = heapq.heappop(pq)
        if u == dst:
            break
        if d > dist[u]:
            continue
        for v, w in g.get(u, []):
            if d + w < dist.get(v, math.inf):
                dist[v], prev[v] = d + w, u
                heapq.heappush(pq, (d + w, v))
    path = [dst]
    while path[-1] != src:
        path.append(prev[path[-1]])
    return dist[dst], "-".join(reversed(path))

for f in ("F1", "F2", "F3", "F4", "F5", "F6"):
    d, path = dijkstra("H", f)
    print(f"H to {f}: {d:.2f} km via {path}")
d, path = dijkstra("H", "F6", closed=[("W3", "W5")])
print(f"W3-W5 closed, H to F6: {d:.2f} km via {path}")
H to F1: 2.09 km via H-W2-F1
H to F2: 3.23 km via H-W1-W3-F2
H to F3: 3.59 km via H-W2-W4-F3
H to F4: 4.85 km via H-W1-W3-W5-F4
H to F5: 4.20 km via H-W2-W4-F5
H to F6: 4.79 km via H-W1-W3-W5-F6
W3-W5 closed, H to F6: 5.09 km via H-W2-W4-W5-F6

These are the distances the intake gate in module 6 uses. Corridor routes are longer than straight lines: F4 is 3.50 km away in a straight line but 4.85 km along the corridors. With W3 to W5 closed, the route to F6 swings south through W2 and W4 and grows by 0.30 km, about 25 seconds more on each one-way flight at 12 m/s.

Corridor graph map: node H in yellow at left, waypoints W1 to W5 in grey and drop points F1 to F6 in green. The normal route to F6 in blue runs through W1 and W3; the W3 to W5 segment is a dashed pink line closed for a crane; the new green route runs through W2, W4 and W5 to F6, 5.09 kilometres
Figure 2 Estate corridor network and the detour when W3 to W5 is closed

Rescheduling when things change

A schedule is not made once a day. The system replans on events such as a new job, a drone becoming free, a drone returning early or a corridor closing. Replanning too often also hurts: a recipient told “ten minutes” whose job keeps sliding stops trusting the times the system gives. Three rules are common.

  • Freeze jobs already dispatched: jobs in ASSIGNED or IN_FLIGHT are not reordered unless safety requires it
  • Replan on events, not every second, compare with the current plan and switch only when the gain passes a threshold
  • Recompute routes whenever the graph changes, and send the new arrival time to the recipient

The review by Macrina and colleagues (2020) collects many drone routing problems, both static ones and ones where jobs arrive during the day, which become useful as the system grows.

Module lab

Lab: a scheduler and a route finder

  1. Build a corridor graph of at least 10 nodes for the site your group chose in module 6, marking areas to avoid and why
  2. Use the code in Example 3 to route to every drop point, then close three corridor segments and record added distance and unreachable drop points
  3. Create 10 jobs with deadlines and compare FIFO and EDD with the code in Example 1; report maximum lateness and the number of late jobs
  4. Estimate the fleet size for your site’s peak with the code in Example 2, and write your group’s rescheduling rules

Common mistakes

Watch out

  • Believing clever ordering fixes a fleet that is too small: if the queue grows whatever the rule
  • Targeting nearly 100% drone utilisation: it sounds efficient, but waits become very long when jobs arrive unevenly
  • Estimating delivery time from straight-line distance when drones must follow corridors
  • Letting a planner invent routes in unsurveyed space instead of using the approved corridor graph
  • Rescheduling every second, so the time promised to recipients keeps changing

Summary

  • Lateness is ; EDD gives the lowest maximum lateness on one machine but not necessarily the fewest late jobs
  • Utilisation must stay well below 1, and Little’s law gives the third quantity from two measured ones
  • Write approved corridors as a graph and find shortest routes with Dijkstra; when a corridor closes, remove the edge and search again
  • Replan on events, freeze dispatched jobs, and send recipients the new arrival time

Check your understanding

  1. A job completes at minute 45 and is due at minute 40. What is its lateness?
  2. 12 jobs per hour, 16 minutes per job on average, 4 drones. What is the utilisation?
  3. 20 jobs per hour, each spending 24 minutes in the system on average. How many jobs are in the system on average?
  4. If the goal is to minimise the number of late jobs, is EDD alone the right rule? Why?
  5. In the graph of Example 3, if the W4 to F5 corridor is closed, what is the route from H to F5 and how long is it?
Answers
  1. minutes (5 minutes late)
  2. jobs
  3. No. EDD minimises maximum lateness but does not guarantee the fewest late jobs; use a method such as the Moore and Hodgson algorithm
  4. H-W1-W3-W5-F5, 5.11 km (call dijkstra("H", "F5", closed=[("W4", "F5")]))

Key formulas

Job lateness
Fleet utilisation
Little law

Key references

  1. Pinedo, M. L. (2022). Scheduling: Theory, algorithms, and systems (6th ed.). Springer. link
  2. Little, J. D. C. (2011). Little's law as viewed on its 50th anniversary. Operations Research, 59(3), 536–549. link
  3. Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. Numerische Mathematik, 1, 269–271. link
  4. Hart, P. E., Nilsson, N. J., & Raphael, B. (1968). A formal basis for the heuristic determination of minimum cost paths. IEEE Transactions on Systems Science and Cybernetics, 4(2), 100–107. link
  5. 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

Further reading

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

In class / field

Lab or field practice from worksheets with a safety checklist

Learning evidence: Checked worksheets and quiz results

Module quiz

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

Knowledge domain: Delivery, indoor operations and warehousing · Mathematics, physics and statistics · Control, autopilot and navigation · Automation, robotics and swarms