For vanishing cost, the network is fully connected (network A of six nodes—shown for simplicity) resembling the initial network. For significantly high cost, the network is tree-like, exhibiting no loops (network C of 103 nodes). In between, the proposed pruning process generates a network (network B of 103 nodes) with a core–periphery structure. The network in regime B was obtained for cost, θ=0.92, corresponding to a peak in the core–periphery measure (details in the text). For the central network, the layout was generated by applying the Fruchterman–Reingold algorithm23. Colours show the difference in magnitude of coreness with black indicating the core and red, the periphery.