Solving Graph-based Public Goods Games with Tree Search and Imitation Learning

Victor-Alexandru Darvariu, Stephen Hailes, Mirco Musolesi

Public goods games (PGGs) are a classic framework for modeling social dilemmas—such as climate change mitigation, open-source software development, or vaccination programs—where individuals pay a cost to provide a good that benefits the wider society.

This paper tackles the NP-complete problem of finding optimal equilibria in graph-based PGGs. By exploiting a mathematical equivalence between game equilibria and Maximal Independent Sets (mIS), the authors use Monte Carlo Tree Search (MCTS) to find high-quality solutions and train a Graph Neural Network (GNN) via imitation learning to mimic the search. The resulting model achieves near-optimal performance while being three orders of magnitude faster to evaluate on unseen networks.

The Challenge of Networked Public Goods Games

The authors focus on "best-shot" PGGs on networks, where an agent benefits if they or at least one of their direct neighbors acquires the public good. Because agents are self-interested, these games naturally settle into Pure Strategy Nash Equilibria (PSNE).

However, a single network can have many different equilibria. A central planner might want to find an equilibrium that maximizes a specific global property, such as social welfare (total utility) or fairness (equality of utility). Finding these optimal equilibria is an NP-complete problem. Existing heuristic methods, like best-response dynamics or simulated annealing, often get stuck in sub-optimal states and are generally only designed to optimize for social welfare, ignoring other metrics like fairness.

Reframing the Problem: Equilibria as Geometry

To overcome the massive $2^n$ search space of all possible player actions, the authors leverage a known mathematical correspondence: in a best-shot PGG, any equilibrium perfectly corresponds to a Maximal Independent Set (mIS) on the graph. An mIS is a set of non-adjacent nodes to which no more nodes can be added.

Step-by-step construction of a Maximal Independent Set representing a public goods game equilibrium.

Instead of searching through all possible actions, the authors formulate the incremental construction of an mIS as a Markov Decision Process (MDP). By reframing the search for Nash Equilibria strictly as the search for Maximal Independent Sets, they guarantee that every fully constructed state is a valid equilibrium by definition. This drastically prunes the search space.

Methodology: Search and Imitation

The authors' approach bridges combinatorial optimization, tree search, and deep learning through a multi-step pipeline:

  1. Planning via MCTS: To navigate the MDP, they use the UCT (Upper Confidence bounds applied to Trees) variant of Monte Carlo Tree Search. The algorithm builds an mIS node-by-node, receiving a reward based on the target metric (welfare or fairness) only once the mIS is complete.
  2. Graph Imitation Learning (GIL): Because MCTS is computationally expensive, the authors use it as an "expert" to generate a dataset of optimal moves. They then train a policy network to mimic this expert. The policy uses a structure2vec Graph Neural Network (GNN) to generate node embeddings.
  3. Proto-Action Architecture: Because the number of valid actions shrinks at each step (adding a node to the mIS invalidates all its neighbors), a standard softmax output layer is inefficient. Instead, the GNN outputs a "proto-action" vector. The probability of selecting a valid node is calculated based on the Euclidean distance between this proto-action and the embeddings of the currently available nodes.
The proposed pipeline: (a) MCTS generates demonstrations, (b) a GNN policy is trained via imitation learning, and (c) the trained policy rapidly predicts equilibria on new graphs.

Experimental Setup and Key Results

The methods were evaluated on synthetic network models commonly used to represent social and biological networks: Erdős–Rényi (random), Barabási–Albert (scale-free), and Watts–Strogatz (small-world). Graph sizes ranged from 15 to 100 players, under both Identical Cost and Heterogeneous Cost settings.

Superior Planning: The MCTS method outperformed existing baselines (Best Response, Payoff Transfer, Simulated Annealing) across almost all settings. The performance gap was especially large in Heterogeneous Cost settings, where baseline methods struggled. On small graphs ($n=15$), MCTS nearly matched the results of an exhaustive brute-force search.

Imitation Learning Efficiency and Massive Speedup: The GIL-trained GNN successfully learned the structure of the equilibria, achieving at least 99.5% of the MCTS expert's performance on unseen test graphs. Crucially, on the largest graphs tested ($n=100$), evaluating the GIL policy was approximately three orders of magnitude (~1000x) faster than running the MCTS planning algorithm, reducing computation time from seconds or minutes to mere milliseconds per episode.

Interestingly, when testing curriculum learning (training the GNN on small graphs first), the authors found it was context-dependent. It helped generalization for random graphs but was less effective than mixed-size training for scale-free graphs.

Limitations and Future Directions

While highly effective, the approach has limitations. It assumes a central planner with full, global knowledge of the network structure, which is not always realistic in decentralized human societies. Furthermore, the method relies entirely on the mIS correspondence, meaning it cannot be directly applied to networked PGGs where this specific mathematical relationship does not hold.

Finally, while this paper successfully identifies what the optimal outcomes are, it doesn't solve how to get self-interested agents to adopt them. Future work could explore incentivization mechanisms—such as targeted subsidies or modifying the network structure itself—framing the design of these interventions as a new search problem.

Summary updated

BibTeX
@inproceedings{darvariu2021solving,
  author = {Victor-Alexandru Darvariu and Stephen Hailes and Mirco Musolesi},
  title = {{Solving Graph-based Public Goods Games with Tree Search and Imitation Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure