Enhancing Transformer-based Routing by Encoding Distance via Relative Positional Encoding

📅 2026-07-21
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the limitation of standard Transformers in team orienteering problems, where the lack of explicit spatial relationship modeling hinders performance. To overcome this, the authors propose incorporating relative positional encoding as an additive bias within the attention mechanism, thereby explicitly embedding geometric distances between nodes into the graph representation for the first time. This enhancement significantly improves the model’s spatial awareness and path decoding quality. Evaluated on instances with up to 100 nodes, the proposed Transformer-based encoder-decoder architecture consistently outperforms existing methods, achieving notable gains in both collected reward and optimality gap metrics. The approach effectively enhances the model’s scalability and generalization capability for complex combinatorial optimization problems.
📝 Abstract
This paper explores Relative Positional Encoding (RPE) as an additive bias in Transformer architectures to solve the Team Orienteering Problem. By embedding in the attention mechanism pairwise spatial relationships among nodes of the graph that represents the routing problem, the transformer encoder can compute a richer spatial-aware graph embedding that allows the decoder to estimate better routes. Experimental results involving instances up to 100 nodes demonstrate consistent improvements in collected rewards and optimality gaps over vanilla Transformer architectures used by other state-of-the-art works. These findings highlight that explicit relational modeling significantly enhances scalability and generalization for complex combinatorial optimization.
Problem

Research questions and friction points this paper is trying to address.

Team Orienteering Problem
Transformer
Relative Positional Encoding
Combinatorial Optimization
Routing
Innovation

Methods, ideas, or system contributions that make the work stand out.

Relative Positional Encoding
Transformer
Team Orienteering Problem
Combinatorial Optimization
Spatial-aware Embedding
L
Leyre Encío
Grupo de Tratamiento de Imágenes, Information Processing and Telecomunications Center, ETSI Telecomunicación, Universidad Politécnica de Madrid, 28040, Madrid, Spain
D
Daniel Fuertes
Grupo de Tratamiento de Imágenes, Information Processing and Telecomunications Center, ETSI Telecomunicación, Universidad Politécnica de Madrid, 28040, Madrid, Spain
C
Carlos R. del-Blanco
Grupo de Tratamiento de Imágenes, Information Processing and Telecomunications Center, ETSI Telecomunicación, Universidad Politécnica de Madrid, 28040, Madrid, Spain
Fernando Jaureguizar
Fernando Jaureguizar
Universidad Politecnica de Madrid