Our analysis of \(k\) -regular graphs shows that directed interactions can stimulate cooperation, but these results do not account for population heterogeneity, which is common in real-world social networks. To address this, we proceed to investigate four classes of heterogeneous networks: random regular networks in which nodes can have different numbers of incoming, outgoing, and undirected edges; random networks; small-world networks; and scale-free networks (see Figure SREF  in Supporting Information).
For each class, we generate undirected networks of various average node degree \(\bar{k}\) , and then we randomly convert a proportion \(p\)  of edges to be unidirectional.
For all four classes of heterogeneous networks, we find that
an intermediate proportion of directed edges is most beneficial to cooperation, for both downstream and upstream directions of strategy spread (see Supporting Information for the calculation of benefit-to-cost ratios in any directed network and see Ref. [1]} for details).
For example, for \(p=0\)  (undirected network), if cooperation can evolve for some benefit-to-cost ratio, increasing \(p\)  always decreases the ratio required for the evolution of cooperation.
Some undirected networks disfavor cooperation regardless of the benefit-to-cost ratio, or they may even favor the evolution of spite, a kind of antisocial behavior in which an individual pays a cost to hurt others. Even on such undirected networks that disallow cooperation whatsoever, we find that converting some undirected edges to directional can rescue cooperation. Overall, for all four classes of heterogeneous networks, the optimal proportion of directed edges that facilitates cooperation is close to \(2/3\) , as in the case of random regular networks.
