arXiv:2608.23917cs.LGAug 2026

Manuscript Offprint

arXiv:2608.23917

GATNextHop: A GAT for Shortest Path Routing with Cross-Topology Generalization

Chia-Hong Chou, Katerina Potika

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Chia-Hong Chou

Department of Computer Science

San José State University

San José, CA

oliver.chou@sjsu.edu

Katerina Potika

Department of Computer Science

San José State University

San José, CA

katerina.potika@sjsu.edu

Abstract—Common shortest-path algorithms, such as Dijkstra's (SPF), that OSPF uses, provide exact routing solutions but must be recomputed for each network topology, limiting scalability in dynamic or large-scale networks. This paper proposes the GATNextHop model to determine whether a Graph Neural Network, namely the Graph Attention Network, can approximate shortest paths and generalize across topologies. By training on synthetic graphs and evaluating on real-world Internet Service Provider networks from the Internet Topology Zoo, we aim to benchmark our model's ability to learn routing heuristics that transfer across network structures. Performance will be evaluated in terms of accuracy, inference speed, and generalization, comparing the GNN against Dijkstra's algorithm to quantify trade-offs between learned and classical routing approaches.

Index Terms—Graph Neural Networks, shortest path, routing, topology, Internet Topology Zoo, Graph Attention Networks, Random Graphs

I. INTRODUCTION

In modern network environments where the topology constantly changes, it is challenging to efficiently route packets in an optimal manner. Although shortest-path routing protocols such as OSPF [1] and its SPF (Dijkstra's) algorithm are reliable and exact, they must be rerun per topology, insufficient in network topologies with frequent topology changes or limited transmissions.

Graph Neural Networks (GNNs) introduced a paradigm shift in existing routing optimization studies. Classical algorithms, including Dijkstra's, guarantee an exact solution that operates optimally in static topologies but struggle to adapt to scalable, dynamic environments. In contrast, according to Jiang et al. [2], the GNN-based approach enables optimization in changing environments and has been applied to solve network routing problems.

Previous work explored using GNNs to perform routing optimizations in dynamic, scalable network topologies. It was discovered that GNN-based routing methods could outperform Dijkstra's shortest path algorithm in dynamic or complex network environments [3]. Following this idea, we investigate whether a GNN, specifically a Graph Attention Network (GAT) [4], can approximate the most likely next-hop node and generalize from synthetic (random) graphs to real internet service provider (ISP) topologies.

First, we analyze real-world network topologies from the Internet Topology Zoo [5] dataset and explore key characteristics at the node and edge-level, including degree, centrality, weights, betweenness, and clustering coefficient. Then, based on the network analysis of real-world networks, we curated synthetic (random) datasets of 1000 graphs using the NetworkX library [6], including features similar to those in the training set. Using the training set, we performed an 80 – 20 test–validation split and trained a GAT that encodes edge and node features to predict the best next-hop node for the shortest distance. Using GAT with 4 node features (normalized degree, betweenness centrality, clustering coefficient, and degree centrality) and 1 edge feature (edge weight), we achieved 85.1% accuracy in synthetic validation during training and 84.2% accuracy in the Internet Topology Zoo test set. Additionally, by including only betweenness centrality as the node-level feature, the model outperformed the full-feature model and achieved 85.7% accuracy on the synthetic set and 84.6% on the test set. It shows that GAT has the potential to generalize from a synthetic data set and estimate the optimal next-hop on real-world network topologies, provided structurally similar training data.

The paper’s contribution is the following. (i) Designed GAT-NextHop, a GAT-based next-hop prediction model achieving 85.1% accuracy on synthetic graphs and 84.2% on unseen Internet Topology Zoo topologies, with ablation studies identifying betweenness centrality as the most impactful node feature. (ii) Benchmarked SPF (Dijkstra) vs. GAT inference speed across graph sizes using 180 real-world ISP topologies from the Internet Topology Zoo dataset.

The goal of our approach is to handle conditions in which Dijkstra's assumptions break down (e.g., dynamic and partial graphs). Our focus is on generalizing under uncertainty rather than computational competition.