Representation of the structure of graphs by sequences of instructions

📅 2025-12-11
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
Existing graph representations—such as adjacency matrices—are incompatible with the text-processing paradigm of large language models (LLMs). To address this, we propose a reversible, locally structure-preserving mapping from graphs to instruction sequences: graphs are encoded into compact, deterministic instruction strings via adjacency matrix decomposition, yielding a parseable textual representation; a custom reversible parser enables lossless reconstruction. This work establishes the first bridge between graph algebra and LLM-native textual processing, simultaneously ensuring structural fidelity and sequence conciseness. Experiments demonstrate that our representation significantly improves LLM performance on graph modeling tasks—including graph classification and link prediction—validating both its effectiveness and generalizability across diverse graph domains.

Technology Category

Machine Learning: Graph-based Machine LearningNatural Language Processing: (Large) Language ModelsPlanning, Routing, and Scheduling: Planning with Language Models

Application Category

Graph Algorithms and Modeling for the Web: Foundation models and LLMs for Web-related graphsSemantics and Knowledge: Methods to enhance, augment, integrate or synergize semantic models such as knowledge graphs and LLMsSearch and Retrieval-Augmented AI: Search Tool Learning with LLM: Teaching LLMs to invoke search and make use of retrieved information
📝 Abstract
The representation of graphs is commonly based on the adjacency matrix concept. This formulation is the foundation of most algebraic and computational approaches to graph processing. The advent of deep learning language models offers a wide range of powerful computational models that are specialized in the processing of text. However, current procedures to represent graphs are not amenable to processing by these models. In this work, a new method to represent graphs is proposed. It represents the adjacency matrix of a graph by a string of simple instructions. The instructions build the adjacency matrix step by step. The transformation is reversible, i.e. given a graph the string can be produced and vice versa. The proposed representation is compact and it maintains the local structural patterns of the graph. Therefore, it is envisaged that it could be useful to boost the processing of graphs by deep learning models. A tentative computational experiment is reported, with favorable results.
Problem

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

Develops a graph representation method using instruction sequences
Enables deep learning models to process graph structures effectively
Creates reversible, compact strings that preserve local graph patterns
Innovation

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

Represent graphs using sequences of simple instructions
Transform adjacency matrix into reversible string representation
Compact representation preserves local structural patterns of graphs
🔎 Similar Papers
No similar papers found.
E
Ezequiel López-Rubio
Department of Computer Languages and Computer Science, University of Málaga, Bulevar Louis Pasteur, 35, 29071 Málaga, Spain