Modelling community assembly. (a) The three steps we used to model community assembly. (I) Species (modelled as random viable metabolisms) are added at random to a standing community. (II) The environment acts as a filter, selecting successful species, that is those best at growing on at least one of the carbon sources available in the environment. Successful species persist in the community. (III) The species that comprise the community modify the environment through the excretion of metabolites that can serve as carbon sources for other species. (b) Example assembly trajectory of one community up to the invasion of the fourth species. Simulations begin by initializing the composition of the environment, shown as a purple rectangle at the top. The presence of each of the 223 potential carbon sources is represented as a purple vertical bar, such that each location on the horizontal x‐axis corresponds to one carbon source. In this example and in most of our simulations (unless otherwise stated), the initial environment contains glucose as the sole carbon source, which is indicated in the top rectangle by the single vertical purple line. After establishing the initial environment, we perform the first invasion with “species 1” chosen at random from our MCMC‐derived sample of random viable networks. The species’ ability to grow on each potential carbon source (whether or not the carbon source is present in the environment) is shown in the green rectangle by a green line in the x‐position that corresponds to the specific carbon source. Darker green lines indicate higher growth. Species 1 can grow on the only available carbon source (glucose), and because no other species is yet present, we consider species 1 successful. Species 1 modifies the environment with the excretion of by‐products of its growth on glucose, as shown in the second purple rectangle from the top. These by‐products are available as potential nutrients for the second round of assembly. In this round, a randomly chosen species 2 invades the community. Its growth rate on each carbon source is shown below that of species 1. Species 2 cannot grow faster than species 1 on any of the available carbon sources. It therefore goes extinct and only species 1 persists in the community. The carbon sources it excretes are available for the third assembly step. Each such step consists of a new round of (I) species invasion, (II) environmental filtering and (III) niche construction