Goal-directed graph construction using reinforcement learning

Victor-Alexandru Darvariu, Stephen Hailes, Mirco Musolesi

Abstract

Graphs can be used to represent and reason about systems and a variety of metrics have been devised to quantify their global characteristics. However, little is currently known about how to construct a graph or improve an existing one given a target objective. In this work, we formulate the construction of a graph as a decision-making process in which a central agent creates topologies by trial and error and receives rewards proportional to the value of the target objective. By means of this conceptual framework, we propose an algorithm based on reinforcement learning and graph neural networks to learn graph construction and improvement strategies. Our core case study focuses on robustness to failures and attacks, a property relevant for the infrastructure and communication networks that power modern society. Experiments on synthetic and real-world graphs show that this approach can outperform existing methods while being cheaper to evaluate. It also allows generalization to out-of-sample graphs, as well as to larger out-of-distribution graphs in some cases. The approach is applicable to the optimization of other global structural properties of graphs.

Introduction

Graphs serve as the fundamental architecture for critical infrastructure, including power grids, transportation networks, and the internet. While researchers have developed numerous metrics to quantify network robustness, a general methodology for constructing or optimizing a graph to meet specific performance objectives remains elusive.

Traditional approaches typically rely on hand-crafted heuristics, such as connecting nodes with the lowest degrees. However, these rigid rules often fail to adapt to diverse network topologies or specific threat models, such as coordinated attacks versus random equipment failures. This research introduces RNet-DQN, a framework that replaces static heuristics with a learning agent capable of discovering optimal construction strategies through sequential decision-making.

Methodology: Graph Construction as an MDP

The researchers formulate graph construction as a Markov Decision Process (MDP). In this framework, an agent starts with an initial graph and a fixed "budget" of edges. The agent selects nodes sequentially to form new connections, aiming to maximize a final reward based on the graph's improved robustness.

Sequential decision-making process for graph construction.

To process the graph's structural information, the framework utilizes Structure2Vec (S2V), a Graph Neural Network (GNN) that generates mathematical embeddings of nodes and the global graph state. These embeddings are invariant to node labeling and size, allowing the model to generalize across different graphs. The learning process is driven by Deep Q-Learning (DQN), where the agent receives a terminal reward proportional to the improvement in the "critical fraction"—the percentage of nodes that must be removed before the network loses connectivity. The model is tested against both Random Removal (simulating failures) and Targeted Removal (simulating attacks on high-degree hubs).

Datasets and Evaluation

The RNet-DQN model was trained and validated using both synthetic and empirical datasets:

  • Synthetic Graphs: The study utilized Erdős–Rényi (ER) random graphs and Barabási–Albert (BA) scale-free graphs to test performance on varied theoretical topologies.
  • Real-World Infrastructure: The researchers applied the model to the Euroroad network and the Scigrid European power grid dataset. By extracting subgraphs for specific countries (e.g., France, UK), they evaluated the agent's ability to optimize realistic, large-scale infrastructure.

Key Insights and Strategy Discovery

A significant finding is that the RL agent discovers distinct strategies tailored to the specific threat model. For random failures, the agent learns to create centralized "hubs." Conversely, for targeted attacks, it learns to distribute edges more uniformly to prevent the emergence of vulnerable single points of failure.

Furthermore, the framework demonstrates impressive efficiency. While training is computationally intensive due to the need for Monte Carlo simulations, the resulting model performs inference in $O(|V| + |E|)$ time. This makes it significantly faster than traditional "greedy" search methods that must evaluate every possible edge addition.

Results

RNet-DQN demonstrated superior or competitive performance compared to state-of-the-art heuristics, such as those based on the Fiedler Vector or Effective Resistance, in 8 out of 12 synthetic test scenarios. On real-world infrastructure graphs, the RL approach consistently identified edge additions that provided greater robustness gains than traditional baselines. In some instances, the agent improved the critical fraction by nearly 50% relative to the original graph.

Crucially, the model exhibited strong generalization capabilities. A model trained on small 20-node synthetic graphs was able to effectively improve much larger, unseen graphs of up to 100 nodes without additional training, particularly for the random failure objective.

Discussion and Future Work

Despite its success, the model faces challenges in generalizing "targeted attack" strategies to significantly larger graphs, likely because the role of central nodes changes as the network scale increases. Additionally, the computational cost of training remains high, and the "black-box" nature of the GNN makes the agent's specific choices less interpretable than simple mathematical rules.

Future research directions include incorporating "edge costs" to reflect the economic realities of infrastructure development and applying the framework to other graph properties, such as communication efficiency or assortativity.

Summary updated

BibTeX
@inproceedings{darvariu2020goal,
  author = {Victor-Alexandru Darvariu and Stephen Hailes and Mirco Musolesi},
  title = {{Goal-directed graph construction using reinforcement learning}},
  booktitle = {Proceedings of the Royal Society A Mathematical Physical and Engineering Sciences},
  year = {2020},
}
Figure