An improved isomorphism test for bounded-tree-width graphs

We give a new fpt algorithm testing isomorphism of n-vertex graphs of tree width k in time 2^kpolylog (k)poly (n), improving the fpt algorithm due to Lokshtanov, Pilipczuk, Pilipczuk, and Saurabh (FOCS 2014), which runs in time 2^O(k^5 k)poly (n). Based on an improved version of the isomorphism-invariant graph decomposition technique introduced by Lokshtanov et al., we prove restrictions on the structure of the automorphism groups of graphs of tree width k. Our algorithm then makes heavy use of the group theoretic techniques introduced by Luks (JCSS 1982) in his isomorphism test for bounded degree graphs and Babai (STOC 2016) in his quasipolynomial isomorphism test. In fact, we even use Babai's algorithm as a black box in one place. We also give a second algorithm which, at the price of a slightly worse running time 2^O(k^2 k)poly (n), avoids the use of Babai's algorithm and, more importantly, has the additional benefit that it can also used as a canonization algorithm.



page 1

page 2

page 3

page 4


Isomorphism Testing for Graphs Excluding Small Minors

We prove that there is a graph isomorphism test running in time n^polylo...

Canonisation and Definability for Graphs of Bounded Rank Width

We prove that the combinatorial Weisfeiler-Leman algorithm of dimension ...

Computing the Fréchet distance of trees and graphs of bounded tree width

We give algorithms to compute the Fréchet distance of trees and graphs w...

A Faster Isomorphism Test for Graphs of Small Degree

Luks's algorithm (JCSS 1982) to test isomorphism of bounded degree graph...

Faster Property Testers in a Variation of the Bounded Degree Model

Property testing algorithms are highly efficient algorithms, that come w...

Deterministic Tree Embeddings with Copies for Algorithms Against Adaptive Adversaries

Embeddings of graphs into distributions of trees that preserve distances...

Isomorphism Testing Parameterized by Genus and Beyond

We present an isomorphism test for graphs of Euler genus g running in ti...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Already early on in the beginning of research on the graph isomorphism problem (which asks for structural equivalence of two given input graphs) a close connection to the structure and study of the automorphism group of a graph was observed. For example, Mathon [Mat79] argued that the isomorphism problem is polynomially equivalent to the task of computing a generating set for the automorphism group and also to computing the size of the automorphism group.

With Luks’s polynomial time isomorphism test for graphs of bounded degree [Luk82], the striking usefulness of group theoretic techniques for isomorphism problems became apparent and they have been exploited ever since (e.g. [BL83, Mil83, Pon91, Neu16]). In his algorithm, Luks shows and uses that the automorphism group of a graph of bounded degree, after a vertex has been fixed, has a very restricted structure. More precisely, the group is in the class of all groups whose non-Abelian composition factors are isomorphic to a subgroup of the symmetric group .

Most recently, Babai’s quasi-polynomial time algorithm for general graph isomorphism [Bab16] adds several novel techniques to tame and manage the groups that may appear as the automorphism group of the input graphs.

A second approach towards isomorphism testing is via decomposition techniques (e.g. [Bod90, GM15, GS15]). These decompose the graph into smaller pieces while maintaining control of the complexity of the interplay between the pieces. When taking this route it is imperative to decompose the graph in an isomorphism-invariant fashion so as not to compare two graphs that have been decomposed in structurally different ways.

A prime example of this strategy is Bodlaender’s isomorphism test [Bod90] for graphs of bounded treewidth. Bodlaender’s algorithm is a dynamic programming algorithm that takes into account all -tuples of vertices that separate the graph, leading to a running time of  to test isomorphism of graphs of tree width at most .

Only recently, Lokshtanov, Pilipczuk, Pilipczuk, and Saurabh [LPPS17] designed a fixed-parameter tractable isomorphism test for graphs of bounded tree width which has a running time of . This algorithm first “improves” a given input graph  to a graph  by adding an edge between every pair of vertices between which more than -internally vertex disjoint paths exist. The improved graph  isomorphism-invariantly decomposes along clique separators into clique-separator free parts, which we will call basic throughout the paper. The decomposition can in fact be extended to an isomorphism-invariant tree decomposition into basic parts, as was shown in [ES16] to design a logspace isomorphism test for graphs of bounded tree width. For the basic parts, Lokshtanov et al. [LPPS17] show that, after fixing a vertex of sufficiently low degree, is it possible to compute an isomorphism-invariant tree decomposition whose bags have a size at most exponential in  and whose adhesion is at most . They use this invariant decomposition to compute a canonical form essentially by a brute-force dynamic programming algorithm.

The problem of computing a canonical form is the task to compute, to a given input graph , a graph  isomorphic to  such that the output  depends only on the isomorphism class of  and not on  itself.

The isomorphism problem reduces to the task of computing a canonical form: for two given input graphs we compute their canonical forms and check whether the canonical forms are equal (rather than isomorphic).

As far as we know, computing a canonical form could be algorithmically more difficult than testing isomorphism. It is usually not very difficult to turn combinatorial isomorphism tests into canonization algorithms, sometimes the algorithms are canonization algorithms in the first place. However, canonization based on group theoretic isomorphism tests is more challenging. For example, it is still open whether there is a graph canonization algorithm running in quasipolynomial time.

Our Results

Our main result is a new fpt algorithm testing isomorphism of graphs of bounded tree width.

Theorem 1.

There is a graph isomorphism test running in time

where is the size and the minimum tree width of the input graphs.

In the first part of the paper, we analyze the structure of the automorphism groups of a graph  of tree width . Following [LPPS17] and [ES16], we pursue a two-stage decomposition strategy for graphs of bounded tree width, where in the first step we decompose the improved graph along clique separators into basic parts. We observe that these basic parts are essential for understanding the automorphism groups. We show (Theorem 9) that with respect to a fixed vertex  of degree at most , we can construct for each basic graph  an isomorphism-invariant tree decomposition of width at most and adhesion at most where, in addition, each bag is equipped with a graph of small degree which is defined in an isomorphism-invariant way and gives us insight about the structure of the bag. In particular, using Luks results [Luk82], this also restricts the structure of the automorphism group.

Our construction is based on a similar construction of an isomorphism-invariant tree decomposition in [LPPS17]. Compared to that construction, we improve the adhesion (that is, the maximum size of intersections between adjacent bags of the decomposition) from to . More importantly, we expand the decomposition by assigning a group and a graph to each bag.

Using these groups, we can prove that (the group of all automorphisms of that keep the vertex fixed) is a  group. This significantly restricts possible automorphism groups. Moreover, using the graph structure assigned to each bag, we can also compute the automorphism group of a graph of tree width within the desired time bounds. The first, already nontrivial step towards computing the automorphism group, is a reduction from arbitrary graphs of tree width to basic graphs. The second step reduces the problem of computing the automorphism group of a basic graph to the problem of computing the automorphism group of a structure that we call an expanded -ary tree. In the reduction, the parameter will be polynomially bounded in . Then as the third step, we can apply a recent result [GNS18] due to the first three authors that allows us to compute the automorphism groups of such expanded -ary trees. This result is heavily based on techniques introduced by Babai [Bab16] in his quasipolynomial isomorphism test. In fact, it even uses Babai’s algorithm as a black box in one place.

We prove a second result that avoids the results of [GNS18, Bab16] and even allows us to compute canonical forms, albeit at the price of an increased running time.

Theorem 2.

There is a graph canonization algorithm running in time

where is the size and the tree width of the input graph.

Even though it does not employ Babai’s new techniques, this algorithm still heavily depends on the group theoretic machinery. As argued above, the design of group theoretic canonization algorithms often requires extra work, and can be slightly technical, compared to the design of an isomorphism algorithm. Here, we need to combine the group theoretic canonization techniques going back to Babai and Luks [BL83] with graph decomposition techniques, which poses additional technical challenges and requires new canonization subroutines.

Organization of the paper

In the next section we introduce the necessary preliminaries. The next two Sections 34 of the paper deal with the decomposition of bounded tree width graphs. They describe the isomorphism-invariant decomposition into basic parts and the isomorphism-invariant decomposition of the basic parts with respect to a fixed vertex of low degree.

The two following Sections 56 are concerned with isomorphism. We define a particular subproblem, coset-hypergraph-isomorphism, identified to be of importance. Then, we assemble the recursive isomorphism algorithm.

In the last Section 7 we devise several subroutines for canonization in general and assemble the recursive canonization algorithm.

2 Preliminaries


We use standard graph notation. All graphs considered are undirected finite simple graphs. We denote an edge by . Let be subsets of vertices. We write for the edges with one vertex in and the other vertex from , whereas are the edges with both vertices in . By , we denote the neighborhood of , i.e, all vertices outside that are adjacent to . For the induced subgraph on , we write , whereas is the induced subgraph on . A rooted graph is triple where is the root of the graph. For two vertices we denote by the distance between and , i.e. the length of the shortest path from to . The depth of a rooted graph is the maximum distance from a vertex to the root, that is, . The forward-degree of a vertex is . Note that where is the maximal forward-degree.


A pair where is called a separation if . In this case we call a separator. A separation is a -separation if and and in this case is called a -separator. A separation is a called a clique separation if is a clique and and . In this case we call a clique separator.

Tree Decompositions

Definition 3.

A tree decomposition of a graph is a pair , where is a rooted tree and is a mapping into the power set of  such that:

  1. for each vertex , the set induces a nonempty and connected subtree of T, and

  2. for each edge , there exists such that .

Sets for are called the bags of the decomposition, while sets for are called the adhesions sets. The width of a tree decomposition is equal to its maximum bag size decremented by one, i.e. . The adhesion width of is equal to its maximum adhesion size, i.e., . The tree width of a graph, denoted by , is equal to the minimum width of its tree decompositions.

A graph is -degenerate if every subgraph of has a vertex with degree at most . It is well known that every graph of tree width is -degenerate.


For a function and we write for the image of under , that is, . We write composition of functions from left to right, e.g, . By we denote the set of natural number from 1 to . By we denote the symmetric group on a set and we also write for . We use upper Greek letters and for permutation groups.

Labeling cosets

A labeling coset of a set is a set of bijective mappings where is a bijection from  to  and and is a subgroup of . By , we denoted the labeling coset . We say that is a labeling subcoset of a labeling coset , written , if is a subset of and forms a labeling coset again. Sometimes we will choose a single symbol to denote a labeling coset . For this will usually use the upper greek letter . Recall that denotes the class of all finite groups whose non-Abelian composition factors are isomorphic to subgroups of . Let be the class of all labeling cosets such that .

Orderings on sets of natural numbers

We extend the natural ordering of the natural numbers to finite sets of natural numbers. For two such sets  we define  if  or if and the smallest element of  is smaller than the smallest element of .


In this paper we will always define what the isomorphism between our considered objects are. But this can also be done in a more general context. Let

. For a vector

we define as inductively. Analogously, for a set we define as . For a labeling coset we write for . In the paper we will introduce isomorphisms for various objects and . Unless otherwise stated these are all such that where we apply as previously defined. For example, the isomorphism between two graphs and are all such that which means that has an edge , if and only if has the edge .

3 Clique separators and improved graphs

To perform isomorphism tests of graphs of bounded tree width, a crucial step in [LPPS17] is to deal with clique separators. For this step the concept of a -improved graph is the key.

Definition 4 ([Lpps17]).

The -improvement of a graph is the graph obtained from by connecting every pair of non-adjacent vertices for which there are more than pairwise internally vertex disjoint paths connecting  and . We say that a graph is -improved when .

A graph is -basic if it is -improved and does not have any separating cliques. In particular, a -basic graph is connected.

We summarize several structural properties of .

Lemma 5 ([Lpps17]).

Let be a graph and .

  1. The -improvement is -improved, i.e., .

  2. Every tree decomposition of of width at most is also a tree decomposition of .

  3. There exists an algorithm that, given and , runs in time and either correctly concludes that , or computes .

Since the construction of  from  is isomorphism-invariant, the concept of the improved graph can be exploited for isomorphism testing and canonization. A -basic graph has severe limitations concerning its structure as we explore in the following sections. In the canonization algorithm from [LPPS17] a result of Leimer [Lei93] is exploited that says that every graph has a tree decomposition into clique-separator free parts, and the family of bags is isomorphism-invariant. While it is usually sufficient to work with an isomorphism-invariant set of bags (see [OS14]) we actually require an isomorphism invariant decomposition, which can indeed be obtained.

Theorem 6 ([Lei93],[Es16]).

There is an algorithm that, given a connected graph , computes a tree decomposition of , called clique separator decomposition, with the following properties.

  1. For every the graph is clique-separator free (and in particular connected).

  2. Each adhesion set of is a clique.

  3. .

  4. For each bag  the adhesion sets of the children are all equal to  or the adhesion sets of the children are all distinct.

The algorithm runs in polynomial time and the output of the algorithm is isomorphism-invariant (w.r.t. ).

4 Decomposing basic graphs

In this section, we shall construct bounded-width tree decompositions of -basic graphs of tree width at most . Crucially, these decompositions will be isomorphism invariant after fixing one vertex of the graph. Our construction refines a similar construction of [LPPS17].

Let us define three parameters , and  (small, medium and large) that depend on  as follows:

Note that , and . The interpretation of these parameters is that  will bound the size of the adhesion sets and  will bound the bag size. The parameter  is used by the algorithm which in certain situations behaves differently depending on sets being larger than  or not.

The bound improves the corresponding bound in [LPPS17]. However, the more significant extension of the construction in [LPPS17] is that in addition to the tree decomposition we also construct both an isomorphism-invariant graph of bounded forward-degree and depth and an isomorphism-invariant -group associated with each bag.

The weight of a set with respect to a (weight) function is . The weight of a separation is the weight of its separator . For sets , among all -separations  of minimal weight there exists a unique separation with an inclusion minimal . For this separation we call  the leftmost minimal separator and denote it by . Moreover, we define where 1 denotes the function that maps every vertex to .

For we define a weight function such that for all and for all . Given a weight function , using Menger’s theorem and the Ford-Fulkerson algorithm it is possible to compute . The following lemma generalizes Lemma 3.2 of [LPPS17]. Through this generalization we obtain the adhesion bound for our decomposition.

Lemma 7.

Let be a graph, let be a subset of vertices, and let and be families where each is a minimum weight -separator with respect to for some . Let be another weight function such that for all :

  1. for all , and

  2. for all .

Let . Suppose that is the vertex set of any connected component of . Then .


We proceed by induction on . For we have , so the claim is trivial. Assume and define . Let be the vertex set of a connected component of , and let be the vertex set of the connected component of containing . Let be sets such that is a minimum weight -separator with respect to . Let be an -separation with separator . Without loss of generality we may assume that . The three sets , and  partition . Similarly the three sets  and partition . We define  to be the intersection of the -th set of the first triple with the -th set of the second triple. This way the sets  with  partition into 9 parts as shown in Figure 1.

Figure 1: Sets appearing in the proof of Lemma 7.

We have by the induction hypothesis. Since and , it suffices to show . Observe that is also an -separator, because and by the choice of , and .

By the minimality of , we have , and as , this implies . By Assumptions (1) and (2) of the lemma, it follows that

The lemma can be used to extend a set of vertices  that is not a clique separator to a set  in an isomorphism-invariant fashion while controlling the size of the adhesions sets of the components of . It will be important for us that we can also extend a labeling coset of  to a labeling coset of  and furthermore construct a graph of bounded forward-degree and depth associated with and .

Lemma 8.

Let and let be a graph that is -improved. Let and let be a labeling coset such that
, , is not a clique, is connected, , and .
There is an algorithm that either correctly concludes that , or finds a proper superset of and a labeling coset and a connected rooted graph with the following properties:
[label=()] , , [label=()] if is the vertex set of any connected component of , then , ,

  1. [label=()]

  2. , and for all .

The algorithm runs in time and the output  is isomorphism-invariant (w.r.t. the input data  and ).

Here, the output of an algorithm is isomorphism-invariant if all isomorphisms between two input data and extends to an isomorphism between the output and (An isomorphism between and is a mapping such that where we apply as defined in the preliminaries).


We consider two cases depending on the size of .

Case :

Let and let

We set and then we have the following for every vertex set of a connected component of by Lemma 7:

For every there is a -separator of size at most  disjoint from , because is -improved. Thus . Moreover, since is connected and , for all distinct every minimum weight -separator contains a vertex that is not in . It follows that .

Case :

Let and let

The properties of  follow from similar arguments as in the first case. The fact that is nonempty follows from the existence of a balanced separation (for details see [LPPS17]). Next, we show how to find in both cases. To each we associate the set . Two vertices and occur in exactly the same separators if . In this case we call them equivalent and write . Let be the equivalence classes of “”. Since each is contained in some separator of size at most we conclude that the size of each is at most .

For each labeling we choose an extension such that and for  we have if . (Recall that  is the linear order of subsets of  as defined in the preliminaries). Inside each equivalence class , the ordering is chosen arbitrarily. Define . By construction the coset  does not depend on the choices of the extensions . Since for all we conclude that , as desired.

It remains to explain how to efficiently compute . For this we simply remark that is suffices to use a set of extensions  such that  is the smallest coset containing all elements of  (i.e., we can use a coset analogue of a generating set). We conclude that  can be computed in polynomial time in the size of .

Last but not least, we show how to construct the graph . The Case is easy to handle. In this case we define as the complete graph on the set where is some new vertex, which becomes the root of . The forward-degree of is bounded by which in turn is bounded by . We consider the Case . We define . Clearly, we have . For the root we choose . We define the edges . Since for each pair there are at most different extensions with and since each separator contains at most vertices, we conclude that the forward-degree of each vertex in is bounded by . Moreover, the depth of is bounded by . ∎

A labeled tree decomposition is a 4-tuple where is a tree decomposition and is a function that maps each to a labeling coset and is a function that maps each to a graph .

The lemma can be used as a recursive tool to compute our desired isomorphism-invariant labeled tree decomposition.

Theorem 9.

Let and let be a -basic graph and let be a vertex of degree at most . There is an algorithm that either correctly concludes that , or computes a labeled tree decomposition with the following properties.

  1. [label=()]

  2. the width of is bounded by ,

  3. the adhesion width of is bounded by ,

  4. the degree of is bounded by and the number of children of with common adhesion set is bounded by for each ,

  5. is bounded by ,

  6. for each bag  the adhesion sets of the children are all equal to  or the adhesion sets of the children are all distinct. In the former case the bag size is bounded by ,

  7. for each the graph is a connected rooted graph such that and for each adhesion set there is a corresponding vertex , and for all , and

  8. .

The algorithm runs in time and the output  of the algorithm is isomorphism invariant (w.r.t.  and ). Furthermore, if we drop Property 7 as a requirement, the triple can be computed in time .

Here, the output of an algorithm is isomorphism-invariant, if all isomorphisms between two input data extend to an isomorphism between the output. More precisely, an isomorphism extends to an isomorphism between between and if there is a bijection between the tree decompositions and for each node a bijection between the vertices of graphs which extend , i.e.  for all where we naturally apply as defined in the preliminaries. Furthermore, these extensions define an isomorphism between the output data, i.e. for all nodes we have that , and .


We describe a recursive algorithm that has as the input such that the data satisfy the assumptions of Lemma 8. That is:
, , is not a clique or , is connected, and, .
The output is a labeled tree decomposition with root bag . Since has no separating cliques and therefore is not a cut vertex, the triple fulfills the input conditions which will complete the proof. The algorithm works as follows.

Step 1:

We describe how to construct and for the root node . If is a clique we define . Notice that due to Property 3. Let be an arbitrary bijection. We define . Otherwise (i.e., is not a clique) we compute and define and as in Lemma 8.

Let be the connected components of the graph . Let and .

Step 2:

We describe how to construct the graph . First, we compute the graph as in Lemma 8. To achieve that pairs of vertices from are contained in this graph we define a Cartesian product , i.e. and

Now, we define as follows. The vertex set is . The edge set is and the root of is where is the root of .

Step 3:

We call the algorithm recursively as follows. Let

(This set is essentially only an isomorphism-invariant restriction of  to . The minimum is taken with respect to , the ordering of subsets of  as defined in the preliminaries.) The image  might be a set of natural numbers different from . To rectify this we let  be the bijection from  to  that preserves the normal ordering “” of natural numbers and set . We compute recursively. By possibly renaming the vertices of the trees , we can assume w.l.o.g. .

Step 4:

We define a labeled tree decomposition as follows. Define a new root vertex and attach the root vertices computed by the recursive calls as children. We define and and . Combine all decompositions together with the new root and return the resulting decomposition .

(Correctness.) First of all, we show that fulfills the Conditions 1-6 and the recursive call in Step 3 is justified. Condition 1 is clear. For 2 notice that and satisfy 1-4 from Lemma 8 regardless which option is applied in Step 1. Condition 2 then follows from 3. For 3 notice that does not have any separating cliques, but is a separator. The Conditions 4 and 5 follow from the definition of and , whereas 6 follows from 4.

Next, we show 1-5. The bound for the width in 1 immediately follows from 2, while the bound on the adhesion width in 2 follows from 3. For 3 observe that is -improved and therefore each non-edge in is contained in at most different , i.e., for each . Therefore, . Moreover, since each contains a non-edge we conclude . For 4 we associate each bag with the set in an injective way. The number of sets occurring in each recursive call is bounded by since these sets are not empty and pairwise distinct. We conclude . Property 7 follows from 4. For any bag not satisfying Property 5 we introduce a new bag containing all equal adhesion sets. For 6 we observe that the forward-degree of the vertices is the sum of the forward-degrees of and in . The depth of is twice the depth of . Therefore, we have for each and . The construction is obviously isomorphism invariant.

(Running time.) We have already seen that the number of recursive calls is bounded by . The computation of the sets and as in Lemma 8 can be done in time . We need to explain how to compute from . With standard group theoretic techniques, including the Schreier-Sims algorithm, one can find a minimal image of . Using set transporters one can find all labelings in mapping to this minimal image. This algorithm runs in time . Since we are only interested in an isomorphism invariant restriction of to , we could also use techniques from Section 7 as follows. We define a hypergraph on the vertex set consisting of one single hyperedge . Let be the restriction of a canonical labeling of that hypergraph. This algorithm also runs in time . This leads to a total run time of . We remark that the computation of from is only needed if we require Property 7. For the computation of a labeled tree decomposition the bottleneck arises in Lemma 8 which gives a run time of . ∎

Remark 10.

We later use the isomorphism-invariance of the labeled tree decomposition from the previous theorem in more detail. Let be a non-root node and let be the adhesion set to the parent node of and let be the decomposition of the subtree rooted at and the graph corresponding to . Then is isomorphism-invariant w.r.t. and .

5 Coset-Hypergraph-Isomorphism

After having computed isomorphism-invariant tree decompositions in the previous sections we now want to compute the set of isomorphisms from one graph to another in a bottom up fashion. Let be the two input graphs and suppose we are given isomorphism-invariant tree decompositions and . For a node we let be graph induced by the union of all bags contained in the subtree rooted at . The basic idea is to compute for all pairs the set of isomorphisms from to (in addition the isomorphisms shall also respect the underlying tree decomposition) in a bottom up fashion.

The purpose of this section is to give an algorithm that solves this problem at a given bag (assuming we have already solved the problem for all paris of children of and ). Let us first give some intuition for this task. Suppose we are looking for all bijections from to that can be extended to an isomorphism from to . Let be the children of and the children of . Then we essentially have to solve the following two problems. First, we have to respect the edges appearing in the bags and . But also, every adhesion set has to be mapped to another adhesion set in such a way that the corresponding bijection (between the adhesion sets) extends to an isomorphism from to . In order to solve this problem we first consider the case in which the adhesion sets are all distinct and define the following abstraction.

An instance of coset-hypergraph-isomorphism is a tuple