The evolution of social behavior can be modeled using evolutionary game theory. Population structure, which can be represented as a graph or network, affects which traits evolve. Understanding evolutionary game dynamics in heterogeneously structured populations is difficult. For arbitrary selection intensity, the problem is in a computational complexity class which suggests there is no efficient algorithm. I will present recently published work that provides a solution for weak selection, which applies to any graph or social network. The method uses coalescent theory and relies on calculating the meeting times of random walks. The method is used to evaluate large numbers of diverse and heterogeneous population structures for their propensity to favor cooperation. I will demonstrate how small changes in population structure---graph surgery---affect evolutionary outcomes. It turns out that cooperation flourishes most in societies that are based on strong pairwise ties.