Linear Algebra and its Applications 432 (2010) 2373–2380
Contents lists available at ScienceDirect
Linear Algebra and its Applications
journal homepage: www.elsevier.com/locate/laa
On the power of combinatorial and spectral invariants
Martin Fürer
1,2
CSE, Pennsylvania State University, University Park, PA 16802, USA
A R T I C L E
I N F O
Article history:
Received 1 May 2009
Accepted 5 July 2009
Available online 15 August 2009
Submitted by I. Gutman
Keywords:
Edge coloring
2-dim W–L
Spectral properties
Starlike trees
A B S T R A C T
We extend the traditional spectral invariants (spectrum and angles)
by a stronger polynomial time computable graph invariant based
on the angles between projections of standard basis vectors into
the eigenspaces (in addition to the usual angles between standard
basis vectors and eigenspaces). The exact power of the new invariant
is still an open problem. We also define combinatorial invariants
based on standard graph isomorphism heuristics and compare their
strengths with the spectral invariants. In particular, we show that
a simple edge coloring invariant is at least as powerful as all these
spectral invariants.
© 2009 Elsevier Inc. All rights reserved.
1. Introduction
The main purpose of this paper is to bring together related results and problems from two separate
areas, namely spectral graph theory and complexity theory related to the graph isomorphism problem.
In spectral graph theory, most often properties of graphs determined by their spectra are studied.
For a little over two decades, in addition to eigenvalues and their multiplicities also angles between
standard unit vectors and eigenspaces have been taken into consideration. Here we propose to include
further spectral invariants defined by the angles between projections of different standard unit vectors
into the eigenspaces.
One branch of complexity theory for the graph isomorphism problem has looked at the computational power of various combinatorial methods to identify graphs up to isomorphism. It seems that
most combinatorial methods (except those dealing with planar graphs and graphs of bounded genus)
E-mail address:
[email protected]
URL: http://www.cse.psu.edu/∼furer
1
Research supported in part by NSF Grant CCF-0728921.
2
Visiting: ALGO, EPFL, CH-1015 Lausanne, Switzerland, and Mathematik, Universität Zürich, CH-8057 Zürich, Switzerland.
0024-3795/$ - see front matter © 2009 Elsevier Inc. All rights reserved.
doi:10.1016/j.laa.2009.07.019
2374
M. Fürer / Linear Algebra and its Applications 432 (2010) 2373–2380
are covered by vertex coloring,3 edge coloring, and their generalization, the k-dim W–L algorithm (see
[6]).
Many interesting ideas of Weisfeiler and Lehman that prepared the ground for the W–L algorithm
already appeared in Weisfeiler’s lecture notes [16].
Here, coloring refers to special vertex and edge classifications where vertices or edges obtain different colors when they are recognized as having different properties. Even though, these combinatorial
methods are known to be less powerful [6] than group theoretic methods (which can identify graphs of
bounded degree [13,5,9] in polynomial time), they are interesting, as they are very efficient for typical
graphs [2,4].
The main connection between spectral graph theory and graph isomorphism testing has been
established by the polynomial time isomorphism test for graphs of bounded eigenvalue multiplicity
[3] and the replacement of numerical approximations in this algorithm by combinatorial methods [10].
In Section 2, we introduce several spectral and combinatorial invariants. They are as powerful as
almost all polynomial time computable invariants that have been studied before. In Section 3, we
discuss the strengths of combinatorial invariants for identifying trees, random graphs and arbitrary
graphs. We also review results on the power of spectral invariants to identify various classes of trees,
and we formulate the main conjecture about the strength of the more powerful spectral invariants.
In Section 4, we compare the two types of invariants, showing the main result that edge coloring is
at least as powerful as the strongest of our spectral invariants. We end with concluding remarks in
Section 5.
2. Invariants
2.1. Basics
A graph invariant is a function i defined on the set of graphs whose value only depends on the
isomorphism type of a graph, i.e., i(G) = i(G′ ) whenever G is isomorphic to G′ . All combinatorial
invariants considered in this paper are computable in polynomial time, while the spectral invariants
can be approximated up to an absolute error of 2−s in time polynomial in s and the size of the graph.
Definition 2.1. An invariant i identifies a graph G in a class of graphs G if G ∈ G and for every G′ ∈ G ,
i(G) = i(G′ ) only if G′ is isomorphic to G.
An invariant i identifies a class of graphs G if it identifies G in G for every G ∈ G .
An invariant i identifies a graph G or a class of graphs G if it identifies them in the class of all graphs.
Definition 2.2. An invariant i is stronger (or more powerful) than an invariant i′ (for a class of graphs
G ) if i(G) = i(G′ ) implies i′ (G) = i′ (G′ ) for all graphs G, G′ (in G ).
2.2. Combinatorial invariants
We consider two types of combinatorial invariants obtained by vertex classification [14] and edge
classification, usually referred to as vertex coloring and edge coloring. We stress once more that having
equal color here just means that the corresponding objects are from the same part in the partition
defined by the classification.
For the colors, we use an initial segment of the natural numbers. The standard vertex coloring
algorithm starts at time t = 1 with every vertex colored by its degree. Equivalently, we could have
started at time 0 with all vertices having color 0. At time t + 1 every vertex is labeled with the pair
consisting of its own (previous) color and the multiset of colors of its neighbors. Multisets are sets
with multiplicities for their elements. Multisets of colors are encoded as sequences of colors listed
in increasing order (with repetitions allowed). The labels are then enumerated lexicographically. The
order number is the new color at time t + 1. The algorithm stops when no colors change from some
time t to t + 1, i.e., when the color partition has stabilized at time t̄ = t.
3
Coloring in this context has nothing to do with the usual graph coloring requiring different colors for adjacent vertices.
M. Fürer / Linear Algebra and its Applications 432 (2010) 2373–2380
2375
As each step produces a finer partition of the vertices, t̄ < n = |V |, and the algorithm stops at time
n or earlier. Vertices with different colors have different properties.
Definition 2.3. The vertex coloring invariant IV (G) of a graph G is the sequence of color definitions of
the standard vertex coloring algorithm for times t = 1, 2, . . . , t̄ together with the multiset of colors
used at time t̄.
The standard edge coloring algorithm colors the complete directed graph on the vertex set V of the
given (undirected) graph G = (V , E ). We assume, the complete directed graph includes self-loops in all
vertices. At time 0, there are 3 edge colors. Non-edges (i.e., pairs (u, v) with {u, v} ∈
/ E and u =
/ v) have
color 0, edges (i.e., pairs (u, v) with {u, v} ∈ E) have color 1, and loops (i.e., pairs (v, v)) have color 2.
At time t + 1, every edge (u, v) is labeled with the multiset of pairs of (previous) colors of the walks of
length 2 from u to v. (The previous color of (u, v) shows up in the walks (u, u), (u, v) and (u, v), (v, v).)
As with vertex coloring, the labels are then enumerated lexicographically. The order number is the
new color at time t + 1. The algorithm stops at time t̄ when the color partition has stabilized.
Edge coloring also colors vertices in a natural way. The color of the loop (v, v) is viewed as the color
of the vertex v. Trivially, the vertex partition produced by standard edge coloring is always at least as
fine as that produced by standard vertex coloring.
Definition 2.4. W.l.o.g., assume V = {1, . . . , n}. Let c(u,v) be the (stable) color of (u, v) at time t̄ and cu =
multiset(c(u,1) , . . . , c(u,n) ). The edge coloring invariant IE (G) of a graph G is the sequence of color definitions of the standard edge coloring algorithm for times t = 1, 2, . . . , t̄ together with multiset(c1 , . . . , cn ).
Remark. The second part of the definition could be deleted, as it is actually determined by the sequence
of color definitions.
2.3. Spectral invariants
Let µ1 > · · · > µm be the eigenvalues of the adjacency matrix of a graph G with multiplicities
mult(µ1 ), . . . , mult(µm ) and eigenspaces E(µ1 ), . . . , E(µm ). The traditional spectral invariants are
the spectrum
µ1
µ2
...
µm
Spec G =
mult(µ1 ) mult(µ2 ) . . . mult(µm )
and the cosines of angles between the standard basis vectors and the eigenspaces, usually just called
the angles (see [7]).
In addition, we suggest to use some more powerful spectral invariants based on the angles between
projections of pairs of standard basis vectors into the eigenspaces.
Let
m
µk P (k)
A=
k =1
be the spectral decomposition of the adjacency matrix A, meaning that the symmetric matrix P (k)
describes the projection into the eigenspace E(µk ). Denote
⎛
⎞
(k )
(k )
.
.
.
p1n
p11
⎜
⎟
⎜ .
.. ⎟
⎟.
P (k) = ⎜ ..
.
⎝
⎠
(k )
(k )
pn1
. . . pnn
The sequence of square roots of diagonal elements
(k )
p11 ,
(k )
p22 , , . . . ,
(k )
pnn
is known as the kth eigenvalue angle sequence.
2376
M. Fürer / Linear Algebra and its Applications 432 (2010) 2373–2380
We also use the other entries of the projection matrices, which determine the angles between pairs
of projections.
The square root of the ith diagonal entry
(k)
αki = pii = cos ∡(ei , E(µk ))
is the cosine of the angle βki between the ith standard basis vector ei and the eigenspace E(µk ), while
(k )
pij
(k) (k)
= cos ∡ P (k) ei , P (k) ej
pii pjj
is the cosine of the angle between the projections of the ith and jth standard basis vectors ei and ej
into the eigenspace E(µk ).
Proposition 2.1. Every graph G is determined by its spectrum together with its projection matrices P (k) (k
1, . . . , m).
Proof. The spectral decomposition of the adjacency matrix A
spectral information.
=
m
k=1 µk P
=
(k) expresses A in terms of
The projection matrices are not graph invariants as they depend on the arbitrary enumeration of the
vertices. We obtain an invariant by replacing sequences by multisets, which themselves are encoded
by lexicographically sorted sequences.
The eigenspaces are canonically defined by the decreasing order of their real eigenvalues. Thus we
(1)
(m)
can start with the matrix whose ij entry is the vector pij , . . . , pij
. But then, we form multisets
from the entries of each row, and finally consider the multiset of rows. In addition, for each row we
want to retain the value of its diagonal element. We also define a possibly stronger invariant, where
every matrix entry remembers the diagonal element in its column.
(1)
(m)
and Pi = (pii , multiset(pi1 , . . . , pin )). The weak spectral inDefinition 2.5. Let pij = pij , . . . , pij
variant of G is defined as
IS (G)
= (Spec G, multiset(P1 , . . . , Pn )).
(1)
( m)
(1)
( m)
Let p∗ij = ((pij , . . . , pij ), (pjj , . . . , pjj
invariant of G is defined as
IS∗ (G)
)) and Pi∗ = (pii , multiset(p∗i1 , . . . , p∗in )). The strong spectral
= (Spec G, multiset(P1∗ , . . . , Pn∗ )).
3. The strengths of the combinatorial and spectral invariants
We summarize some known results about the strengths of the combinatorial as well as about the
strengths of the spectral invariants, and we formulate a conjecture.
3.1. The strengths of the combinatorial invariants
Here we investigate the power of combinatorial invariants to identify arbitrary trees, random
graphs, and arbitrary graphs.
Proposition 3.1 [1]. Vertex coloring identifies all rooted trees.
The same result holds for trees without a distinguished root, because every tree has 1 or 2 centers
that can be selected as roots. As a consequence, IV (G) identifies all trees.
We use the Gn random graph model, where V = {1, 2, . . . , n} and every edge {u, v} is present with
probability 1/2 independent of the presence of other edges.
M. Fürer / Linear Algebra and its Applications 432 (2010) 2373–2380
2377
Fig. 1. A pair of graphs agreeing on eigenvalues and angles [15].
The invariant IV (G) identifies almost all graphs, i.e., the fraction of identified n-vertex graphs
converges to 1 as n goes to infinity. The following theorem has shown that not even the full power of
vertex classification is needed for this result.
Theorem 3.2 [2]. Let G be a random graph with n vertices. For sufficiently large n, with probability greater
than 1 − n−1/7 the r = ⌊3 log2 n⌋ vertices with the largest degrees in G all have distinct degrees, and all
the other vertices have a unique set of neighbors among these r vertices.
In an extension of this result, it has been shown, that a canonical labeling of the vertices can actually
be computed in expected linear time [4], i.e., time O(n2 ) for random graphs with n vertices. A canonical
labeling defines an enumeration of the vertices of all graphs with the following property. If two graphs
G1 , G2 are isomorphic, then the unique labeling respecting mapping from G1 to G2 is an isomorphism.
Even for the much more difficult case of random regular graphs, a canonical labeling of the vertices
can be computed in expected linear time [11]. Kucera’s analysis implies that IE (G) identifies almost
all regular graphs.
Regular graphs are an obvious example to show that IE (G) is strictly more powerful than IV (G).
A simple example is G1 consisting of two disjoint 3-cycles and G2 being a 6-cycle. If examples with
connected graphs are desired, one could add an additional vertex to each of these graphs that is
connected to all vertices.
Pairs of non-isomorphic strongly regular graphs with identical parameters are obvious examples
showing that IE (G) is not sufficiently powerful to identify all graphs.
It is natural to generalize vertex coloring and edge coloring to arbitrary k-tuple coloring. The k-tuple
coloring algorithm is known as the k-dim W–L (Weisfeiler–Lehman) algorithm [16]. It turned out that
even the power of the k-dim W–L algorithm is surprisingly limited. In order to identify all degree 3
graphs with n vertices, k has to be chosen of order n [6].
3.2. The strengths of the spectral invariants
Recent results have investigated the power of spectral properties to identify trees. Starlike trees
(containing only one large vertex of degree more than 2) are identified by their spectra [12]. Double
and triple starlike trees (with 2 or 3 large vertices) are still identified by their eigenvalues and angles
(between standard basis vectors and eigenspaces) [15]. On the other hand, most trees have a cospectral
mate with the same angles [8], and even some trees with only four large nodes have cospectral mates
with the same angles. The smallest such pair is shown in Fig. 1 [15]. Nevertheless, it is not hard to see
and probably typical that these trees are easily distinguished by additional spectral information.
Conjecture. The weak spectral invariant IS (G) identifies all trees.
4. Relations between the strengths of the combinatorial and spectral invariants
We show the main result about the strength of the edge coloring invariant compared to the strengths
of our spectral invariants. As much is still unknown, we state some open problems. We start with the
2378
M. Fürer / Linear Algebra and its Applications 432 (2010) 2373–2380
fact that the strengths of the combinatorial invariant IV (G) and the spectrum with angles invariant
are incomparable.
Proposition 4.1. There are pairs of graphs distinguished by their spectra, but not by the vertex color
invariant IV (G).
Proof. We can reuse our simple example with G1 consisting of two triangles and G2 being a 6-cycle.
Their spectra are
2 1 −1 −2
2 −1
Spec G1 =
.
and Spec G2 =
2
4
1 2
2
1
Again, if connected graphs are desired, then one can add a new vertex connected to all 6 given
vertices.
Proposition 4.2. There are pairs of graphs distinguished by the vertex color invariant IV (G), but not by
their spectra and angles (between the standard basis vectors and the eigenspaces).
Proof. By Theorem 3.1 all trees are identified by vertex coloring, but there are cospectral trees with
the same angle sequence [15].
We now consider the combinatorial invariant IE (G). We will show that it is at least as strong as any
of our spectral invariants. This is the main result of this paper. Initially such results have been used [10]
to avoid numerical approximations in the polynomial time isomorphism test for graphs of bounded
eigenvalue multiplicities [3].
(k)
(k )
Theorem 4.3 [10]. If there is an eigenspace E(µk ) such that puv =
/ pu′ v′ , i.e., the angle between the
projections of the standard basis vectors eu and ev into E(µk ) is different from the angle between the
projections of the standard basis vectors eu′ and ev′ into E(µk ), then in any stable edge coloring, the edges
(u, v) and (u′ , v′ ) have different colors.
Proposition 4.4 (p. 80 of [7]).
n
(k)
pii
i=1
=
n
αki2 = dim E(µk ).
i =1
Theorem 4.5. If G and G′ agree in the combinatorial edge coloring invariant, i.e., IE (G)
and G′ have the same spectrum.
= IE (G′ ), then G
Proof. Assume the edge coloring algorithm has been applied to G = (V , E ) and G′ = (V ′ , E ′ ), but G
and G′ are not distinguished by the combinatorial invariant IE . Let µ be any eigenvalue and g ∈ E (µ)
a corresponding eigenvector. We view the eigenvectors as functions g : V → R. Let u ∈ V be a fixed
vertex with g (u) =
/ 0. We define a vertex coloring Cu of V obtained from the standard edge coloring
by Cu (v) = c(u,v) .
We show that Cu is a stable vertex coloring (and therefore a refinement of the standard vertex
coloring). Let v ∈ V be an arbitrary vertex. The color c(u,v) determines the number of neighbors w of v
with c(u,w) being any given color. Therefore, all vertices v with equal color Cu (v) have the same number
of neighbors w of any given color Cu (w) = c(u,w) .
Define ḡ (v) to be the average of g (w) over all vertices w with Cu′ (w) = CV (v). It is not hard to see
that with g also ḡ is an eigenvector to µ. Note that ḡ (u) = g (u) =
/ 0 for the distinguished vertex u.
On G′ , we choose u′ ∈ V ′ with c(u′ ,u′ ) = c(u,u) and define Cu′ (v′ ) = c(u′ ,v′ ) for all v′ ∈ V ′ . The assumption IE (G) = IE (G′ ) implies that G and G′ have the same number of vertices of each color, i.e.,
there is a color respecting bijective function f : V → V ′ . As the edge colorings are stable, every vertex
2379
M. Fürer / Linear Algebra and its Applications 432 (2010) 2373–2380
v has the same number of neighbors of any given color as the vertex f (v). Now ḡ ′ defined by ḡ ′ = ḡf −1
is an eigenvector of G′ to the eigenvalue µ.
By Theorem 4.3, G and G′ have the same angles, and thus by Proposition 4.4, the multiplicity of
every eigenvalue µk in G is equal to the multiplicity of µk in G′ . Hence, the spectrum of G is equal to
the spectrum of G′ .
Theorem 4.6. The combinatorial invariant IE (G) is at least as strong as the weak spectral invariant IS (G).
Proof. Assume, the color definitions are given. Then in the following list, each item determines its
successor.
(a)
(b)
(c)
(d)
IE (G)
multiset(c1 , . . . , cn ), where cu = multiset(c(u,1) , . . . , c(u,n) ) for all u
multiset(c1′ , . . . , cn′ ), where cu′ = (c(u,u) , multiset(c(u,1) , . . . , c(u,n) )) for all u
multiset(P1 , . . . , Pn ), where Pu = (puu , multiset(pu1 , . . . , pun )) for all u
The implication (a) ⇒ (b) follows directly from Definition 2.4, while the implication (b) ⇒ (c ) is
based on the fact that for any stable edge coloring, the color c(u,u) of the loop at u is determined by
each of the colors c(u,v) .
Now we show the final implication (c ) ⇒ (d). By Theorem 4.3, for every u and v, the edge color
(k)
c(u,v) produced by the standard edge coloring algorithm determines the values of puv for all k and thus
puv . Therefore, for all u, cu = multiset(c(u,1) , . . . , c(u,n) ) determines multiset(pu1 , . . . , pun ). Hence, cu′
determines Pu , and multiset(c1′ , . . . , cn′ ) determines multiset(P1 , . . . , Pn ).
We already know from Theorem 4.5, that IE (G) also determines the spectrum of G. Hence, IE (G)
determines IS (G) proving the theorem.
Theorem 4.7. The combinatorial invariant IE (G) is at least as strong as the strong spectral invariant IS∗ (G).
Proof. Notice that for given color definitions, the color c(u,v) of an edge (u, v) determines the color
c(v,v) of the loop at v. Hence, in item (d) of the previous proof, every p(u,v) can be replaced by p∗(u,v) and
every Pu by Pu∗ .
Open Problem. What is the relationship between the strengths of the weak spectral invariant IS (G),
the strong spectral invariant IS∗ (G), and the combinatorial edge coloring invariant IE (G)?
Trivially, the strong spectral invariant IS∗ (G) is at least as powerful as the weak spectral invariant
IS (G), and we know now that the combinatorial invariant IE (G) is at least as powerful as these spectral
invariants. It is not clear which relations are strict. The author tends to believe that the strong spectral
invariant IS∗ (G) is strictly more powerful than the weak spectral invariant IS (G), but the strong spectral
invariant IS∗ (G) might be as strong as the combinatorial invariant IE (G).
5. Conclusion
Having shown that even for the new spectral invariants, there is a stronger combinatorial invariant,
does not diminish the interest in determining the power of spectral invariants. It would be interesting
to know what kind of graphs they can identify, in particular whether they can identify trees. It would
also be good to know whether spectral invariants are strictly weaker than the edge coloring invariant.
More general, there is the intriguing question of what kind of graph properties are implied by
certain patterns of angles between standard basis vectors and eigenspaces and between projections
of different standard basis vectors.
2380
M. Fürer / Linear Algebra and its Applications 432 (2010) 2373–2380
References
[1] Alfred V. Aho, John E. Hopcroft, Jeffrey D. Ullman, The Design and Analysis of Computer Algorithms, Addison-Wesley,
Reading, MA, 1974.
[2] László Babai, Paul Erdős, Stanley M. Selkow, Random graph isomorphism, SIAM J. Comput. 9 (3) (1980) 628–635.
[3] László Babai, D.Yu. Grigoryev, David M. Mount, Isomorphism of graphs with bounded eigenvalue multiplicity, in:
Proceedings of the 14th Annual ACM Symposium on Theory of Computing (STOC), 1982, pp. 310–324.
[4] László Babai, Luděk Kučera, Graph canonization in linear average time, in: Proceedings of the 20th Annual Symposium on
Foundations of Computer Science (FOCS), IEEE Computer Society Press, 1979, pp. 39–46.
[5] László Babai, Eugene M. Luks, Canonical labeling of graphs, in: Proceedings of the 15th Annual ACM Symposium on Theory
of Computing (STOC), 1983, pp. 171–183.
[6] Jin-Yi Cai, Martin Fürer, Neil Immerman, An optimal lower bound on the number of variables for graph identification,
Combinatorica 12 (4) (1992) 389–410.
[7] Dragoš Cvetković, Peter Rowlinson, Slobodan Simić, Eigenspaces of graphs, Encyclopedia of Mathematics and its
Applications, Cambridge University Press, 1997.
[8] Dragoš Cvetković, Constructing trees with given eigenvalues and angles, Linear Algebra Appl. 105 (1988) 1–8.
[9] Martin Fürer, Walter Schnyder, Ernst Specker, Normal forms for trivalent graphs and graphs of bounded valence, in:
Proceedings of the 15th Annual ACM Symposium on Theory of Computing (STOC), 1983, pp. 161–170.
[10] Martin Fürer, Graph isomorphism testing without numerics for graphs of bounded eigenvalue multiplicity, in: Proceedings
of the 6th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 1995, pp. 624–631.
[11] Luděk Kučera, Canonical labeling of regular graphs in linear average time, in: Proceediings of the 28th Annual Symposium
on Foundations of Computer Science (FOCS), IEEE Computer Society Press, 1987, pp. 271–279.
[12] Mirko Lepović, Ivan Gutman, No starlike trees are cospectral, Discrete Math. 242 (1–3) (2002) 291–295.
[13] Eugene M. Luks, Isomorphism of graphs of bounded valence can be tested in polynomial time, J. Comput. System Sci. 25
(1982) 42–65.
[14] Ronald C. Read, Derek G. Corneil, The graph isomorphism disease, J. Graph Theory 1 (4) (1977) 339–363.
[15] Dragan Stevanović, Vladimir Brankov, Some trees characterized by eigenvalues and angles, Publ. Inst. Math. (Beograd)
(N.S.) 79 (93) (2006) 19–27.
[16] Boris Weisfeiler (Ed.), On construction and identification of graphs, Lecture Notes in Mathematics, vol. 558, Springer-Verlag,
Berlin, 1976 (with contributions by A. Lehman, G.M. Adelson-Velsky, V. Arlazarov, I. Faragev, A. Uskov, I. Zuev, M. Rosenfeld,
B. Weisfeiler.