ANNONA: The Tyranny of the Wagon
Optimal transport, distributed computation and online learning in a Roman grain network
Return to the interactive atlas
I. The problem with feeding a city
There is a distinction between growing enough food and getting enough food to the people who need it. A harvest in one part of the Mediterranean did rather little good to a hungry population elsewhere unless the two could be connected at a tolerable cost. Grain, unlike information in a mathematical model, is heavy. Moreover, the merchant arranging a shipment could not consult a complete ledger of every other town’s needs. Roman commercial institutions and state provisioning helped deal with both problems; they did not eliminate them.
ANNONA is an experiment in the consequences of those two constraints. We start with an idealized planner who knows every local harvest, every requirement and every link’s transportation cost. We then ask what happens when the allocation must be produced by local communications instead. Finally we change the harvest itself, so that the allocation we are trying to compute may no longer be optimal by the time we have computed it.
This is not an attempt to reconstruct the actual annual commerce of the Roman Empire. In particular, the model assumes cooperative settlements with a common objective; it is not a market equilibrium model or a claim that the annona centrally administered all grain trade.
II. Constructing a Roman economy
The baseline is a scenario anchored to Frier’s demographic reconstruction for AD 164 (within AD 150–200). We use all 677 vertices and 2,208 directed links in the supplied ORBIS mirror, including road, river, coastal, overseas and ferry connections. Of the vertices, 566 are assigned economic activity and 111 serve as routing or out-of-scope vertices. These are scenario classifications, not individually attested populations. For map geometry, 954 of 978 ORBIS road arcs have accepted candidate paths through Itiner-e’s reconstructed road network. Other routes are schematic; even matched paths do not establish a precise historical itinerary.
Our regional population anchors sum to 61.2 million. We allocate agricultural land using the HYDE 3.3 geographical reference grids (not a dated cropland raster) and allocate population independently, with selected Hanson–Ortman urban population estimates. Consumption is ordinarily 200 kg/person/year, following Dermody et al. Cultivated land, yields, harvest and retention fractions, and capacities are explicit assumptions. In the final sensitivity scenario, 22 major western sites have their estimated supply multiplied by 0.90 and demand by 1.15. This is not an independently measured historical adjustment. The resulting scenario contains 14.577 million tonnes of available grain and 12.368 million tonnes of consumption requirements per model period.
III. From grain to discrete optimal transport
Let \(x_e\) be the grain transported along directed link \(e\), in kilotonnes; \(c_e\geq0\) its relative unit cost; and \(K_e\) its capacity. Let \(B\) be the oriented incidence matrix, positive at the origin and negative at the destination. With production \(s\) and demand \(d\), grain remaining locally is \(s-Bx\). Physical feasibility therefore requires \(Bx\leq s\). Define
\[ U(x)=\sum_i[(Bx)_i-s_i+d_i]_+,\qquad F(x)=c^\top x+M U(x). \]
We minimize \(F\) over \(0\leq x\leq K\) subject to physical feasibility. A shortage is not a conservation violation: a city may go hungry, but it cannot export nonexistent grain. \(M=25\) is a finite model policy penalty, not an ancient price or a general guarantee of lexicographic shortage minimization.
In the balanced, uncapacitated special case, discrete optimal transport assigns surplus mass to deficit nodes using shortest-path costs. On the actual graph, two routes may compete for the same road capacity. We therefore solve a minimum-cost flow problem directly: a virtual source supplies all produced grain and each settlement has consumption and unused-grain outlets to a virtual sink. Sending the entire supply through this graph at minimum cost is equivalent to the stated objective up to a constant.
A shortest individual shipment need not be part of the cheapest global allocation. The remedy is the residual network. For any edge with existing flow \(x_e\), a forward residual edge can carry another \(K_e-x_e\) at cost \(c_e\); a backward residual edge cancels up to \(x_e\) at cost \(-c_e\). Successive shortest-path augmentation (SSP) can therefore reverse earlier decisions. A feasible allocation is optimal precisely when its residual graph contains no negative-cost cycle. Starting from zero flow, shortest residual augmentations preserve minimum cost for the current flow quantity and yield an optimal allocation at the target quantity.
IV. Routing and the significance of a potential
What if each settlement knows only its incident transportation costs? Bellman–Ford offers a useful answer to a part of the problem. Let \(D_j^{(k)}\) denote the best estimate of the cost of reaching \(j\) from a fixed source after \(k\) message rounds. Then
\[ D_j^{(k+1)}=\min\left(D_j^{(k)},\min_{i\to j}\{D_i^{(k)}+c_{ij}\}\right). \]
Inductively this is the cheapest walk of at most \(k\) edges. In a graph without reachable negative cycles, a shortest path can be chosen simple. Each update needs only neighbouring estimates; no city must receive the entire map. The atlas lets the reader watch the blue messages propagate and then illuminate the recovered route in gold. Dijkstra independently verifies the route cost. The hypothetical consignment is not an allocation of the Empire’s grain.
The connection to Dijkstra and SSP comes from reweighting. For finite shortest-path distances, \(D_j\leq D_i+c_{ij}\), so
\[\widehat c_{ij}=c_{ij}+D_i-D_j\geq0.\]
Along a path, intermediate potentials telescope. Thus the cost ordering of paths between fixed endpoints remains unchanged. Suitable potentials enable Dijkstra on residual arcs even when raw residual costs are negative. We will encounter this same reduced-cost expression again, in a rather different algorithm.
V. Negotiating shipments locally
In the usual equality-constrained flow problem, projecting a gradient onto the cycle space requires a graph Laplacian solve: \(P_{\ker B}=I-B^\top(BB^\top)^\dagger B\). This is an interesting connection to electrical networks, but a nonlocal projection is inconvenient for local decision-making. Instead define an overcommitment measure
\[V(x)=\sum_i[(Bx)_i-s_i]_+,\]
and use the penalty \(\Phi(x)=F(x)+\lambda V(x)\). The key observation is that overcommitted flows can be repaired by cancellation. From a node with excessive net outflow there is a positive-flow path to some net importer. Cancel the same quantity along the path, up to its bottleneck, the source’s overcommitment or the destination’s net imports. Interior balances do not change. Provisional shortage decreases at the source by at least as much as it increases at the destination, and transportation expenditure cannot increase. Repeating gives a feasible \(y\leq x\) satisfying
\[F(y)\leq F(x),\qquad \|y-x\|_1\leq(n-1)V(x).\]
The path length bound follows from choosing simple paths. Thus for any \(\lambda>0\) an infeasible point cannot minimize \(\Phi\): repairing it reduces the penalty strictly without increasing \(F\). This is an exact penalty. We have replaced a graph-constrained projection by clipping each edge to its interval.
Each settlement computes a scalar scarcity signal
\[\pi_i=M\mathbf1_{\{(Bx)_i>s_i-d_i\}}+\lambda\mathbf1_{\{(Bx)_i>s_i\}}.\]
Then an edge’s subgradient is \(c_{ij}+\pi_i-\pi_j\). The update is
\[x_{ij}^{+}=\operatorname{clip}_{[0,K_{ij}]}\{x_{ij}+\eta(\pi_j-\pi_i-c_{ij})\}.\]
Here is our connection to the shortest-path potential: grain increases along a link if the difference in scarcity outweighs its cost. At the optimum, suitable subgradients make the reduced cost nonnegative on edges with unused forward capacity, nonpositive on edges with positive flow, and hence zero at interior flows. This is complementary slackness in the network-flow problem. The static algorithm uses projected subgradients, not smooth gradients, and reports repaired averages rather than claiming convergence of every last iterate. Edge updates are local; physical repair uses serialized path transactions in a simulator, not a deployed asynchronous network.
VI. The next harvest
Now \(s\) and \(d\) change with time. The administration commits \(x_t\) before seeing the current harvest, then learns local conditions, repairs the proposed allocation and applies exactly the same clipped update for the next period. This is online gradient descent (OGD). It is inspired by constrained online convex optimization (COCO), especially surrogate-loss reductions, but is not an implementation of the full Supantha–Sinha algorithm.
To see the connection between static convergence and online regret, let \(D\) be the diameter of the capacity box and \(H\) bound the subgradient norm. The standard projection inequality for any comparator \(u_t\) gives
\[\Phi_t(x_t)-\Phi_t(u_t)\leq\frac{\|x_t-u_t\|^2-\|x_{t+1}-u_t\|^2}{2\eta}+\frac{\eta H^2}{2}.\]
If the comparator stays fixed, the squared distances telescope. If it moves, they nearly telescope, with an additional term controlled by its path length \(P_T=\sum_{t=2}^T\|u_t-u_{t-1}\|\). Summation yields
\[\sum_{t=1}^T[\Phi_t(x_t)-\Phi_t(u_t)]\leq\frac{D^2+2DP_T}{2\eta}+\frac{\eta H^2T}{2}.\]
For a constant loss and fixed optimum, Jensen’s inequality yields the static \(DH/\sqrt T\) bound for the averaged iterate with \(\eta=D/(H\sqrt T)\). In the dynamic case we compare to an omniscient instantaneous optimum. Let the realized cost include the feasible repaired plan and a revision cost \(\rho\|y_t-x_t\|_1\). Choosing \(\lambda=\rho(n-1)+\delta\), \(\delta>0\), the cancellation lemma gives realized cost plus \(\delta V_t(x_t)\) bounded by \(\Phi_t(x_t)\). Therefore realized dynamic regret \(R_T\) and cumulative violation \(Q_T\) satisfy the joint inequality
\[R_T+\delta Q_T\leq\frac{D^2+2DP_T}{2\eta}+\frac{\eta H^2T}{2}.\]
The cost of pursuing a moving optimum appears explicitly. This is not a no-regret guarantee for arbitrary unpredictable variation. Nor do these inequalities say that famine can always be prevented.
VII. What the numerical experiments show
The frozen full-network SSP objective is 1162.03283 (relative units), agreeing with an independent linear program within \(3.46\times10^{-10}\). Baseline consumption is fully satisfied to numerical tolerance. Reducing all capacities by 90% produces 28.056 kt of unmet consumption; the low-production/high-demand scenario produces 3401.024 kt. The separate zero-transport-cost LP measures minimum achievable shortage.
Distributed Bellman–Ford agrees with Dijkstra. The calibrated static subgradient algorithm, after 200,000 logical rounds, is 16.32% above the centralized optimum. The theoretical learning rate performs considerably worse. These are computational rounds, not a measurement of ancient communications. They are a reminder that a local update’s simplicity is not the same thing as rapid global coordination.
| 48-period synthetic sequence | Fixed plan regret | Distributed OGD regret | Previous-period centralized LP regret |
|---|---|---|---|
| Smooth variation | 111,405.75 | 88,214.19 | 37,767.74 |
| Harvest shock | 310,281.40 | 283,462.37 | 60,640.58 |
The online method improves on a fixed plan by 20.8% and 8.6%, but the previous-period centralized benchmark does considerably better. All strategies begin from the same repaired distributed static plan. The difference is not evidence that Roman trade followed our allocation, nor a statistical superiority claim from two synthetic sequences. Rather, it provides a way to examine the consequences of imperfect information and restricted coordination on a common network.
Try the live scenario controls: they change one region’s supply and demand, run a new centralized static solution or a twelve-period shock, and display feasible allocations and comparisons. The interactive animation communicates allocation, not historical travel time. The 48-period research experiments and static PGD checkpoints are frozen results, not recalculated by the timeline.
VIII. Sources, limitations and further work
The project does not model storage, actual transit delays, merchant incentives, changing borders or the institutional priorities of the Roman annona. Agricultural productivity and route capacity are uncertain. The primary historical conclusion should be about the model’s dependence on its assumptions, not a claim to have measured Roman grain flows.
Historical sources and datasets:
- ORBIS and gorbit, transportation network.
- Itiner-e, de Soto et al. (2025), reconstructed roads; data snapshot.
- Frier (2000), “Demography,” Cambridge Ancient History, XI, table 6, p. 814; Hanson and Ortman population data; HYDE 3.3.
- Dermody et al. (2014), grain production, hinterlands and consumption; Gilgen et al. (2019), agronomic calibration; Kessler and Temin (2007), grain-trade organization.
Mathematical references:
- Zinkevich (2003), Online Convex Programming.
- Sinha and Vaze (2024), Constrained Online Convex Optimization.
- Supantha and Sinha (2026), Universal Dynamic Regret and Constraint Violation Bounds for Constrained Online Convex Optimization.
Map: Flappiefh and contributors, Wikimedia Commons, CC BY-SA 4.0; adapted display. Decorative header art is derived from the project’s approved generated mockup and is not an archaeological illustration.