Reversible Graph Serialization
- Reversible graph serialization is a family of methods that encode graphs into alternative representations for exact recovery up to isomorphism.
- Techniques range from discrete sequence-based encodings and stateful binary protocols to latent continuous transformations with varying recovery guarantees.
- The topic clarifies operational and semantic reversibility, highlighting differences between strict bijections and approximate or model-level recoveries.
Reversible graph serialization denotes a family of representations in which a graph, or a graph-derived object, is mapped into another form together with a recovery guarantee. In the literature, that guarantee is not uniform. Some works define reversibility as exact reconstruction of a discrete graph up to isomorphism from a sequence or string; others target lossless recovery of an RDF graph, a property graph, or a distributed sparse network state; still others use “reversible” for exact bijections over continuous node embeddings, or for logical encodings into auxiliary sparse graphs from which the original graph is first-order interpretable (Lopez-Rubio et al., 11 Mar 2026, Guo et al., 11 Mar 2026, Sowinski et al., 12 Jun 2025, Dreier et al., 21 Jan 2026, Liu et al., 2019). The topic therefore spans exact symbolic serialization, stateful binary interchange, graph-to-graph encodings, and more qualified latent or operational notions of reversibility.
1. Scope of the term and dimensions of reversibility
A precise discussion of reversible graph serialization depends on three questions: what object is being serialized, what equivalence notion is preserved, and where the inverse depends on auxiliary state. For labeled graphs, one explicit definition is that a serialization is reversible if the original labeled graph can be recovered from its sequence up to isomorphism; formally, there exists such that (Guo et al., 11 Mar 2026). For RDF, the relevant object is not source text but the RDF abstract syntax of triples, quads, graphs, datasets, and streams; reversibility is therefore model-level and not byte-for-byte textual recovery (Sowinski et al., 12 Jun 2025). For graph normalizing flows, the exact bijection is over or over continuous node embeddings , not over discrete adjacency itself (Liu et al., 2019).
This yields several distinct regimes.
| Approach | Serialized object | Recovery claim |
|---|---|---|
| IsalGraph (Lopez-Rubio et al., 11 Mar 2026) | Finite, simple graph topology | Total decoder on ; connected-graph encoder reconstructs up to isomorphism |
| Frequency-guided graph tokenization (Guo et al., 11 Mar 2026) | Labeled graph as an alternating node-edge-node sequence | Exact recovery up to isomorphism; BPE is reversed before |
| Jelly (Sowinski et al., 12 Jun 2025) | RDF triples, quads, graphs, datasets, and streams | Lossless at the RDF abstract syntax level; not source-text preserving |
| PG / JSON-PG (Chiba et al., 2019) | Abstract property graph model | Intended round-trip under the model, with caveats on ordering and edge IDs |
| dCSR (Wang, 2023) | Distributed sparse SNN graph plus aligned state and events | Exact restart if row order, edge order, schema, and auxiliary files are preserved |
| Graph normalizing flows (Liu et al., 2019) | Continuous node features or node embeddings | Exact invertibility only for the continuous transform, not for adjacency |
A plausible implication is that “reversible” should not be treated as a single binary label. The strongest form is a total decoder and a graph-level inverse up to a clearly stated equivalence relation. Weaker forms include stateful reversibility, latent-space reversibility, or approximate reversal of a transformation history.
2. Exact sequence-based encodings of graph structure
The clearest examples of exact sequential graph serialization are instruction-based strings for simple graphs and edge-covering sequences for labeled graphs.
IsalGraph represents the structure of any finite, simple graph as a string over the nine-character alphabet
Its decoder 0 is total and deterministic: every string over 1 decodes to a valid finite simple graph, because the virtual machine state 2 always maintains valid pointers into a circular doubly-linked list whose payloads are graph-node identifiers (Lopez-Rubio et al., 11 Mar 2026). The initial state already contains one graph node, so even the empty string decodes to a one-node graph. The encoder 3 is defined for connected graphs and guarantees
4
with reconstruction up to graph isomorphism rather than preservation of original external node numbering. The string length decomposes into one node-creation instruction per non-root node, one structural instruction per extra edge, and cumulative pointer movement: 5 A canonical variant is defined by choosing the lexicographically smallest shortest string across all starting nodes and valid traversal orders,
6
but the strongest claim,
7
is stated as a conjecture rather than a proved theorem (Lopez-Rubio et al., 11 Mar 2026).
A second exact sequence paradigm serializes labeled graphs through an edge-covering walk. Here a labeled graph is
8
with 9, and the raw serialization maps
0
The sequence is emitted as an alternating node-edge-node walk,
1
Reversibility is up to isomorphism, with strict node-index identity excluded unless an additional index mapping is supplied (Guo et al., 11 Mar 2026). The default traversal is a Frequency-Guided Eulerian circuit, driven by global frequencies of labeled edge patterns 2: 3
4
At a node 5, the next edge is selected by
6
with the canonical example 7. For disconnected graphs, components are serialized independently, then sorted primarily by descending length and secondarily lexicographically before concatenation. For undirected graphs, each undirected edge is treated as two opposing directed edges. Byte Pair Encoding is then applied as a reversible symbolic compression layer: merged tokens are expanded by reversing merge rules, after which 8 reconstructs the labeled graph up to isomorphism (Guo et al., 11 Mar 2026).
These two lines differ in scope. IsalGraph targets finite simple graph topology with a total decoder from all strings over a fixed alphabet. Frequency-guided tokenization targets labeled graphs over a finite alphabet and is designed to make frequent local substructures adjacent so that BPE learns useful graph tokens. In both cases, the graph-level representation is discrete and explicit.
3. Model-level and systems serializations
A different tradition treats reversible graph serialization as lossless interchange of graph data models or distributed sparse states rather than topology-only string coding.
Jelly is a Protocol-Buffer-based binary serialization for RDF triples, quads, graphs, datasets, and streams. Its stream is divided into frames; it uses three fixed-size string lookup tables for IRI prefixes, IRI suffixes, and datatypes, plus variable-length integer references, delta compression of identifiers, and omission of repeated consecutive terms (Sowinski et al., 12 Jun 2025). Recovery is stateful: the decoder reconstructs omitted or referenced terms by maintaining synchronized dictionary state and previous-term context. This is lossless at the RDF abstract syntax level, including grouped streams and named graphs, but it is not reversible to exact source text. Prefix declarations, whitespace, comments, line breaks, and source-format-specific surface syntax are not preserved; nor is the byte representation canonical, since table replacement policy and statement order can vary (Sowinski et al., 12 Jun 2025).
For property graphs, the proposed abstract model is
9
where nodes and edges carry sets of labels and sets of properties, and properties take the form 0 with 1 and 2 (Chiba et al., 2019). The PG and JSON-PG syntaxes are close to direct encodings of that model and are intended to preserve nodes, edges, directionality, multiple labels, multi-valued properties, and mixed graphs. However, the formal model does not preserve ordering by design, and the serialization lacks edge IDs. As a result, distinguishing parallel edges with identical endpoints, labels, and properties is problematic, and the paper does not explicitly prove injectivity or round-trip equivalence for all model distinctions (Chiba et al., 2019).
The dCSR proposal extends compressed sparse row storage into a partition-aware serialization for spiking neural networks. The essential claim is that adjacency, vertex state, edge state, model schema, coordinates, partition distribution, and delayed events are all serialized in the same partitioned order as the CSR organization (Wang, 2023). The on-disk state is spread across .adjcy.k, .dist, .coord.k, .state.k, .model, and .event.k files. Exact restart requires preserving row order within partitions, partition order, edge order within each row, the .model schema, and delayed events; in the directed case, exact reconstruction may also depend on special none model identifiers used when the partitioning adjacency is undirected but the simulated synaptic graph is directed (Wang, 2023). This is reversible serialization in a strict operational sense: the intended target is checkpoint/restart of the same distributed simulation, not merely an isomorphic graph.
Taken together, these systems show that reversibility can be graph-model-specific and stateful. The inverse may depend not only on bytes but also on lookup-table state, row ordering, partition metadata, or explicit schema.
4. Reversible latent and logical encodings
Some influential work uses “reversible” for exact transformations on graph-derived continuous or logical representations, not for direct serialization of discrete adjacency.
Graph normalizing flows define a graph as
3
where 4 is the node feature matrix and 5 contains adjacency and optional edge features (Liu et al., 2019). The reversible module partitions node features,
6
and applies RealNVP-style affine coupling with graph-conditioned functions 7. Earlier hidden states can be reconstructed exactly from later ones, which yields reduced memory usage during backpropagation. In the generative setting, however, the exact bijection is only between continuous node-embedding sets and Gaussian latent codes. Graph generation proceeds as
8
followed by thresholding. The paper is therefore highly relevant to reversible neural transformations on graph-structured data, but it is only partially relevant to strict reversible graph serialization of discrete graphs, because the encoder and decoder around the flow are not invertible by construction and information loss can occur in reconstruction and thresholding (Liu et al., 2019).
A more structural form of reversible encoding appears in the approximate reversal of first-order transductions on sparse graph classes. For any graph class 9 that is monadically stable and has inherently linear neighborhood complexity, the paper gives an 0-time algorithm that transforms 1 into a colored graph 2 in a bounded-expansion class 3 together with a fixed first-order interpretation 4 such that
5
This is not faithful inversion of an original transduction instance-by-instance; rather, it constructs a new witness 6 from which 7 is exactly recoverable by a fixed decoder (Dreier et al., 21 Jan 2026). A plausible implication is that reversible graph serialization can also be understood as lossless re-expression of a graph into a more structured graph class, with the inverse supplied by logic rather than by a byte-level parser.
5. Reversibility as an operational and semantic constraint
A semantic account of serialization as a reversible effect models a serializer as 6 with 7 acting as a partial deserializer (Heunen et al., 2018). The framework is that of dagger arrows and inverse arrows, where partiality is explicit: many serialization methods allow many different serialized representations of the same data, so the inverse need only be defined on outputs actually produced by the serializer. The paper does not discuss graphs explicitly, but it provides a precise formal template for non-canonical reversible serialization.
Local graph evolution imposes further constraints. In the framework of causal graph dynamics, a dynamics 8 is shift-invariant, continuous, and bounded; invertibility means 9 is bijective, and reversibility means 0 is again a causal graph dynamics (Arrighi et al., 2018). In the strict model, invertible dynamics are almost vertex-preserving: there exists a bound 1 such that if 2, then the antecedent map 3 is bijective. The paper therefore recovers reversible local node creation and destruction only in three relaxed settings: Anonymous Causal Graph Dynamics, Invisible Matter Causal Graph Dynamics, and Named Causal Graph Dynamics, and proves these settings equivalent in expressive power (Arrighi et al., 2018). Invisible matter attaches an infinite binary-tree reservoir to each visible vertex; name algebra uses structured terms with rewrite rules such as
4
This suggests that exact reversible size change requires provenance to be embedded into the representation itself.
A more limited operational perspective appears in work on uniform memory and a particular case of serialization for 5, where serialization is useful for comparing results during computation. The visible text does not establish full graph-level invertibility, but it does show that serialization can be treated as an online computational mechanism rather than merely a storage format (Salikhmetov, 2010).
6. Misconceptions, boundary cases, and adjacent graph-to-sequence tasks
A common misconception is that any method described as reversible on graph data is a lossless serializer of discrete graphs. The literature does not support that equivalence. Graph normalizing flows are exactly invertible over continuous node states or embeddings, but not over adjacency matrices themselves (Liu et al., 2019). Frequency-guided tokenization reconstructs labeled graphs up to isomorphism, not original node indices (Guo et al., 11 Mar 2026). Jelly is lossless for RDF content but not for original Turtle, TriG, N-Triples, or JSON-LD source text, and it is not canonical (Sowinski et al., 12 Jun 2025). dCSR is exact only if ordering conventions and all auxiliary files are preserved (Wang, 2023). PG and JSON-PG aim at lossless model-level interchange, yet the lack of edge IDs and the use of set semantics limit strict injectivity (Chiba et al., 2019).
Canonicality is also distinct from reversibility. IsalGraph has a total decoder and an encoder that reconstructs connected simple graphs up to isomorphism, but the strongest canonical-completeness claim remains conjectural (Lopez-Rubio et al., 11 Mar 2026). This suggests that exact decoding does not by itself solve graph isomorphism or produce a unique normal form.
Finally, not every graph-to-sequence method in a reversible-computation domain is reversible graph serialization. BDD2Seq maps a circuit netlist graph to a variable-ordering permutation for BDD-based reversible-circuit synthesis. The “reversible” qualifier belongs to the synthesized circuit model, while the graph-to-sequence map is task-dependent, many-to-one, and not invertible: the output permutation does not reconstruct the original netlist graph (Miao et al., 11 Nov 2025). This provides a useful negative boundary. Sequence generation from graphs may optimize a downstream reversible computation without constituting reversible graph serialization in the strict representational sense.
The literature therefore supports a layered view of reversible graph serialization. At its strongest, it is an exact, explicit inverse between discrete graph structures and serialized codes, usually up to isomorphism. At weaker but still rigorous levels, it may mean model-level round-tripping of graph data, stateful recovery of distributed sparse state, logical reconstruction from an auxiliary sparse witness, or exact reversibility only inside a latent continuous representation. The technical content of a reversibility claim lies in that distinction.