for SSA, I use the imputed version of Krantz (2023) (Figure A3) and compute the productivity of each city as the inverse-distance-weighted average of cells within 30km of the city centroid. I assume that average household wealth, aggregated at the city level, approximates worker productivity. Footnote 31 argues that national average urban wealth strongly correlates with GDP per capita.

I also calibrate the productivity of international ports so that overall production matches national accounts data. Averaging estimates from the UN National Accounts Main Aggregates database between 2020 and 2022 yields that imports were equal to 26.5% of African GDP. Since my network does not include foreign locations,<sup>32</sup> the imported goods will have to be produced by port cities. Assuming that port outflows in 2020Q1 are proportional to the inflows, multiplying outflows from the 52 largest ports by a factor of 37 yields (precisely) an imports measure summing to 26.5% of the total production volume using the IWI as productivity measure. These imports need to be divided by port city population to yield productivities. Since the framework of Fajgelbaum & Schaal (2020) endogenously allocates labor to different tasks, letting port cities produce both a domestic and international variety would obscure this calibration. Thus, I compound both tasks so that port cities use all labour to produce a mixed international variety at productivity The median intl. productivity is 27 IWI points, but the mean is much higher at 2748, indicating high import volumes in some port cities with small populations. Top of the list is Egypt’s Sokhna Port (towards the Red Sea), with a population of 1000 and intl. productivity of 134,656, followed by Egypt’s Port Said, with a population of 894,850 (within a 30km radius) and intl. productivity of 1,264. Other ports with intl. productivity above 500 include Tanger Med and Walvis Bay. Since utility functions are mildly concave ( _α_ = 0 _._ 7) and the planner maximizes utility, the comparatively small populations of these port cities downweight their importance for network optimization. The resulting increase in purchasing power also implies that a part of the equilibrium consumption of port cities is exported. For simplicity, I assume the export share is equal to the share of international productivity in total city productivity and adjust consumption and welfare accordingly.

Table 9 summarizes productivity and population by city type, indicating that the 17 megacities together account for 35.7% of population (159 million) and 46.5% of total domestic production.

Table 9: Productivity and Population by City Type

|City Type|City/Node|City_>_200K|Port|City_>_2M|Port-City|Megacity|
|---|---|---|---|---|---|---|
|Count|1,022|286|32|13|9|17|
|_Population_|||||||
|Sum|48.5M|154.6M|20.7M|38.6M|23.2M|158.7M|
|Mean|47.4K|540.5K|645.4K|2.97M|2.58M|9.3M|
|Median|21.2K|390.7K|590.7K|2.69M|1.89M|6.9M|
|_Production_|||||||
|Total|1.50B|5.86B|3.32B|1.84B|3.88B|10.80B|
|Total Domestic|1.50B|5.86B|0.97B|1.79B|1.38B|10.01B|
|_Productivity_|||||||
|Domestic Mean|27.72|36.15|47.34|46.58|60.83|60.89|
|Domestic Median|23.74|32.41|47.88|46.92|60.37|59.65|
|International Mean|0|0|4,376|1.59|203.6|7.1|
|International Median|0|0|28.4|0|80.88|0|

_Notes:_ Table shows population and productivity (IWI) summarized for cities of different sizes and port-cities. International productivity (for imports) is the second term on the RHS of Eq. 14.

> 32It would be difficult to add foreign markets to an already large network. In theory, this could be done by adding additional nodes for ports and separating the city from the port in this way, but for any goods to flow to these locations, they need to have populations. Since flows are an equilibrium outcome, they would have to be calibrated to match the data by reverse engineering the model, which is quite complicated solving for populations of multiple ports. The framework may also have difficulties computing optimal flows along zero-cost links.

33