🤖 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.
📝 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.