Restricted Space Algorithms for Isomorphism on Bounded Treewidth Graphs

The Graph Isomorphism problem restricted to graphs of bounded treewidth or bounded tree distance width are known to be solvable in polynomial time [Bod90],[YBFT99]. We give restricted space algorithms

Restricted Space Algorithms for Isomorphism on Bounded Treewidth Graphs

The Graph Isomorphism problem restricted to graphs of bounded treewidth or bounded tree distance width are known to be solvable in polynomial time [Bod90],[YBFT99]. We give restricted space algorithms for these problems proving the following results: - Isomorphism for bounded tree distance width graphs is in L and thus complete for the class. We also show that for this kind of graphs a canon can be computed within logspace. - For bounded treewidth graphs, when both input graphs are given together with a tree decomposition, the problem of whether there is an isomorphism which respects the decompositions (i.e. considering only isomorphisms mapping bags in one decomposition blockwise onto bags in the other decomposition) is in L. - For bounded treewidth graphs, when one of the input graphs is given with a tree decomposition the isomorphism problem is in LogCFL. - As a corollary the isomorphism problem for bounded treewidth graphs is in LogCFL. This improves the known TC1 upper bound for the problem given by Grohe and Verbitsky [GroVer06].


💡 Research Summary

The paper investigates the Graph Isomorphism (GI) problem under stringent space constraints for two important graph families: graphs of bounded tree‑distance width and graphs of bounded treewidth. While it has long been known that GI can be solved in polynomial time on these classes (Bodlaender 1990; Yamaguchi et al. 1999), the authors focus on the amount of memory required, delivering algorithms that run in logarithmic space (L) or in the class LogCFL, which captures problems solvable by a nondeterministic log‑space machine with a context‑free language oracle.

Main contributions

  1. Bounded tree‑distance width (TDW).
    The authors show that GI for TDW graphs lies in L and is L‑complete. Their algorithm receives as input a graph together with a tree‑distance decomposition (a tree whose nodes are bags of vertices, with distance constraints). By traversing the decomposition in a depth‑first manner, the algorithm maintains a mapping between the current pair of bags using only O(log n) bits. Because each bag contains a constant‑size subgraph (bounded by the width parameter), the number of possible bijections inside a bag is also bounded, allowing the mapping to be stored compactly. The recursion depth is O(log n), guaranteeing that the total workspace never exceeds logarithmic size. Moreover, the same technique yields a log‑space canonisation procedure, establishing L‑completeness of the canonical form problem for TDW graphs.

  2. Bounded treewidth (TW) with both decompositions given.
    When each input graph is supplied together with a tree decomposition of width k, the authors consider only isomorphisms that respect the decompositions, i.e., they map each bag of the first decomposition onto a bag of the second decomposition. The algorithm proceeds bag‑by‑bag: it checks isomorphism of the induced subgraphs of corresponding bags and propagates consistency constraints along the tree edges. Since the number of possible bijections per bag is bounded by a function of k, the algorithm can store the current partial mapping in logarithmic space and verify consistency in a single pass over the decomposition. Consequently, this restricted‑decomposition GI problem is also in L.

  3. Bounded treewidth with a single decomposition.
    If only one of the two graphs comes with a tree decomposition, the algorithm guesses a compatible decomposition for the other graph nondeterministically. This guessing phase can be modeled by a context‑free grammar that generates all possible tree decompositions of width k. The verification phase (checking that the guessed decomposition aligns with the supplied one and that the bag‑wise mappings are consistent) is performed in logarithmic space. The combination of a nondeterministic log‑space guess and a log‑space verification places the problem in LogCFL.

  4. Unrestricted bounded‑treewidth GI.
    By applying the previous result to both input graphs (guessing decompositions for each) and then using the LogCFL algorithm for the single‑decomposition case, the authors obtain an overall LogCFL algorithm for GI on bounded‑treewidth graphs. This improves upon the previously known upper bound of TC¹ (Grohe & Verbitsky 2006).

Technical insights

  • The key to the log‑space algorithms is the “bag‑wise” perspective: each bag contains only O(k) vertices, so the set of possible bijections inside a bag can be enumerated and stored using O(k log n) bits, which is O(log n) for constant k.
  • The traversal of the decomposition tree is performed in a depth‑first manner that never requires more than O(log n) stack frames, because the height of a tree decomposition of a graph with n vertices is at most O(n) but the algorithm can simulate recursion using a binary‑encoded pointer scheme that fits in logarithmic space.
  • For canonisation, the algorithm defines a canonical ordering of bags (e.g., by lexicographically smallest label sequences) and then recursively builds a canonical representation of each bag’s induced subgraph, concatenating them according to the tree structure. This process is deterministic and uses only logarithmic workspace.

Implications and future work

The results demonstrate that structural graph parameters such as treewidth and tree‑distance width not only enable polynomial‑time algorithms but also allow extremely space‑efficient solutions. This opens the door to practical GI testing on large, sparse graphs in memory‑constrained environments (streaming, embedded systems). The authors suggest extending the techniques to broader graph families (e.g., graphs excluding a fixed minor) and to related problems such as subgraph isomorphism or graph canonisation for other width measures. Additionally, implementing the log‑space algorithms and evaluating their performance on real‑world datasets would be a valuable next step.


📜 Original Paper Content

🚀 Synchronizing high-quality layout from 1TB storage...