In previous work, the authors pioneered the use of spanning trees to study the optimal structure of public transport networks. Spanning trees have the minimum number of links (one less than the number of nodes) and connect all nodes without loops. The spanning tree that minimises passenger-kilometers indicates where the public transport hubs should be located and which stations should be connected directly to each other. This paper applies the same technique to the world container shipping network to reveal the natural hubs and trade routes. However, finding the spanning tree with least TEU-kilometers poses two computational challenges. The first relates to the availability of demand data. We use a gravity model to estimate TEU flows between ports based on port throughput data and the nautical sailing distances between ports. The second relates to the size of the network. Cayley’s formula reveals that for n nodes there are nn-2 distinct spanning trees, rendering finding an exact solution impractical as the number of ports in the database (n) exceeds 460. Two heuristics developed for the earlier public transport work were applied here. The results reveal how the number of hubs in the maritime network depends on the elasticity of demand with respect to sailing distance. Where the elasticity of demand is low, there are few large hubs, while when the elasticity of demand is high, there are many smaller hubs. For elasticities of demand between the extremes, the larger hubs appear in logical locations, like Singapore and Rotterdam.