Journal Article

Continuous optimization methods for the graph isomorphism problem Open Access

Information and Inference: A Journal of the IMA, Volume 14, Issue 2, June 2025, iaaf011, https://doi.org/10.1093/imaiai/iaaf011
Published:
16 April 2025
Article history
Received:
10 January 2024
Revision received:
29 January 2025
Accepted:
17 March 2025
Published:
16 April 2025

Abstract

The graph isomorphism problem looks deceptively simple, but although polynomial-time algorithms exist for certain types of graphs such as planar graphs and graphs with bounded degree or eigenvalue multiplicity, its complexity class is still unknown. Information about potential isomorphisms between two graphs is contained in the eigenvalues and eigenvectors of their adjacency matrices. However, symmetries of graphs often lead to repeated eigenvalues, so that associated eigenvectors are determined only up to basis rotations, which complicates graph isomorphism testing. We consider orthogonal and doubly stochastic relaxations of the graph isomorphism problem, analyze the geometric properties of the resulting solution spaces, and show that their complexity increases significantly if repeated eigenvalues exist. By restricting the search space to suitable subspaces, we derive an efficient Frank–Wolfe based continuous optimization approach for detecting isomorphisms. We illustrate the efficacy of the algorithm with the aid of various highly symmetric graphs.

1. Introduction

Graphs and networks play a central role in many applications ranging from computer science, engineering, chemistry, and biology to the social sciences. Determining whether or not two graphs are isomorphic, i.e., have exactly the same structure, is called the graph isomorphism problem [1–3]. It has been shown that the problem can be solved in polynomial time if the graphs are planar [4] or have bounded degree [5] or eigenvalue multiplicity [6]. Furthermore, Babai recently proved that the graph isomorphism problem is solvable in quasi-polynomial time [7] and summarizes its current status in [3] as ‘not expected to be NP-complete, yet not known to be solvable in polynomial time.’ A historical perspective and a concise overview of different techniques for solving the graph isomorphism problem can be found in [8].

It is well-known that spectral properties of graphs contain crucial information about potential isomorphisms. If the graphs have distinct eigenvalues, then checking whether a permutation exists that transforms the eigenvectors of one graph into the eigenvectors of the other graph is already sufficient. Repeated eigenvalues, however, complicate graph isomorphism testing since the eigenvectors are then only determined up to basis rotations and it is not possible anymore to directly compare their entries. The graph isomorphism problem can be regarded as a combinatorial optimization problem, which requires minimizing a cost function over the set of all permutation matrices. Different relaxations of the graph isomorphism problem have been proposed in the past, where the set of permutation matrices is either replaced by the set of orthogonal [9–11] or doubly stochastic [12–15] matrices. The applicability of such relaxations, however, is not well understood [13]. It has been shown in [13] that the convex relaxation is guaranteed to find the exact isomorphism, provided that the graphs are asymmetric and friendly. This has been generalized to asymmetric graphs with unfriendly eigenvectors that have certain sparsity patterns in [14]. The convex relaxation is called convex exact if it does not admit any additional solutions. For which types of symmetries the relaxation is (and in general is not) exact was analyzed in [15]. We extend these results and consider in particular potentially highly symmetric graphs. We first show how repeated eigenvalues increase the set of feasible solutions of the orthogonal and convex relaxations of the graph isomorphism problem, analyze the geometric properties of these spaces, and then propose an efficient algorithm for detecting graph isomorphisms using a concave reformulation of the relaxed optimization problem that penalizes non-binary matrices. Numerical results for a set of guiding examples and benchmark problems illustrate the efficacy of the proposed algorithm. A method that is similar in spirit is described in [12], where a convex–concave relaxation along with a path following approach is used to solve graph matching and quadratic assignment problems. It was recently shown in [16] that if the signal-to-noise ratio is sufficiently large, then the semidefinite relaxations of these problems are exact and recover the true solutions. We focus on the graph isomorphism problem, which allows us to exploit additional information encoded in the null spaces of associated matrices, and construct a direct approach to solve the resulting relaxed optimization problems.

2. The graph isomorphism problem

Let |$ A $| and |$ B $| be the adjacency matrices of two weighted undirected graphs formula and formula⁠, respectively, where formula and formula are the sets of vertices and formula and formula the sets of edges. We assume that formula⁠, i.e., the graphs share the same vertices. Our goal is to check if the two graphs are isomorphic.

 

Definition 2.1
(Isomorphic graphs).

Let |$ \mathcal{S}(n) $| denote the symmetric group of degree |$ n $| and |$ \mathcal{P}(n) $| the set of all |$ n \times n $| permutation matrices. The graphs formula and formula are called isomorphic if one of the two equivalent conditions is satisfied:

  • There exists a permutation |$ \pi \in \mathcal{S}(n), $| such that
    which preserves the edge weights.
  • There exists a permutation matrix |$ P \in \mathcal{P}(n), $| such that
    or, equivalently, |$ P \, A = B \, P $|⁠.

Given the permutation |$ \pi $|⁠, we can construct the permutation matrix |$ P $| and vice versa using

If formula and formula are isomorphic, we write formula and define

to be the set of all isomorphisms. An isomorphism from a graph formula to itself is called an automorphism and the set of automorphisms forms a group under composition (or matrix multiplication), which we will denote by formula⁠. Graphs with nontrivial automorphism groups are called symmetric. Examples of highly symmetric graphs are shown in Fig. 1, see also Example 4.18.

(a) Highly symmetric Petersen graph  with . (b) A strongly regular graph  with $ 10 $ vertices. Are the two graphs isomorphic?
Fig. 1.

(a) Highly symmetric Petersen graph formula with formula⁠. (b) A strongly regular graph formula with |$ 10 $| vertices. Are the two graphs isomorphic?

We can formulate the graph isomorphism problem as an optimization problem of the form

(1)

where |$ \left \lVert \cdot \right \rVert _{F} $| denotes the Frobenius norm, so that formula if and only if |$ c_{\mathcal{P}}^{} = 0 $|⁠. The solution of the optimization problem, however, is in general not unique if the graphs have symmetries. Since

minimizing the Frobenius norm in (1) is equivalent to maximizing the trace of |$ A^\top \, P^\top \, B \, P $|⁠, which illustrates that the graph isomorphism problem or, more generally, the graph matching problem is closely related to the quadratic assignment problem [17, 18]. In what follows, we will analyze different relaxations of the graph isomorphism problem.

3. Orthogonal relaxation

Let |$ I_{n} $| be the |$ n \times n $| identity matrix and let

denote the set of all orthogonal matrices, which forms a nonlinear disconnected manifold (since |$ \det (Q) = \pm 1 $|⁠). Instead of solving the combinatorial optimization problem (1), we now consider the relaxed problem

(2)

which is also known as the two-sided orthogonal Procrustes problem [19, 20].

 

Definition 3.1
(Eigendecomposition).
Given a symmetric matrix |$ A \in{\mathbb{R}}^{n \times n} $|⁠, let |$ A = U_{A} \, \varLambda _{A} \, U_{A}^\top $| be its eigendecomposition, where the columns of |$ U_{A} $| are the eigenvectors and |$ \varLambda _{A} $| is a diagonal matrix containing the eigenvalues sorted in non-increasing order. We define |$ \lambda _{A} = \big [ \lambda _{A}^{(1)}, \dots , \lambda _{A}^{(m)} \big ] $| to be the row vector containing the |$ m \le n $| unique eigenvalues sorted in decreasing order and |$ \mu _{A} = \big [ \mu _{A}^{(1)}, \dots , \mu _{A}^{(m)} \big ] $| to be the row vector containing the corresponding multiplicities. That is, it holds that
We then partition |$ U_{A} $| into

If |$ \lambda _{A}^{(k)} $| is a distinct eigenvalue, then |$ U_{A}^{(k)} $| is the associated eigenvector. If, on the other hand, |$ \lambda _{A}^{(k)} $| is a repeated eigenvalue, then the columns of |$ U_{A}^{(k)} $| form an orthogonal basis of the corresponding eigenspace. Repeated eigenvalues can be caused by symmetries of the graph. Assume that |$ \big (\lambda _{A}^{(k)}, u_{A}^{(k)}\big ) $| is an eigenvalue–eigenvector pair and let formula⁠, i.e., |$ P \, A = A \, P $|⁠, then

and |$ P \, u_{A}^{(k)} $| is also an eigenvector associated with |$ \lambda _{A}^{(k)} $|⁠. If these two eigenvectors are linearly independent, this implies that the eigenspace is at least two-dimensional. The larger the automorphism group, the higher the likelihood that the associated permuted eigenvectors are linearly independent. It was shown in [21, 22] that if all eigenvalues of a graph are distinct, then every non-trivial automorphism has order |$ 2 $|⁠. Nevertheless, repeated eigenvalues are not necessarily related to symmetries. The graph in Fig. 2(a), for example, is asymmetric but has repeated eigenvalues. Since it is in practice difficult to determine the size of the automorphism group, a related property called friendliness, which can be verified easily, was proposed in [13].

(a) Asymmetric unfriendly regular graph with repeated eigenvalues. (b) Asymmetric unfriendly regular Frucht graph with distinct eigenvalues.
Fig. 2.

(a) Asymmetric unfriendly regular graph with repeated eigenvalues. (b) Asymmetric unfriendly regular Frucht graph with distinct eigenvalues.

 

Definition 3.2
(Friendly eigenvectors).

An eigenvector |$ u_{A}^{(k)} $| is called friendly if formula⁠, where formula denotes the vector of all ones. Correspondingly, a graph formula (or its adjacency matrix |$ A $|⁠) is called friendly if all eigenvalues |$ \lambda _{A}^{(k)} $| are distinct and all eigenvectors are friendly.

Every friendly graph is automatically asymmetric as shown in [13]. The other direction, however, is not true. The Frucht graph [23] illustrated in Fig. 2(b), for instance, is asymmetric but not friendly, see also [14]. In fact, any asymmetric regular graph will be highly unfriendly since formula is an eigenvector and the remaining |$ n-1 $| eigenvectors are orthogonal to it. In [11], we defined a stronger property, which can sometimes be used to disambiguate the signs of unfriendly eigenvectors.

 

Definition 3.3
(Ambiguous eigenvectors).

We define an eigenvector |$ u_{A}^{(k)} $| to be ambiguous if there exists |$ P \in \mathcal{P}(n) $| with |$ u_{A}^{(k)} = -P u_{A}^{(k)} $|⁠, i.e., |$ u_{A}^{(k)} $| and |$ -u_{A}^{(k)} $| share the same entries. If all eigenvalues |$ \lambda _{A}^{(k)} $| are distinct and none of the associated eigenvectors are ambiguous, we call the graph formula  unambiguous.

This definition allows us to assign a canonical sign to unambiguous eigenvectors. An ambiguous eigenvector is automatically unfriendly since formula⁠, which implies formula⁠. The vector |$ u_{A}^{(k)} = [1, -2, 0, 1]^\top $|⁠, for instance, is unfriendly but not ambiguous.

 

Definition 3.4
(Isospectral graphs).

We call two symmetric matrices |$ A $| and |$ B $| and hence also the induced graphs formula and formula  isospectral if |$ \lambda _{A} = \lambda _{B} $| and |$ \mu _{A} = \mu _{B} $|⁠.

That is, isospectral graphs have the same eigenvalues and also their multiplicities are identical. Isomorphic graphs are clearly isospectral.

 

Theorem 3.5.
Assume that |$ A $| and |$ B $| are isospectral. Let |$ R \in{\mathbb{R}}^{n \times n} $| be a block diagonal matrix of the form
where |$ R^{(k)} \in \mathcal{O}\big (\mu _{A}^{(k)}\big ) $|⁠. Then
minimizes the cost function (2) and all minimizers are of this form.

 

Proof.
First, |$ Q^{*}(R) $| is a product of orthogonal matrices and hence orthogonal. We have
and since |$ A $| and |$ B $| are by definition isospectral also |$ R \, \varLambda _{A} = \varLambda _{B} R $|⁠. It follows that
That is, |$ Q^{*}(R) $| minimizes the cost function and |$ c_{\mathcal{O}}^{} = 0 $|⁠. To show that all minimizers must be of this form, assume now that |$ c_{\mathcal{O}}^{} = 0 $|⁠, then
i.e., the columns of |$ Q \, U_{A} $| are eigenvectors of |$ B $|⁠, which are determined up to basis rotations (in the corresponding eigenspaces). Writing
it follows that |$ \widetilde{U}_{B}^{(k)} = U_{B}^{(k)} \, R^{(k)} $|⁠, where |$ R^{(k)} \in \mathcal{O}\big (\mu _{A}^{(k)}\big ) $|⁠. Overall, this implies that |$ Q \, U_{A} = U_{B} \, R $| and thus |$ Q = U_{B} \, R \, U_{A}^\top $|⁠, where |$ R $| is an orthogonal block diagonal matrix.

Note that we did not explicitly use the orthogonality of the matrices |$ R^{(k)} $|⁠, which is only required so that |$ Q^{*}(R) $| remains orthogonal. A similar proof can be found in [24]. For a more detailed discussion of the equivariance properties of self-adjoint matrices, see also [25].

 

Remark 3.6.

We have to distinguish between different cases:

  • Assume that all eigenvalues of |$ A $| and |$ B $| are distinct, then |$ m = n $| and
    i.e., there exist |$ 2^{n} $| orthogonal matrices |$ Q^{*}(R) $| that minimize the relaxed cost function. This is the special case typically considered in the literature, see, e.g., [9, 19].
  • If the eigenvalues are not all distinct, then there are
    (continuous) degrees of freedom1 and the search space, i.e., the set of all minimizers of (2), is significantly more complex.

A simple way to check whether two graphs are potentially isomorphic is to first solve the orthogonal Procrustes problem (2). If |$ c_{\mathcal{O}}^{}> 0 $|⁠, the graphs cannot be isomorphic. However, if |$ c_{\mathcal{O}}^{} = 0 $|⁠, this only implies that the graphs are isospectral (since |$ A $| and |$ B $| are in this case similar) but not necessarily isomorphic (i.e., |$ c_{\mathcal{P}}^{} $| might still be greater than zero). The graph isomorphism problem can thus be reformulated as: does the set of feasible solutions |$ Q^{*}(R) $| contain at least one permutation matrix? Finding such a matrix, assuming the graphs are isomorphic, is a difficult nonlinear optimization problem. One potential way to obtain a valid solution of the graph isomorphism problem is to penalize orthogonal matrices that are not permutation matrices. This approach was used in [10] to solve the graph matching problem.

4. Doubly stochastic relaxation

We will now consider a different relaxation of the graph isomorphism problem. Let

be the set of doubly stochastic matrices, which is the convex hull of the set of all permutation matrices |$ \mathcal{P}(n) $|⁠. This is also known as Birkhoff’s theorem [26]. The doubly stochastic relaxation of the graph isomorphism problem is given by

(3)

We again have the property that the graphs cannot be isomorphic if |$ c_{\mathcal{D}}^{}> 0 $|⁠.

4.1 Solutions of the relaxed problem

The convex relaxation of the problem admits additional solutions as the following lemma shows.

 

Lemma 4.1.
Given two isomorphic graphs formula⁠. Let formula⁠, then any convex combination of the form
minimizes (3).

 

Proof.
A convex combination of doubly stochastic matrices is again doubly stochastic so that |$ X \in \mathcal{D}(n) $|⁠. We have
as required.

It is important to note here that all convex combinations of isomorphisms are solutions of the relaxed problem, but not all doubly stochastic matrices that minimize (3) are automatically convex combinations of isomorphisms as the following example shows.

 

Example 4.2.

As mentioned above, the automorphism group of the Frucht graph contains only the identity matrix, but formula is a solution of the relaxed problem. We will see that there is in fact an entire |$ 11 $|-dimensional affine subspace of feasible doubly stochastic solutions. |$\qquad\qquad\qquad\qquad\qquad \triangle $|

This is related to the aforementioned friendliness property, but most of the eigenvectors are in this case not ambiguous, so that we can eliminate spurious solutions as we will show below.

4.2 Vectorization of the problem

We now rewrite the optimization problem (3) as

(4)

using the cyclic property of the trace and the fact that |$ A $| and |$ B $| are symmetric. Note that here the first term and last term are not independent of |$ X $| as they are for the orthogonal relaxation since in general |$ X^\top X \ne I_{n} \ne X \, X^\top $|⁠.

 

Definition 4.3
(Vectorization).
Given a matrix |$ X \in{\mathbb{R}}^{n \times n} $|⁠, the corresponding vectorized matrix |$ x \in{\mathbb{R}}^{n^{2}} $| is defined by
where |$ X_{1}, \dots , X_{n} $| denote the columns of |$ X $|⁠.

 

Lemma 4.4.
Let |$ A, B, X \in{\mathbb{R}}^{n \times n} $|⁠, then
where |$ x = \mathrm{vec}(X) $| and |$ \otimes $| denotes the Kronecker product.

 

Proof.
We include the proof for the sake of completeness. The entries of |$ A \otimes B $| are by definition given by
whereas the entries of the vectorization of |$ X $|⁠, denoted by |$ x $|⁠, and |$ X $| itself are related by
These index mappings can be viewed as row- and column-major orderings, respectively. By combining the above relations, we obtain
which concludes the proof.

If |$ A $| is symmetric, we have |$ \operatorname{tr}(A \, X^\top B \, X) = x^\top (A \otimes B) \, x $|⁠. The row and column sum constraints can be reformulated as |$ C \, x = d $|⁠, with

and formula⁠, where |$ e_{i} \in{\mathbb{R}}^{n} $| denotes the |$ i $|th unit vector. This defines a |$ (2 \, n - 1) $|-dimensional affine subspace.

 

Lemma 4.5.
The optimization problem (3) can be written as
with
where again |$ x = \mathrm{vec}(X) $|⁠.

 

Proof.

The result follows immediately from Lemma 4.4 and the trace formulation (4).

This is a convex but in general not strictly convex optimization problem. In particular, all matrices |$ X $| defined in Lemma 4.1 are optimal solutions.

 

Theorem 4.6.

It holds that:

  • The matrix |$ H $| is symmetric and positive semi-definite.

  • Let |$ \lambda _{A}^{(i)} $| and |$ \lambda _{B}^{(j)} $| be eigenvalues of |$ A $| and |$ B $|⁠, respectively, and |$ u_{A}^{(i, \alpha )} $| and |$ u_{B}^{(j, \beta )} $| associated eigenvectors, where |$ 1 \le \alpha \le \mu _{A}^{(i)} $| and |$ 1 \le \beta \le \mu _{B}^{(j)} $|⁠, then
    is an eigenvalue of |$ H $| and the corresponding eigenvector is given by

 

Proof.

  • All three terms of |$ H $| are Kronecker products of symmetric matrices and thus also symmetric and so is their sum. The matrix |$ H $| is positive semi-definite since
    for all |$ x $|⁠. Alternatively, this also follows from (ii).
  • We have
    That is, all eigenvalues of |$ H $| are non-negative.

4.3 Isospectral graphs

If |$ A $| and |$ B $| are isospectral, Theorem 4.6 immediately implies that the rank of |$ H $| is at most |$ n (n-1) $| since at least |$ n $| of the eigenvalues of |$ H $| are zero. If the matrices are isospectral and also have repeated eigenvalues, the rank will be accordingly lower.

 

Corollary 4.7.
Assume that |$ A $| and |$ B $| are isospectral. Let |$ \lambda _{A} = \lambda _{B} $| be the eigenvalues with multiplicities |$ \mu _{A} = \mu _{B} $| (see Definition 3.1). Then
Furthermore, the null space of the matrix |$ H $| is given by

 

Proof.

For each |$ \lambda _{A}^{(k)} = \lambda _{B}^{(k)} $| there are |$ \mu _{A}^{(k)} = \mu _{B}^{(k)} $| linearly independent eigenvectors and hence |$ \big (\mu _{A}^{(k)}\big )^{2} $| possible combinations for which the associated eigenvalues of |$ H $| are zero. The corresponding eigenvectors span the null space of |$ H $|⁠. The result then follows from the rank–nullity theorem.

 

Example 4.8.
Assume that |$ \lambda _{A} = [2, 1, 0] = \lambda _{B} $| with multiplicities |$ \mu _{A} = [2, 1, 3] = \mu _{B} $|⁠, then the eigenvalues of |$ H $|⁠, written in matrix form, are given by
i.e., |$ \lambda _{H} = [4, 1, 0] $| with |$ \mu _{H} = [12, 10, 14] $|⁠. This is consistent with |$ \operatorname{rank}(H) = 36 - 4 - 1 - 9 = 22 $|⁠. |$\triangle $|

 

Lemma 4.9.

It holds that |$ x^\top H \, x = 0 $| if and only if |$ H \, x = 0 $|⁠.

 

Proof.
First, we write |$ H = U_{H} \, \varLambda _{H} U_{H}^\top $|⁠, where all eigenvalues of |$ H $| are nonnegative as shown in Theorem 4.6. Assume that
then formula and
The other direction is clear.

We can now interpret the relaxed graph isomorphism problem (3) as follows: Find a stochastic matrix |$ X, $| so that its vectorization |$ x $| is contained in the null space of |$ H $|⁠. This also shows that if the graphs have repeated eigenvalues, the search space is much larger since the dimension of the null space increases as shown in Corollary 4.7.

 

Theorem 4.10.
Assume that |$ A $| and |$ B $| are isospectral and let |$ S \in{\mathbb{R}}^{n \times n} $| be a block diagonal matrix of the form
where |$ S^{(k)} \in{\mathbb{R}}^{\mu _{A}^{(k)} \times \mu _{A}^{(k)}} $|⁠. Then
minimizes the cost function |$ \left \lVert X \, A - B \, X \right \rVert _{F}^{2} $| and all minimizers are of this form.

 

Proof.
The optimal vectors |$ x $| can be written as linear combinations of the vectors contained in the null space of |$ H $| and it holds that |$ u_{A}^{(k,\alpha )} \otimes u_{B}^{(k,\beta )} = \mathrm{vec}\left (u_{B}^{(k,\beta )} \boxtimes u_{A}^{(k,\alpha )} \right ) $|⁠, where |$ \boxtimes $| denotes the tensor product.2 The corresponding matrices |$ X $| can thus be written as linear combinations of the matrices |$ u_{B}^{(k,\beta )} \boxtimes u_{A}^{(k,\alpha )} $|⁠, where |$ 1 \le \alpha , \beta \le \mu _{A}^{(k)} $| and |$ k = 1, \dots , m $|⁠. We then have
which is indeed a linear combination of the matricized vectors spanning the null space. In fact,
and thus also the norm. Alternatively, we could reuse the proof of Theorem 3.5 (without requiring the matrices to be orthogonal), which then also implies that all minimizers must be of the above form.

The structure of the solutions is, as expected, similar to the one obtained for the orthogonal relaxation considered in Section 3. So far, we have not taken the constraint that |$ X $| must be doubly stochastic into account. Let

where |$ w_{A}^{(k)}, w_{B}^{(k)} \in{\mathbb{R}}^{\mu _{A}^{(k)}} $|⁠, then this requirement translates to

(5)

Condition (5) is closely related to the definition of friendliness, which requires that all entries of |$ w_{A} $| and |$ w_{B} $| are nonzero and that |$ S $| is a diagonal matrix. Additionally, solutions have to be non-negative, i.e.,

(6)

Matrices that satisfy (5) but not (6) are sometimes called pseudo-stochastic. Since |$ S $| is a block-diagonal matrix, we can decompose (5) into |$ m $| separate equations. This results in

(7)

If |$ S^{(k)} $| is an orthogonal matrix, then these equations are trivially satisfied (see also Section 3), but there are in general additional solutions. This is in particular the case if |$ w_{A}^{(k)} = w_{B}^{(k)} = 0 $|⁠.

 

Lemma 4.11.

Let |$ A $| and |$ B $| be isospectral and friendly. Then, the relaxed problem (3) has at most one solution with |$ c_{\mathcal{D}}^{} = 0 $|⁠.

 

Proof.

Since |$ A $| and |$ B $| are by definition friendly, all eigenvalues are distinct, which implies that |$ S^{(k)} \in{\mathbb{R}} $| for all |$ k $|⁠, and all |$ w_{A}^{(k)} $| and |$ w_{B}^{(k)} $| are non-zero. Thus, (7) can only be satisfied if |$ S^{(k)} = \pm 1 $| and the signs of |$ S^{(k)} $| are uniquely determined by (5). The equations have no solution if |$ \big | w_{A}^{(k)} \big | \ne \big | w_{B}^{(k)} \big | $| for at least one |$ k $|⁠.

If the unique optimal solution is a permutation matrix, then formula⁠. A similar result was also shown in [13]. Geometrically, this means that the affine subspace given by the constraints |$ C \, x = d $| and the null space of |$ H $| intersect in exactly one point |$ x \ge 0 $|⁠.

If |$ A $| and |$ B $| are isospectral but not friendly, then the intersection of the affine subspace defined by |$ C \, x = d $| and the null space of |$ H $| might again form an affine subspace. Let |$ x_{s} $| be one solution of the augmented inhomogeneous system of linear equations

$ \left [ \begin{smallmatrix} C \\ H \end{smallmatrix} \right ] x = \left [ \begin{smallmatrix} d \\ 0 \end{smallmatrix} \right ], $
then all vectors of the form |$ x = x_{s} + x_{h} $|⁠, where |$ x_{h} $| is contained in the null space of the augmented matrix, are pseudo-stochastic solutions. We have

since the dimension of the intersection of the two (affine) subspaces must be lower than the sum of their dimensions.

 

Example 4.12.

Let us consider the square graphs shown in Fig. 3. Depending on the edge weights, we obtain different types of symmetries, which are also reflected in the spectral properties of the graphs.

  • There are no symmetries and the automorphism group is trivial. All eigenvalues are distinct and all eigenvectors are friendly. We can easily determine the signs of the diagonal entries of |$ S $|⁠. Assume, for instance, that |$ w_{A} = [0.1, 0.3, -0.5, -1.9]^\top $| and |$ w_{B} = [-0.1, 0.3, 0.5, -1.9]^\top $|⁠, then |$ S = \operatorname{diag}(-1, 1, -1, 1) $| using (7). The null space of the augmented matrix contains only the zero vector and the solution is unique.

  • There are two automorphisms due to the reflection symmetry. The eigenvalues are distinct, but now only the first and third eigenvectors are friendly. Assume that |$ w_{A} = [2, 0, 0.2, 0]^\top $| and |$ w_{B} = [-2, 0, 0.2, 0]^\top $|⁠, then we have |$ S = \operatorname{diag}(-1, \pm 1, 1, \pm 1) $|⁠. However, only two combinations result in permutation matrices, the other two satisfy (5) but contain negative entries.

  • There now exist four automorphisms, but the eigenvalues are still distinct. Only the first eigenvector is friendly. Four of the eight possible combinations for |$ S $| result in permutations.

  • Due to the |$ D_{4} $| symmetry, there exist eight automorphisms. The eigenvalue |$ \lambda _{A}^{(2)} = 0 $| has multiplicity |$ \mu _{A}^{(2)} = 2 $|⁠. Now we cannot simply determine the sign structure of the matrix |$ S $| anymore since the block |$ S^{(2)} $| is a |$ 2 \times 2 $| matrix. |$\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\qquad \triangle $|

Isomorphic square graphs  (top) and  (bottom) with different edge weights and symmetries. The dotted red lines represent reflection symmetries.
Fig. 3.

Isomorphic square graphs formula (top) and formula (bottom) with different edge weights and symmetries. The dotted red lines represent reflection symmetries.

This illustrates again how symmetries and repeated eigenvalues complicate graph isomorphism testing since the solution space increases.

 

Example 4.13.

We have seen in Example 4.2 that there exists an 11-dimensional affine subspace of solutions due to the 11 unfriendly eigenvectors. However, only one of the eigenvectors of the Frucht graphs is ambiguous, so that we can still determine all but one of the signs of the diagonal matrix |$ S $|⁠. In the remaining one-dimensional space of feasible solutions, there exists just one non-negative matrix, which is the permutation matrix that solves the graph isomorphism problem. |$\qquad\qquad\qquad\qquad\qquad\triangle $|

By exploiting additional properties of the eigenvectors, we can in this case eliminate spurious solutions and obtain again a unique solution.

 

Example 4.14.
If we solve the relaxed optimization problem defined in Lemma 4.5 for the square graphs shown in Fig. 3(b), then we obtain, for example,
which is indeed a convex combination of the optimal permutation matrices |$ P_{1} $| and |$ P_{2} $|⁠, see Lemma 4.1. Any other convex combination of the two permutation matrices is also an optimal solution of the relaxed problem. The matrix |$ S $| is then in general not an orthogonal matrix, which it must be according to Section 3. |$\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad \triangle $|

4.4 Penalizing non-binary matrices

The question now is how we can penalize doubly stochastic matrices that are not permutation matrices. We use Lemma 4.9 to turn the cost function into a constraint and optimize a different function instead.

 

Lemma 4.15.
The optimization problem (3) penalizing non-binary matrices can be written as
where the first two constraints enforce the stochasticity of |$ X $| and the third constraint guarantees that |$ X \, A = B \, X $|⁠.

 

Proof.
This is a reformulation of the optimization problem from Lemma 4.5. Due to Lemma 4.9, we know that |$ H \, x = 0 $| implies |$ x^\top H \, x = 0 $|⁠, which in turn implies that |$ \left \lVert X \, A - B \, X \right \rVert = 0 $|⁠. For any doubly stochastic matrix |$ X $|⁠, we have
and equality holds if and only if |$ X \in \mathcal{P}(n) $|⁠. Furthermore,
using the Cauchy–Schwarz inequality3 for the columns of the matrix |$ X $| and equality holds if and only if formula⁠. That is, |$ 1 \le x^\top x \le n $| and minimizing |$ -x^\top x $| will force the solver to favour permutation matrices.

A similar penalty term was used in the convex-to-concave projection approach in [15]. Since formula is an eigenvector of any regular graph formula⁠, the matrix formula is of the form |$ X^{*}(S) $|⁠, where only the entry |$ S_{11} $| is nonzero. This solution does not contain any useful information about potential isomorphisms.

 

Remark 4.16.
As |$ X^{*}(S) = U_{B} \, S \, U_{A}^\top $|⁠, this yields
using the cyclic property of the trace and the orthogonality of the matrices |$ U_{A} $| and |$ U_{B} $|⁠. The trace is |$ n $| if and only if |$ S^\top S = I_{n} $|⁠, i.e., if |$ S $| is an orthogonal matrix. This is consistent with the derivations in Section 3. We could now also work directly in the space of |$ S $| matrices by rewriting the optimization problem defined in Lemma 4.15 as
with |$ N = \big [U_{A}^{(1)} \otimes U_{B}^{(1)}, \dots , U_{A}^{(m)} \otimes U_{B}^{(m)}\big ] $| and |$ x = N \, \sigma $|⁠. That is, the columns of |$ N $| form a basis of the null space of |$ H $|⁠, constructed from the normalized eigenvectors, and |$ \sigma $| is a reduced representation of the block matrix |$ S $|⁠, containing only the block diagonal entries.

4.5 Frank–Wolfe algorithm

In order to solve the optimization problem defined in Lemma 4.15, we use the Frank–Wolfe algorithm [27, 28], which for a constrained convex optimization problem of the form

defined on a convex set |$ \mathcal{C} $| consists of the following two steps:

  1. Given a feasible initial condition |$ x^{(k)} \in \mathcal{C} $|⁠, compute an optimal solution |$ y^{*} $| of the linear problem
  2. Define |$ x^{(k+1)} $| to be a convex combination of |$ x^{(k)} $| and |$ y^{*} $|⁠, i.e.,
    where |$ 0 \le \gamma \le 1 $| is chosen so that |$ f\big (x^{(k+1)}\big ) $| is minimized.

The cost function |$ f(x) = -x^\top x $| we seek to minimize is not convex but strictly concave and the global minima are permutation matrices. Since we are just interested in showing that at least one permutation matrix exists that solves the graph isomorphism problem, the non-uniqueness of the optimal global solution is not a problem. The gradient of the cost function is simply |$ \nabla f(x) = -2 \, x $| and, ignoring the constant factor 2, in each iteration of the Frank–Wolfe algorithm, we solve

to obtain a new solution |$ x^{(k+1)} $| as described above, where |$ x^{(0)} $| is the solution of the relaxed problem defined in Lemma 4.5 (if no solutions exist, then formula⁠). Since |$ x^{(k)} $| and |$ y^{*} $| are feasible solutions, the convex combination |$ x^{(k+1)} $| also satisfies the constraints. That is, the Frank–Wolfe algorithm is guaranteed to compute a doubly stochastic matrix whose vectorization is contained in the null space of |$ H $|⁠.

 

Example 4.17.

For illustration purposes, we consider again the simple square graphs shown in Fig. 3(b). In Example 4.14, we have seen that any convex combination of the optimal permutation matrices is also an optimal solution of the relaxed problem. Depending on the convex combination, the Frank–Wolfe algorithm converges to different solutions as shown in Fig. 4(a). Similarly, for the graphs shown in Fig. 3(c), any convex combination of the four optimal permutation matrices is an optimal solution of the relaxed problem. Depending on the initial condition, the Frank–Wolfe algorithm again converges after just one iteration to one of the four permutation matrices. This is shown in Fig. 4(b–c). |$\qquad\qquad\qquad \triangle $|

(a) Cost function for the graphs in Fig. 3(b) for different initial conditions. The two minima are the permutation matrices $ P_{1} $ and $ P_{2} $. The solver always converges to $ P_{1} $ (blue line) or $ P_{2} $ (red line) after just one iteration. (b) Cost function for the graphs in Fig. 3(c) for different convex combinations of the four optimal permutation matrices. The tetrahedron represents the parametrization of the convex set of solutions. The vertices are the permutation matrices and the minima of the cost function. All values are between $ -4 $ (blue) and $ -1 $ (red). (c) Convergence of the Frank–Wolfe algorithm to one of the four optimal solutions.
Fig. 4.

(a) Cost function for the graphs in Fig. 3(b) for different initial conditions. The two minima are the permutation matrices |$ P_{1} $| and |$ P_{2} $|⁠. The solver always converges to |$ P_{1} $| (blue line) or |$ P_{2} $| (red line) after just one iteration. (b) Cost function for the graphs in Fig. 3(c) for different convex combinations of the four optimal permutation matrices. The tetrahedron represents the parametrization of the convex set of solutions. The vertices are the permutation matrices and the minima of the cost function. All values are between |$ -4 $| (blue) and |$ -1 $| (red). (c) Convergence of the Frank–Wolfe algorithm to one of the four optimal solutions.

The results illustrate that the new cost function penalizes doubly stochastic matrices that are not permutation matrices and forces the Frank–Wolfe solver into the vertices of the convex set.

 

Example 4.18.
Let us analyze the two graphs shown in Fig. 1. We have |$ \lambda _{A} = [3, 1, -2] = \lambda _{B} $| with multiplicities |$ \mu _{A} = [1, 5, 4] = \mu _{B} $| and |$ \operatorname{rank}(H) = 58 $| by Corollary 4.7. The solution of the optimization problem defined in Lemma 4.5 is simply formula⁠, i.e., all entries are the same and we cannot extract any information about potential isomorphisms yet. However, after just one iteration of the Frank–Wolfe algorithm, we obtain the permutation
which is one of the 120 valid solutions and proves that the graphs are isomorphic. |$\qquad\qquad\qquad\qquad\triangle $|

Even for highly symmetric graphs the Frank–Wolfe algorithm is able to find one of the global minima of the cost function. In general, the solver will not converge after just one iteration. For the Frucht graph, for instance, see Example 4.2, the algorithm converges after two iterations, although the solution is in this case uniquely defined.

5. Numerical results

In this section, we will present numerical results for two challenging highly symmetric graphs.

5.1 Paley graph

We first consider the Paley graph [29] of size |$ n = 29 $| shown in Fig. 5(a), whose automorphism group contains |$ 406 $| permutations, see [30] for a detailed description of the automorphism groups of Paley graphs. The eigenvalues of the graph are |$ \lambda _{A} = \left [14, \frac{1}{2}\sqrt{29} - \frac{1}{2}, -\frac{1}{2}\sqrt{29} - \frac{1}{2}\right ] $| with multiplicities |$ \mu _{A} = [1, 14, 14] $|⁠. That is, |$ \operatorname{rank}(H) = 448 $|⁠, whereas |$ n^{2} = 841 $|⁠. Despite the many symmetries, the Frank–Wolfe solver quickly converges to a permutation matrix as shown in Fig. 5(b–e). The number of iterations depends on the random permutation we choose to generate formula⁠.

(a) Strongly regular Paley graph . The graph  is a random permutation of . (b–e) Convergence of the Frank–Wolfe solver to a permutation matrix. The initial matrix $ X^{(0)} $ is constant. The cost function first decreases only slowly, but then quickly converges to the optimal value. The matrix $ X^{(3)} $ is a valid solution of the graph isomorphism problem.
Fig. 5.

(a) Strongly regular Paley graph formula⁠. The graph formula is a random permutation of formula⁠. (b–e) Convergence of the Frank–Wolfe solver to a permutation matrix. The initial matrix |$ X^{(0)} $| is constant. The cost function first decreases only slowly, but then quickly converges to the optimal value. The matrix |$ X^{(3)} $| is a valid solution of the graph isomorphism problem.

5.2 Biggs–Smith graph

The automorphism group of the Biggs–Smith graph [32] of size |$ n = 102 $|⁠, see Fig. 6(a), contains 2448 elements. The adjacency matrix |$ A $| is shown in Fig. 6(b) and its spectrum in Fig. 6(c). The multiplicities of the eigenvalues are |$ \mu _{A} = [1, 9, 18, 16, 17, 16, 9, 16] $|⁠, which implies that |$ \operatorname{rank}(H) = 8860 $|⁠. The Frank–Wolfe solver converges after just one iteration to a permutation matrix as shown in Fig. 6(d–e).

(a) Visualization of the Biggs–Smith graph  using the layout from [31]. The graph  is again defined to be a random permutation of . (b) Adjacency matrix $ A $. (c) Spectrum of $ A $. (d–e) Convergence of the Frank–Wolfe solver to a permutation matrix after just one step. The initial matrix $ X^{(0)} $ is again constant.
Fig. 6.

(a) Visualization of the Biggs–Smith graph formula using the layout from [31]. The graph formula is again defined to be a random permutation of formula⁠. (b) Adjacency matrix |$ A $|⁠. (c) Spectrum of |$ A $|⁠. (d–e) Convergence of the Frank–Wolfe solver to a permutation matrix after just one step. The initial matrix |$ X^{(0)} $| is again constant.

6. Conclusion

The main advantage of the proposed approach is that the graph isomorphism problem is turned into a continuous optimization problem, which in general tend to be easier to solve than combinatorial optimization problems. Although orthogonal and doubly stochastic relaxations have been considered before, we extended these techniques to strongly regular graphs and showed how symmetries and repeated eigenvalues increase the dimensions of the spaces of feasible solutions. We believe that continuous relaxations will not only open new avenues for deriving efficient numerical algorithms for the graph isomorphism problem, but also for gaining insights into the geometric properties of the sets of feasible solutions and the inherent symmetries of graphs.

Although the Frank–Wolfe solver typically converges within a few iterations, the algorithm sometimes gets stuck in local minima, which are often convex combinations of just a few optimal permutation matrices. We also implemented SQP-based solvers, but they suffer from the same problem. Small random perturbations of the initial condition in a feasible direction seem to alleviate this problem. Also using different (i.e., more aggressive) penalty functions, adding barrier functions or continuation methods might help avoid local minima. A detailed analysis of the convergence properties and improved search-direction strategies are beyond the scope of this paper and will be considered in future work.

Further open problems include: How sensitive is the algorithm with respect to numerical errors and is it possible to develop sparse solvers? What is the worst-time complexity of the algorithm and for which types of graphs is the problem guaranteed to be solvable in polynomial time? Can we exploit properties of the orthogonal and convex relaxations at the same time? Another interesting question is whether this approach can be extended to the graph matching problem by including not only the vectors contained in the null space of |$ H $|⁠. The derived optimization problem formulation might also be amenable to quantum annealers, provided that the constrained problem can be rewritten as a quadratic unconstrained binary optimization problem.

Acknowledgements

We would like to thank the reviewers for the helpful comments and suggestions.

Funding

QuantERA II programme funded by the European Union’s Horizon 2020 research and innovation programme (Grant Agreement No. 101017733 to P.G.).

Data availability

The Matlab code and examples that support the findings presented in this paper are available at https://github.com/sklus/FrankWolfeGI.

Footnotes

1

The set |$ \mathcal{O}\big (\mu _{A}^{(k)}\big ) $| is a compact Lie group of dimension |$ \frac{\mu _{A}^{(k)} \big (\mu _{A}^{(k)} - 1\big )}{2} $|⁠.

2

The tensor product or outer product of two vectors |$ u, v \in{\mathbb{R}}^{n} $| is defined by |$ u \boxtimes v = u \, v^\top $|⁠. Note that |$ u \boxtimes v \in R^{n \times n} $|⁠, whereas |$ u \otimes v \in{\mathbb{R}}^{n^{2}} $|⁠. We have |$ u \otimes v = \mathrm{vec}(v \boxtimes u) $|⁠.

3

Note that formula⁠.

References

1.

Aflalo
,
Y.
,
Bronstein
,
A.
&
Kimmel
,
R.
(
2015
)
On convex relaxation of graph isomorphism
.
Proc. Natl. Acad. Sci.
,
112
,
2942
–
2947
.

2.

Babai
,
L.
(
2016
)
Graph isomorphism in quasipolynomial time
. In:
Proceedings of the Forty-Eighth Annual ACM Symposium on Theory of Computing, STOC ’16
. New York, USA: Association for Computing Machinery, pp.
684
–
697
. .

3.

Babai
,
L.
(
2019
)
Group, Graphs, Algorithms: The Graph Isomorphism Problem
, Proceedings of the International Congress of Mathematicians. World Scientific Publishing, pp.
3319
–
3336
. .

4.

Babai
,
L.
,
Grigoryev
,
D. Y.
&
Mount
,
D. M.
(
1982
)
Isomorphism of graphs with bounded eigenvalue multiplicity
. In:
Proceedings of the 14th Annual ACM Symposium on Theory of Computing
. New York, USA:
ACM
, pp.
310
–
324
.

5.

Biggs
,
N. L.
&
Smith
,
D. H.
(
1971
)
On trivalent graphs
.
Bull. Lond. Math. Soc.
,
3
,
155
–
158
. .

6.

Birkhoff
,
G.
(
1946
)
Tres observaciones sobre el álgebra lineal
.
Univ. Nacl. Tucumán, Ser. A
,
5
,
147
–
154
.

7.

Dellnitz
,
M.
,
Gebken
,
B.
,
Gerlach
,
R.
&
Klus
,
S.
(
2019
)
On the equivariance properties of self-adjoint matrices
.
Dyn. Syst.
,
35
,
197
–
215
. .

8.

Dym
,
N.
(
2018
)
Exact recovery with symmetries for the doubly stochastic relaxation
.
SIAM J. Appl. Algebra and Geometry
,
2
,
462
–
488
. .

9.

Fiori
,
M.
&
Sapiro
,
G.
(
2015
)
On spectral properties for graph matching and graph isomorphism problems
.
Inform. Infer.
,
4
,
63
–
76
.

10.

Frank
,
M.
&
Wolfe
,
P.
(
1956
)
An algorithm for quadratic programming
.
Naval Res. Logist. Q.
,
3
,
95
–
110
. .

11.

Frucht
,
R.
(
1939
)
Herstellung von Graphen mit vorgegebener abstrakter Gruppe
.
Compositio Math.
,
6
,
239
–
250
.

12.

Gower
,
J. C.
&
Dijksterhuis
,
G. B.
(
2004
)
Procrustes Problems. Number 30 in Oxford Statistical Science Series
.
Oxford University Press
.

13.

Grohe
,
M.
&
Schweitzer
,
P.
(
2020
)
The graph isomorphism problem
.
Commun. ACM
,
63
,
128
–
134
.

14.

Hopcroft
,
J. E.
&
Tarjan
,
R. E.
(
1972
)
Isomorphism of planar graphs
.
Complexity of Computer Computations
. (
R. E.
 
Miller
&
J. W.
 
Thatcher
eds).
Boston, MA
:
Springer US
, pp.
131
–
152
.

15.

Jaggi
,
M.
(
2013
)
Revisiting Frank–Wolfe: Projection-free sparse convex optimization
. In:
Proceedings of the 30th International Conference on Machine Learning
, vol.
28
. Atlanta, USA:
PMLR
, pp.
427
–
435
.

16.

Jones
,
G. A.
(
2020
)
Paley and the Paley graphs
. In:
Isomorphisms, Symmetry and Computations in Algebraic Graph Theory
. (G. A. Jones, I. Ponomarenko & J. Širáň eds).
Cham
:
Springer International Publishing
, pp.
155
–
183
.

17.

Klus
,
S.
&
Sahai
,
T.
(
2018
)
A spectral assignment approach for the graph isomorphism problem
.
Inform. Infer. J. IMA.
,
7
, 689–706. .

18.

Lawler
,
E. L.
(
1963
)
The quadratic assignment problem
.
Manage. Sci.
,
9
,
586
–
599
. .

19.

Leighton
,
F. T.
&
Miller
,
G. L.
(
1979
)
Certificates for graphs with distinct eigenvalues
.
Orginal manuscript
.

20.

Ling
,
S.
(
2024
)
On the exactness of SDP relaxation for quadratic assignment problem
.
arXiv:2408.05942
.

21.

Loiola
,
E. M.
,
Abreu
,
D.
,
Boaventura-Netto
,
P. O.
,
Hahn
,
P.
&
Querido
,
T.
(
2007
)
A survey for the quadratic assignment problem
.
Eur. J. Oper. Res.
,
176
,
657
–
690
. .

22.

Lovász
,
L.
(
2007
)
Eigenvalues of graphs.
 
Technical report
.
Budapest, Hungary
:
Eötvös Loránd University
.

23.

Luks
,
E. M.
(
1982
)
Isomorphism of graphs of bounded valence can be tested in polynomial time
.
J. Comput. System Sci.
,
25
,
42
–
65
.

24.

Mowshowitz
,
A.
(
1969
)
The group of a graph whose adjacency matrix has all distinct eigenvalues
. In:
Proof Techniques in Graph Theory
. (F. Harary ed).
New York
:
Academic Press
, pp.
109
–
110
.

25.

Paley
,
R. E. A. C.
(
1933
)
On orthogonal matrices
.
J. Math. Phys.
,
12
,
311
–
320
. .

26.

Read
,
R. C.
&
Corneil
,
D. G.
(
1977
)
The graph isomorphism disease
.
J. Graph Theory
,
1
,
339
–
363
. .

27.

Schönemann
,
P.
(
1968
)
On two-sided orthogonal Procrustes problems
.
Psychometrika
,
33
,
19
–
33
.

28.

Umeyama
,
S.
(
1988
)
An eigendecomposition approach to weighted graph matching problems
.
IEEE Trans. Patt. Anal. Mach. Intell.
,
10
,
695
–
703
. .

29.

Weisstein
,
E. W.
(
2023
)
Biggs-Smith graph
.
MathWorld-A Wolfram Web Resource
.

30.

Zaslavskiy
,
M.
,
Bach
,
F.
&
Vert
,
J.-P.
(
2009
)
A path following algorithm for the graph matching problem
.
IEEE Transactions on Pattern Analysis and Machine Intelligence
,
31
,
2227
–
2242
. .

31.

Zavlanos
,
M. M.
&
Pappas
,
G. J.
(
2008
)
A dynamical systems approach to weighted graph matching
.
Autom. J. IFAC
,
44
,
2817
–
2824
. .

32.

Zemlyachenko
,
V. N.
,
Korneenko
,
N. M.
&
Tyshkevich
,
R. I.
(
1985
)
Graph isomorphism problem
.
J. Sov. Math.
,
29
,
1426
–
1481
. .

This is an Open Access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted reuse, distribution, and reproduction in any medium, provided the original work is properly cited.