Last Mile
My prompt:
Create an interactive web app that explores the mathematics of last mile optimisation in logistics (inc. the travelling salesman problem, VRP, CVRP, CVRPTW, combinatorial complexity). Think of this as a pedagogical (rather than analytical) tool. Include explanatory text and simulations.
Web app: Claude Opus 4.5
Prompt:
Generate a short story structured as a series of digressive, erudite notes on the logistics and mathematics of last mile route optimisation.
The author of these notes is a 50-ish PhD student and former dictator of an unnamed African nation living in exile in the UK. His PhD thesis is on an unrelated topic (some esoteric facet of medieval theology?)
The actual narrative (or something approaching a narrative) should be woven into the text: After eight years in the wilderness, our man is plotting a return to power.
Stylistic model: Pale Fire by Nabokov.
3000+ words.
-
Responses: Claude Opus 4.5, GPT-5.2 Thinking, Gemini 3 Pro
Annotations to An Introduction to Last-Mile Route Optimisation for Non-Specialists
Being a Selection of Working Notes Toward a Supplementary Chapter
by Dr-cand. B. M. Adjekum Wolfson College, Cambridge
Note 1. "Last mile," p. 3, para. 1.
The term is borrowed, of course, from telecommunications, where it designated the final leg of copper wire connecting exchange to subscriber — the stretch that was, paradoxically, the most expensive to lay per unit of information carried. Its migration into logistics theory (ca. 2009–2012; see Gevaers, Van de Voorde & Vanelslander, World Review of Intermodal Transportation Research, 2011) preserves this essential irony: the last segment of any delivery network accounts for an outsized share of total cost, typically 40–53%, depending on urban density, road topology, and the petulance of the recipient. One thinks, inevitably, of Zeno. The arrow is loosed, traverses half the distance, half again, and yet the target — the subscriber, the doorstep, the palace — recedes in a shimmer of mathematical regress. Some of us have been traversing that last mile for eight years.
I first encountered the phrase not in an academic context but in a briefing document prepared by McKinsey & Company, who had been retained in 2014 by my government — I use the possessive advisedly, and without apology — to restructure the state postal service. The consultants, three young Americans in shirts of aeronautical whiteness, presented their findings in the Grand Cabinet Room overlooking the Meniwa River, where the late afternoon light has a quality I have not found replicated anywhere in the Northern Hemisphere, certainly not in Cambridge, where the sun, when it appears at all, has the tentative, watery character of a civil servant entering a room he suspects he was not invited to. I remember one of them — Garrett? Jarrett? — tapping a laser pointer against a map of the capital's road network and saying, with the earnest gravity Americans reserve for matters of profound inconsequence, that "the last mile is where logistics goes to die." I found this funny. No one else did. My Minister of Communications, Colonel Asare, who is now, I am told, the Minister of Nothing in a cell beneath the old judiciary, did not so much as shift in his chair. But then, Asare never had any feeling for irony. It was among his better qualities.
Note 2. The Travelling Salesman Problem, p. 7.
The author's treatment of the TSP is serviceable but neglects the aesthetic dimension entirely. The problem — to find the shortest possible route visiting each of n cities exactly once before returning to the origin — possesses a combinatorial beauty that mere algorithmic discussion cannot exhaust. For n cities, the number of possible routes is (n − 1)!/2, a function that ascends with a verticality that would have troubled even the medieval angelologists, who were no strangers to infinities. (On which subject, I must here note that my own doctoral research, concerning the pneumatological disputations between Franciscan and Dominican theologians at the University of Paris, 1267–1277 — specifically, the question of whether angelic beings occupy discrete spatial positions or may be said to move through intervening space continuously — has more bearing on combinatorial optimisation than my supervisor, Dr. Antonia Hartley-Byrne, is willing to entertain. She is a fine scholar but, like many English medievalists, displays a monastic resistance to interdisciplinary pleasure.)
When I governed, I was responsible for the movement of goods, persons, armaments, and information across a territory of some 214,000 square kilometres served by 3,100 km of paved road, much of it in a condition that would flatter the word "paved." Every morning, a routing problem: how to distribute subsidised grain to 1,400 villages before the wet season rendered the northern laterite tracks impassable. My logistics officers, trained in Havana and Moscow, approached this as a variant of the Vehicle Routing Problem with Time Windows (VRPTW). I approached it as a matter of staying in power. The two formulations are, I submit, isomorphic.
Note 3. Heuristics and the insufficiency of exact solutions, p. 12.
The author correctly notes that exact solutions to large-scale VRPs remain computationally intractable and that practitioners rely on heuristic methods — nearest-neighbour insertion, Clarke-Wright savings, simulated annealing, and so forth. What he fails to observe is that governance itself is a heuristic enterprise. One does not solve a country; one approximates, iterates, and prays (or, in my case, reads Aquinas, which is the same activity conducted at a higher register).
I have been thinking a great deal about heuristics lately, specifically about the class of methods known as metaheuristics — strategies that guide subordinate heuristics toward regions of the solution space that exact methods cannot reach. Genetic algorithms, ant colony optimisation, tabu search. The last of these interests me especially. Tabu search, as formulated by Glover (1986), maintains a memory structure — a "tabu list" — of recently visited solutions that the algorithm is forbidden from revisiting, thereby forcing exploration of new territory. There is something in this. For eight years, I have been, in the algorithmic sense, tabu: my name unspeakable in the state media, my image removed from public buildings (though my sister-in-law, who communicates via a chain of intermediaries involving a fishmonger in Tema, a graduate student at SOAS, and a Ghanaian priest in Peckham, assures me that the mosaic in the floor of the National Assembly, commissioned in 2012 and depicting my profile in the manner of a Roman emperor, has merely been covered with a carpet, the Assembly lacking either the funds or the conviction to destroy it permanently). But tabu status is, by design, temporary. The list rotates. Forbidden solutions become permissible again. This is not metaphor. This is mathematics.
Note 4. On constraint satisfaction, p. 15.
Every routing problem is, at bottom, a constraint satisfaction problem. The vehicle has a finite capacity Q. The time window [aᵢ, bᵢ] at each node must be respected. The driver requires rest. The roads have weight limits. The bridges — and here the author, writing from the serene abstraction of a logistics department in Eindhoven, has no conception of what a bridge means in a country where the rainy season arrives like a hostile army — the bridges may or may not exist on any given Tuesday.
I am currently subject to the following constraints:
A travel ban imposed by the African Union, which I am contesting through intermediaries and which, I am reliably informed, three member states are prepared to vote to lift at the next summit, in exchange for considerations I shall not detail here.
A United Kingdom Tier 4 (General) student visa, which requires me to be enrolled in a full-time programme of study and which forbids employment exceeding twenty hours per week, a constraint I satisfy trivially, as I have no employment.
A modest but adequate monthly remittance from a source I shall identify only as "the Bahrain account," supplemented by a college hardship bursary for which I applied, not without a sense of the absurd, in Michaelmas term 2023.
The disapproval of Dr. Hartley-Byrne, who last Tuesday, during our supervision in her office — a room that smells of old radiators and Earl Grey and is decorated with a single reproduction of a Giotto fresco, poorly framed — observed that my chapter on Bonaventure's doctrine of angelic locomotion was "reading more and more like a logistics manual" and asked, not unkindly, whether I was "quite alright."
I am quite alright. I am, in fact, approaching a feasible solution.
Note 5. Depot location and the question of origins, p. 19.
Where does the route begin? The depot, in classical VRP formulations, is a fixed point — the warehouse, the distribution centre, the node from which all vehicles depart and to which they must return. Its placement determines everything. A poorly located depot condemns every route to suboptimality from the outset.
My depot, as it were, is currently a one-bedroom flat on Mill Road, Cambridge, above a shop that sells vintage clothing to undergraduates who wish to appear as though they have suffered. The flat is adequate. I have a desk, a kettle, a reading chair that I found on the street in June and that Dr. Hartley-Byrne believes to be infested, and approximately four hundred books, half of them concerning the relationship between Aristotelian metaphysics and the theology of the Schools, and the other half concerning matters I keep on the higher shelves, behind the Aquinas.
In January of this year, I relocated several of the higher-shelf volumes to a rented storage unit in Ely. This was a precautionary measure. The Home Office, which has twice interviewed me under caution regarding alleged violations of UN sanctions (allegations I categorically deny, and which in any case rest on a conflation of my personal finances with those of the state, a distinction that is, I concede, somewhat more porous in practice than in theory), conducted an informal search of the flat in November. They found nothing of interest. They did, however, express scepticism about the number of books I own on the subject of medieval angelology, as though erudition itself were grounds for suspicion. One of the officers, a young woman with the watchful eyes of a peregrine, picked up my copy of the Quaestiones Disputatae de Potentia Dei and asked what it was. "Thomas Aquinas," I said. "On the power of God." She put it down carefully, as one might put down an unexploded shell, and I admit I enjoyed the moment.
Note 6. Stochastic elements and the problem of uncertainty, p. 23.
Real-world routing is stochastic. Demand fluctuates. Travel times are random variables. The vehicle breaks down, the driver defects, the road is washed away, the bridge — see Note 4, supra — is gone. The literature addresses this through robust optimisation, chance-constrained programming, and recourse models, all of which attempt to find solutions that perform tolerably well across a range of possible futures.
I have been in contact with Colonel (ret.) Mensah, who commanded the 3rd Mechanised Brigade during the years of my government and who is presently living in Lomé under an assumed name, selling mobile phone accessories from a small shop near the Grand Marché. Mensah is not a man of great intellect, but he possesses two qualities indispensable to any military enterprise: loyalty that is structural rather than sentimental, and an inability to imagine any state of affairs other than the one he has been told to bring about. He responds to uncertainty the way a well-designed algorithm responds to stochastic variation: by executing the plan with slight local adjustments and an absolute refusal to reconsider the objective function.
In our most recent communication — conducted through a protocol I have devised that involves, at various stages, an encrypted messaging application, a handwritten letter in Twi, and a particular manner of arranging dried fish in a package sent via Royal Mail, the last detail being a private joke that Mensah, characteristically, does not find amusing — I outlined what I have taken to calling, in my notes, the Last Mile Problem. Not the logistical abstraction, though it is that too, but the concrete, political, cartographic problem of moving from the Togolese border to the capital, a distance of approximately 340 km, through terrain held by a government whose military capability I estimate to be 60% of what it was when I left it, the remaining 40% having been sold, stolen, or allowed to rust.
Note 7. Ant colony optimisation (ACO), p. 27.
I pause here to admire, as one must, the elegance of Dorigo's ant colony optimisation framework (Optimization, Learning and Natural Algorithms, PhD thesis, Politecnico di Milano, 1992). The conceit is exquisite: a colony of artificial ants traverses a graph, depositing virtual pheromone on edges in proportion to the quality of the solutions they discover. Subsequent ants are probabilistically attracted to edges with higher pheromone concentrations, producing a positive feedback loop that converges, over many iterations, toward good solutions. The pheromone evaporates over time, preventing premature convergence on suboptimal paths.
The analogy to political organisation is almost too precise. For eight years, the pheromone trails connecting my name to the villages, the barracks, the market women, the taxi drivers, the junior officers — all the nodes of the network I built over twenty-two years of public life — have been evaporating. The current regime, under General Boateng (a man I promoted from captain myself, and whose wife I once, in an act of governance that now seems quaint, personally drove to hospital in the presidential car when she went into premature labour during a state dinner), has been laying its own trails, its own patronage networks, its own pheromone. And yet. Reports from the interior — mediated, it is true, through the chain of intermediaries described in Note 3, and therefore subject to delay, distortion, and the fishmonger's occasional editorialising — suggest that the old trails have not entirely evaporated. That in certain regions, particularly the north, where the subsidised grain once arrived and now does not, the name still carries charge.
Dorigo's ants are blind. They follow chemistry. People are not so different, though they prefer to believe otherwise.
Note 8. On the objective function, p. 31.
What are we minimising? The author lists the usual candidates: total distance, total time, number of vehicles, fuel cost, carbon emissions. But the objective function, as any practitioner knows, is a political choice disguised as a technical one. To minimise distance is to privilege efficiency. To minimise the number of vehicles is to privilege capital economy. To minimise emissions is to privilege a particular vision of the future over the needs of the present. Every objective function is an ideology.
When I governed, my objective function — never stated, of course, never formalised, but operative in every decision — was to minimise the maximum dissatisfaction across all nodes. A minimax formulation. No village so neglected that it becomes a locus of insurrection; no general so favoured that he begins to imagine himself a president. It is a conservative strategy, and I pursued it for twenty-two years with a consistency that Dr. Hartley-Byrne, were she to consider it, might recognise as Thomistic. Aquinas held that the good is diffusive of itself — bonum est diffusivum sui — and I diffused goods, services, and the appearance of justice across 214,000 square kilometres with, I maintain, considerable skill.
That I was removed from power by a man to whom I had diffused an entire mechanised brigade is an irony I leave to the reader.
Note 9. Dynamic re-routing, p. 34.
The modern literature places great emphasis on dynamic re-routing: the capacity to adjust plans in real time as conditions change. GPS tracking, live traffic data, machine learning models that predict demand surges. The Amazon driver's route is recalculated every few seconds. The pizza is always fourteen minutes away.
My own plans require dynamic re-routing of a different order. Last month, I received word — through the Peckham priest, who is less discreet than I would like and who has developed an alarming habit of offering spiritual counsel alongside intelligence updates — that Captain Ofori, who commands the garrison at Kwateng and whose co-operation I had considered essential to the northern corridor approach, has been transferred to the capital. This necessitates a revision. Mensah, in Lomé, was instructed via the fish-and-letter protocol to contact a Major Adjei, whom I do not know personally but who is, according to Mensah, "a serious person," which in Mensah's vocabulary means either that Adjei is trustworthy or that he does not smile, these being, for Mensah, synonymous qualities.
I have spent the past week recalculating. Not on paper — I am not so imprudent — but in my head, during the long grey afternoons in the University Library, where I sit in the North Wing surrounded by the Patrologia Latina and allow the medieval doctors to keep me company while I think about roads, bridges, fuel depots, and the location of the 3rd Brigade's armoured vehicles, which Mensah believes to be poorly maintained but functional. I have always been able to hold a map in my mind. It is, I think, my one genuine gift: not rhetoric, not statecraft, not even ruthlessness, but spatial memory. I can see the whole network — every node, every edge, every weight — and I can feel, in some pre-verbal part of myself, where the optimal route lies.
Note 10. Convergence, p. 38.
All good algorithms converge. The simulated annealing cools. The genetic algorithm's population stabilises. The ants, blind and chemical, find their shortest path. The question is not whether convergence occurs but whether the solution reached is globally optimal or merely a local minimum — a comfortable depression in the fitness landscape from which the algorithm lacks the energy to escape.
I think about this in the reading chair — the possibly infested one — at two in the morning, when Mill Road is quiet except for the foxes and the occasional drunk singing his way home from the Curry King. Am I converging on the global optimum, or have I settled into the local minimum of this strange half-life: the flat, the library, the supervisions with Dr. Hartley-Byrne, the halal butcher on the corner who calls me "Professor" and saves me the good cuts of goat? There is a version of my life in which I finish the thesis, accept a minor lectureship at a minor university, and spend thirty years writing increasingly specialised articles about whether angels can be in two places at once, read by eleven people, nine of whom are my students and two of whom are my enemies. It would be a life. Aquinas would approve; he believed that the contemplative life was superior to the active.
But Aquinas never governed. He never stood on the balcony of the presidential residence at dawn and watched the city — his city — shake itself awake: the smoke from the cook-fires rising, the trucks grinding toward the markets, the whole vast, imperfect, maddening network of human need and human movement stirring into operation, all of it depending, in ways no one ever quite acknowledged, on him. That is a drug for which there is no methadone.
Note 11. The return journey, p. 42.
In the standard VRP formulation, every vehicle must return to the depot. The route is a closed loop. This is presented as a constraint, but it is, I would argue, an axiom — a statement about the nature of journeys so fundamental that it hardly requires justification. You leave. You return. The circle closes. Even Odysseus, that most circuitous of travellers, came home.
I have purchased, through an intermediary in Dubai, a satellite telephone of a type not commercially available in the United Kingdom. It is kept in the storage unit in Ely, alongside the books from the higher shelves and certain other items I shall not enumerate. I visit Ely on the first Thursday of each month, arriving by the 10:47 train from Cambridge and returning by the 14:22, a routine so regular that the woman at the ticket office now nods at me with the comfortable familiarity of someone who has decided I am harmless. In Ely, I walk to the storage unit, let myself in, and spend approximately ninety minutes making calls, reviewing documents, and updating what I think of as my tableau — my current best solution, subject to revision.
Dr. Hartley-Byrne, in last week's supervision, remarked that my chapter on Bonaventure's Itinerarium Mentis in Deum — "The Journey of the Mind into God" — was "the best thing you've written, Bernard. There's a passion in it I haven't seen before." I thanked her. I did not tell her that I had drafted most of it on the train back from Ely, in a state of heightened clarity that I recognised from the old days — the nights before a cabinet reshuffle, the mornings before an address to the nation — when the mind, compressed by purpose, becomes a lens through which the whole disordered world resolves into a single, burning point.
Bonaventure wrote that the soul's journey to God proceeds through stages: from the external world, through the self, to the divine. The last stage — the excessus mentis, the going-beyond — is the most difficult and the most necessary. One must leave behind the comfortable and the known. One must traverse the last mile.
Note 12. Conclusion (provisional).
I do not know if I will succeed. The constraints are severe, the stochastic elements numerous, the objective function — even now — not entirely clear to me. Mensah is loyal but limited. The Peckham priest talks too much. Major Adjei is an unknown quantity. The Home Office peregrine may return. The travel ban may hold. The bridges may be down.
But I have spent eight years studying, in one form or another, the problem of getting from here to there under conditions of radical uncertainty, and I have arrived at two conclusions, one academic and one personal, which I find to be the same conclusion expressed in different notation:
First: that the last mile is not a problem to be solved but a condition to be endured — the irreducible remainder of distance between intention and fulfilment, between the depot and the final node, between exile and home.
Second: that the optimal route is not always the shortest. Sometimes it is the one that arrives.
The thesis, I believe, is nearly finished. Dr. Hartley-Byrne expects a complete draft by Easter. She will have it, or she will not. Either way, something will be complete by then — some journey, in some notation, will have reached its final node.
The 10:47 to Ely departs in forty minutes. The reading chair can wait. The angels, patient and immaterial, occupying their discrete positions in the celestial hierarchy, will still be there when I return.
If I return.
[These notes are extracted from a working manuscript found in a one-bedroom flat on Mill Road, Cambridge, in March 2026, following the departure of its occupant. The thesis on Bonaventure was never submitted. The reading chair was, as suspected, infested.]