The Overgraphs of Generalized Cospectral Controllable Graphs

Two graphs are said to be generalized cospectral if they have the same characteristic polynomials and so do their complements. A graph is controllable if its walk matrix is nonsingular; equivalently, if all the eigenvalues of its adjacency matrix are simple and main. A graph H on (n+1) vertices is an overgraph of another graph G on n vertices if G is a vertex–deleted subgraph of H. We prove that no two distinct overgraphs of a controllable graph are generalized cospectral; this strengthens an earlier result that stated that no two such overgraphs are isomorphic. Moreover, we present methods that produce pairs of generalized cospectral graphs G′ and H ′ starting from a pair of generalized cospectral, non-isomorphic, controllable graphs G and H. We show that if G′ and H ′ are controllable, then they are non-isomorphic. Mathematics Subject Classifications: 05C50


Introduction
Only simple graphs are considered in this paper.Let G be a graph with vertex set V (G) = {1, 2, . . ., n}.Any two distinct vertices of G are joined by an edge in the complement G of G if and only if they are not joined by an edge in G. Two graphs G and H are isomorphic if there exists a one-to-one mapping σ : V (G) → V (H) such that any two vertices u and v are joined by an edge in G if and only if the vertices σ(u) and σ(v) are joined by an edge in H.
The adjacency matrix of a graph G, denoted by A G , is the n × n matrix where, for i, j = 1, 2, . . ., n, the entry in the i th row and the j th column is 1 if the vertices i and j are joined by an edge in G and is 0 otherwise.The characteristic polynomial φ(G, x) of G is the determinant of xI − A G , where I is the identity matrix.The n roots of φ(G, x), with possible repetitions, are the eigenvalues of G.The number of distinct eigenvalues of G is the electronic journal of combinatorics 26(1) (2019), #P1.14 denoted by s.The multiset spec(G) containing the n eigenvalues of G is the spectrum of G.The generalized spectrum of G is the ordered pair spec(G), spec(G) .The multiplicity of a particular eigenvalue of G is the number of times it is repeated as a root of φ(G, x).If this multiplicity is one, then the eigenvalue is simple.An eigenvector associated with the eigenvalue λ of G is a nonzero vector x that satisfies A G x = λx.Such an eigenvector is main if the sum of its entries is not zero.A main eigenvalue is an eigenvalue that has an associated main eigenvector.
Two graphs G and H are cospectral if φ(G, x) = φ(H, x).Moreover, they are said to be generalized cospectral if φ(G, x) = φ(H, x) and φ(G, x) = φ(H, x), that is, if G and H are cospectral and so are their complements G and H.We say that a graph G is determined by its (generalized) spectrum if, whenever G shares its (generalized) spectrum with another graph H, then G is isomorphic to H.
The study of graphs determined by their spectrum has several applications.One of them is the graph isomorphism problem, which is not known whether it is solvable in polynomial time or whether it is NP-complete.However, determining the spectrum of a graph is solvable in polynomial time, and clearly two graphs that have different generalized spectra are non-isomorphic.Unfortunately, the reverse is not true; in fact, there exist non-isomorphic pairs of graphs that are generalized cospectral.Indeed, using the new results of this paper, we generated hundreds of non-isomorphic, generalized cospectral graphs, starting from just one pair of cospectral graphs having cospectral complements.Other methods that produce pairs of cospectral graphs are Seidel switching [14,18] and Godsil-McKay switching [9].Further reasons for studying cospectral graphs and graphs determined by their spectrum include their applications in Hückel theory in chemistry [10] and determining structural information of graphs from their spectra [1].
A controllable graph is a graph whose eigenvalues are all simple and main.Before controllable graphs (on n vertices) were given their nomenclature, they featured in the paper [23] as the class of graphs G n .In [22,23], it was proved that certain subclasses of G n are determined by their generalized spectrum.Other references do not focus on controllable graphs but still describe classes of graphs that are determined by their spectrum; for a survey of results on such graphs, the reader is referred to [20,21].
The relatively recent discovery in [15] that almost all graphs are controllable has perhaps given more evidence for the conjecture in [20] that almost all graphs are determined by their generalized spectrum1 .This conjecture is also backed up by computer enumerations of graphs on up to 12 vertices [2].However, it is known that this conjecture is false for some classes of graphs, like trees [17] and strongly regular graphs [21].Hence, there are results in the literature which support this conjecture and others that seemingly oppose it.In this paper, we are 'on the fence' about this matter.On one hand, we show that the 2 n overgraphs of a controllable graph on n vertices have distinct generalized spectra, while on the other, we describe a method that produces numerous pairs of generalized cospectral graphs from a single pair of non-isomorphic, generalized cospectral graphs.
After a few further definitions and preliminary results in Section 2, we remind the reader of the results by Johnson and Newman [12] and Wang and Xu [23] on generalized cospectral graphs in Section 3. We then present necessary and sufficient conditions for a pair of cospectral graphs to have cospectral overgraphs in Section 4. The main results of this paper are in Section 5, where we demonstrate necessary and sufficient criteria for pairs of generalized cospectral graphs to have generalized cospectral overgraphs.These conditions are used to prove the results mentioned in the last sentence of the previous paragraph.In Section 6, we apply our results to a single pair of controllable, non-isomorphic, generalized cospectral graphs on 8 vertices G and H to produce 17 pairs of non-isomorphic, generalized cospectral, controllable graphs on 9 vertices and 525 pairs of non-isomorphic, generalized cospectral, controllable graphs on 10 vertices.In our work, we chose G and H to be controllable graphs, because, in doing so, any pairs of generalized cospectral controllable graphs generated by our method are guaranteed to be non-isomorphic.The techniques in this paper may be used to easily create further pairs of non-isomorphic, generalized cospectral graphs having more vertices.

Preliminaries
The columns of the identity matrix I are e 1 , . . ., e n .An orthogonal matrix Q is a square matrix that satisfies Q T Q = I, where Q T denotes the transpose of Q.A permutation matrix is an n × n matrix whose columns are a permutation of the n columns e 1 , . . ., e n .Clearly permutation matrices are orthogonal.The n × 1 vector of all ones is denoted by j, or sometimes by j n whenever the fact that it has n rows needs to be elucidated.The matrix J is the n × n matrix of all ones.If S is any subset of V (G), then the indicator vector of S is the n × 1 vector whose i th entry is 1 if i ∈ S and is 0 if The walk matrix W G of a graph G is the n×n matrix in which the k th column is [8].Equivalently, as mentioned in the introduction, G is controllable if all of its eigenvalues are simple and main [5], which is the case if and only if G has only main eigenvectors [6].Further results on controllable graphs were reported in [7,19].
We now present two lemmas that are required in subsequent sections.The first lemma below calculates the length of the orthogonal projection of an indicator vector b onto the eigenspace of the eigenvalue µ k of G explicitly for some k = 1, 2, . . ., s in terms of φ(G, x) and φ(G + b, x).This lemma is similar in nature to Theorem 4.1 of [11], which instead determines graph angles [3,Chapter 4].Lemma 1.If µ k is an eigenvalue of a graph G with multiplicity r k , {x 1 , x 2 , . . ., x r k } is an orthonormal set of eigenvectors associated with µ k and E k = r k j=1 x j x T j , then where f (x) denotes the derivative of f (x) with respect to x and the rational function in square brackets is evaluated after cancelling common factors, if any.
Proof.By [3,Theorem 4.3.11](see also [16]), Since φ(G, x) = s i=1 (x − µ i ) r i , (1) may be rewritten as By using the product rule of differentiation on φ(G, x) = By dividing (2) by ( 3), we obtain the rational function , noting that the term , which proves the result.
the electronic journal of combinatorics 26(1) (2019), #P1.14 By combining the following result taken from [4, Proposition 2.1.3], and equation ( 1) with b = j, we obtain the relation Consequently, the following second lemma is obtained.
Lemma 2. If G is a graph on n vertices having an eigenvalue µ k of multiplicity r k and E k is as in Lemma 1, then where the rational function in square brackets is evaluated after cancelling common factors, if any.

Results on Cospectral Graphs
Lemmas 1 and 2 allow us to infer the following theorems regarding certain pairs of cospectral graphs.
Theorem 3. Let G and H be two graphs such that φ(G, x) = φ(H, x) and φ(G, x) = φ(H, x).Moreover, let x 1 , . . ., x n be orthonormal eigenvectors associated with the eigenvalues λ 1 , . . ., λ n of G and y 1 , . . ., y n be those of H. Then these eigenvectors may be chosen such that j T x i = j T y i for all i = 1, 2, . . ., n.
Proof.Each one of the distinct eigenvalues µ 1 , . . ., µ s of G, having multiplicities r 1 , . . ., r s respectively, must also be an eigenvalue of H with the same multiplicity.For each eigenvalue µ k , we infer, by Lemma 2, that r k j=1 j T x p+j−1 2 = r k j=1 j T y p+j−1 2 for some p.
Without loss of generality, the eigenvectors of G and H may be chosen such that only j T x p+j−1 and j T y p+j−1 are possibly nonzero.With this choice of eigenvectors for G and H, The result is thus proved.
Remark 4. It is immediate from Theorem 3 that any two generalized cospectral graphs must have the same number of main eigenvalues.
The proof of Theorem 5 is similar to that of Theorem 3, but uses Lemma 1 instead.
Theorem 5. Let G and H be two graphs such that φ(G, x) = φ(H, x) and let b and c be indicator vectors such that φ(G + b, x) = φ(H + c, x).Moreover, let x 1 , . . ., x n be orthonormal eigenvectors associated with the eigenvalues λ 1 , . . ., λ n of G and y 1 , . . ., y n be those of H. Then these eigenvectors may be chosen such that b T x i = c T y i for all i = 1, 2, . . ., n.
If G and H are generalized cospectral graphs, then the reference [12] shows that there must exist an orthogonal matrix Q satisfying Q T A G Q = A H and Qj = j.In fact, for such graphs, we shall prove that the relation W G = QW H is also true.We first provide an alternative constructive proof to the result in [12] mentioned in this paragraph.Indeed, Q may be directly constructed from orthonormal bases of eigenvectors of G and H. Lemma 6 ([12]).The two graphs G and H are generalized cospectral if and only if there exists an orthogonal matrix Q satisfying Proof.Suppose Q is an orthogonal matrix satisfying both conditions of (5).The first condition tells us that A G and A H are similar matrices, so Since G and H are cospectral, we may write Clearly Q is an orthogonal matrix.We now show that the relation Qj = j is also true.
Since X and Y are orthogonal matrices, we may express j as But G and H are generalized cospectral.Hence, by Theorem 3, r G = r H = r (after possibly modifying X and/or Y in accordance to the requirements of that theorem), meaning that j = Xr = Yr.We deduce that X T j = Y T j.Consequently, j = XY T j = Qj, proving the converse.
We now show that the orthogonal matrix Q of Lemma 6 relates the walk matrices of G and H together.Proof.For all non-negative integers k, we may express the electronic journal of combinatorics 26(1) (2019), #P1.14 Once again we may apply Theorem 3 to conclude that, for a suitable choice of eigenvectors, s k,G = s k,H for all k 0. Thus, for k = 0, 1, 2, . .., Of course, it might be the case that our two generalized cospectral graphs G and H are actually isomorphic.This happens whenever one of the possible matrices Q satisfying ( 5) is a permutation matrix P. If G and H are controllable graphs, then W H , in particular, is invertible, so by Corollary 7, Q is uniquely determined by the matrix product W G W H −1 [23].Thus, we conclude the following two results.
Proof.Suppose Q is an orthogonal matrix satisfying the conditions of (6).The first condition tells us that A G and A H are similar matrices, so φ(G, x) = φ(H, x).By noting that As in the proof of Lemma 6, G and H are cospectral, so we may again let where Λ, X and Y are as in the proof of that lemma.The relation (YX T )A G (XY T ) = A H again holds, so we once more let Q be the orthogonal matrix XY T .We now show that the relation Qc = b also holds for this choice of Q.
the electronic journal of combinatorics 26(1) (2019), #P1.14 We may express the indicator vector b as n i=1 (b T x i )x i and the indicator vector c as But G + b and H + c are cospectral, and so are G and H. Hence, by Theorem 5, t G = t H = t for a suitable selection of the eigenvectors of G and H.We thus deduce the relation The proof of Theorem 10 just presented hints at an alternative necessary and sufficient condition for G and H to be cospectral graphs and for the overgraphs G + b and H + c to also be cospectral graphs.
Theorem 11.The graph G is cospectral to the graph H and the overgraph G + b of G is cospectral to the overgraph H + c of H if and only if there exists an orthogonal matrix U of the form Q 0 Proof.Suppose an orthogonal matrix U of the form Q 0 0 T 1 that satisfies (7) exists.We are given that In particular, the submatrix Q, which clearly must be orthogonal, satisfies Conversely, suppose φ(G, x) = φ(H, x) and φ(G + b, x) = φ(H + c, x).Then, by Theorem 10, there exists an orthogonal matrix Q that satisfies Q T A G Q and b = Qc.These conditions ensure that the matrix product U T A G+b U is, indeed, equal to A H+c .
We emphasize the rather important point being made by Theorem 11 that the orthogonal matrix U satisfying (7) does not depend on the indicator vectors b and c; U is always of the form Q 0 0 T 1 as long as G and H are cospectral and G + b and H + c are cospectral.Moreover, the submatrix Q satisfies the conditions of (6).

Constructing Generalized Cospectral Overgraphs From Generalized Cospectral Graphs
This section shall present our main results of this paper, that allow us to produce pairs of non-isomorphic, generalized cospectral overgraphs from a pair of non-isomorphic, generalized cospectral, controllable graphs.
the electronic journal of combinatorics 26(1) (2019), #P1.14 Not surprisingly, the necessary and sufficient conditions for both the pair G and H and the pair G + b and H + c to be generalized cospectral graphs is a combination of the relations in ( 5) and ( 6).This, and the equivalent Theorem 11, constitute our first main results.
Theorem 12.The graphs G and H are generalized cospectral and the overgraphs G + b and H + c are generalized cospectral if and only if there exists an orthogonal matrix Q satisfying Proof.Suppose Q is an orthogonal matrix satisfying the three conditions of (8).Then, since Q T A G Q = A H and Qj = j, we can directly apply Lemma 6 to prove the relations φ(G, x) = φ(H, x) and φ(G, x) = φ(H, x).Moreover, since Conversely, suppose G and H are generalized cospectral graphs and the overgraphs G + b and H + c are also generalized cospectral.The equations φ(G, x) = φ(H, x) and φ(G + b, x) = φ(H + c, x) allow us to apply Theorem 10, so there exists an orthogonal matrix Q satisfying the first and third conditions of (8).We now prove that the second condition of ( 8), Qj = j, also holds.Using the equations φ(G + b, x) = φ(H + c, x) and φ(G + b, x) = φ(H + c, x), we infer, by applying Lemma 6, that there exists an orthogonal matrix U such that U T A G+b U = A H+c and Uj n+1 = j n+1 .However, Theorem 11 tells us that this orthogonal matrix U must be of the form Q 0 0 T 1 , because G and H are also generalized cospectral.But then the equation Uj n+1 = j n+1 gives us from which we deduce that Qj = j, as required.
Combining Theorem 11 and Theorem 12 yields the following alternative formulation of the theorem just proved.
Theorem 13.The graphs G and H are generalized cospectral and the overgraphs G + b and H + c are generalized cospectral if and only if there exists an orthogonal matrix Q satisfying The first interesting result derived from Theorem 12 relates the walk matrices of two generalized cospectral graphs G and H having the generalized cospectral overgraphs G+b and H + c.Proof.By Theorem 12, there exists an orthogonal matrix Q that satisfies all the conditions of (8).Thus, Corollary 7 can be invoked to conclude that W G = QW H .The result is proved by left-multiplying this equation by b T and using the relation b = Qc.
In [7,Theorem 3.5], it was proved that all overgraphs of a controllable graph G are non-isomorphic.Thanks to Corollary 14, we can now prove an even stronger result, which is the second main result of this paper.We remark that, by Lemma 6 and Theorem 12, the overgraphs G + j and H + j are generalized cospectral if and only if G and H are generalized cospectral; moreover, they are non-isomorphic whenever G and H are non-isomorphic.Additionally, if G and H are controllable, then G + j and H + j are controllable if and only if 0 is not an eigenvalue of G [7].
Recall Remark 4 which stated that a pair of generalized cospectral graphs must have the same number of main eigenvalues.This means that G and H are either both controllable or both not controllable.The same is true, of course, for G + b and H + c too.In fact, if G+b and H +c themselves are controllable, then Theorem 12 can be strengthened even further by proving that they are necessarily non-isomorphic whenever G and H are non-isomorphic.Additionally, the fact that G + b and H + c are controllable graphs compels G and H to be necessarily controllable themselves.This is our third main result.Proof.Since G + b and H + c are controllable, the matrix U = Q 0 0 T 1 of (9) satisfying U T A G+b U = A H+c and Uj = j is unique, thanks to Corollary 8.But then Q is also unique, otherwise if there exists another matrix Q , different from Q, that also satisfies (5) for G and H, then U := Q 0 0 T 1 would be a matrix distinct from U that satisfies both U T A G+b U = A H+c and U j = j too, contradicting the uniqueness of U. Thus, if G and H are non-isomorphic, generalized cospectral graphs that are not controllable, then none of their generalized cospectral pairs of overgraphs can be controllable; moreover, we are not guaranteed that these pairs of overgraphs are non-isomorphic.On the other hand, if G and H are non-isomorphic, controllable, generalized cospectral graphs, then the generalized cospectral pairs of overgraphs produced by Theorem 12 that are controllable are necessarily non-isomorphic.
If we assume the conditions of Theorem 12 to hold, then b T W G = c T W H also holds, as we saw in Corollary 14.In particular, by comparing the leftmost columns of this equality, we infer that b T j = c T j.This means that the new vertex introduced to G and the one introduced to H for the overgraphs G + b and H + c in Theorem 12 must have the same degree.If this common degree is 1, so that b = e i and c = e j for some i and j, then b = Qc implies that the j th column of Q is e i and the i th row of Q is e T j .Such indicator vectors having only one nonzero entry allow us to produce a pair of generalized cospectral graphs by removing a vertex from each of G and H. Proof.We assume, without loss of generality, that u = n and v = 1.Suppose there exists an orthogonal matrix Q satisfying (5) and let e n = Qe 1 .By Theorem 12, these are necessary and sufficient conditions for the graphs G and H to be generalized cospectral and for the graphs G + e n and H + e 1 to also be generalized cospectral.
Since, from [4, Theorem 2.2.1],Remark 18. Suppose we have an orthogonal matrix Q that satisfies (9).One consequence of the fact that U = Q 0 0 T 1 is that Uj n+1 = j n+1 and Ue n+1 = e n+1 .Thus, we may apply Theorem 10 using U T A G+b U = A H+c , Uj n+1 = j n+1 and Ue n+1 = e n+1 to conclude that the graphs with adjacency matrices cospectral, having the orthogonal matrix V = Q 0 n×2 0 2×n I 2×2 .This orthogonal matrix V also works for the graphs having adjacency matrices where a ∈ {0, 1}, assuming that Q c 1 c 2 = b 1 b 2 .Thus, Theorems 10 and 11 may be reapplied and will produce many generalized cospectral overgraphs of G and H having as many vertices as needed.Moreover, by Theorem 16, if we start from controllable graphs G and H, then any pair of controllable overgraphs produced in this manner is non-isomorphic.

An Illustrative Example and Final Comments
Consider the two graphs G and H depicted in Figure 1.These two graphs are nonisomorphic, controllable and generalized cospectral.Indeed, φ(G Since G and H are controllable, the orthogonal matrix for G and H in Lemma 6 is unique; indeed, by Corollary 8, it is W G W H −1 .Alternatively, we may evaluate XY T , where the columns of X and Y are certain orthonormal eigenvectors of G and H respecthe electronic journal of combinatorics 26(1) (2019), #P1.14 tively.Either way, we obtain: . .By direct calculation using a software package, it turns out that 17 of these 32 pairs of graphs are pairs of controllable graphs.By Theorem 16, these 17 pairs of graphs are guaranteed to be non-isomorphic, generalized cospectral graphs.Five of these 17 pairs of controllable, non-isomorphic, generalized cospectral overgraphs are depicted in Figure 2.

If we let
It needs to be said, however, that only 2 of the remaining 15 pairs of non-controllable overgraphs generated in this way were actually isomorphic pairs.These are the pair (G + (b 1 + b 2 ), H + (c 1 + c 2 )), and the pair (G + (b 1 + b 2 + b 4 ), H + (c 1 + c 2 + c 4 )), shown in Figure 3.In all, then, we produced 30 generalized cospectral, non-isomorphic pairs of graphs on 9 vertices, of which 17 were pairs of controllable graphs.
According to Theorem 17, the pairs of graphs (G − 1, H − 1) and (G − 7, H − 6) must be generalized cospectral.Indeed, this is the case, although here, these pairs of graphs happen to be isomorphic as well.By Theorem 15, neither of these two pairs of graphs can be controllable, and this may be verified to be the case.
We have also produced overgraphs of n + 2 vertices by applying the method described in Remark 18.We first started with overgraphs whose adjacency matrices are of the form A G B B T 0 2×2 and A H C C T 0 2×2 , then, using a software package, we produced all possible matrices B such that each of its two columns is any of the possible 32 vectors b = 5 i=1 a i b i , a i ∈ {0, 1}, i = 1, 2, 3, 4, 5; we also did likewise for C, using c = 5 i=1 a i c i .253 out of the possible 528 such pairs of generalized cospectral graphs thus generated were pairs of controllable graphs, which were guaranteed to be non-isomorphic by Theorem 16.Moreover, only 24 out of the remaining pairs were actually isomorphic.We then repeated the same procedure, this time for adjacency matrices of the form A G B B T K 2 the electronic journal of combinatorics 26(1) (2019), #P1.14   one edge connecting them.This time, 272 pairs of controllable, and hence non-isomorphic, generalized cospectral were produced, out of the possible 528; moreover, once again, only 24 of the remaining pairs were isomorphic.Hence, by using Theorem 12 on the single pair of graphs G and H of Figure 1, using matrices B and C with two columns, we produced 1008 pairs of non-isomorphic, generalized cospectral graphs on 10 vertices, of which 525 were pairs of controllable graphs.The fact that almost all graphs are controllable [15] suggests that pairs of nonisomorphic, generalized cospectral controllable graphs may not be rare; indeed, more than half of the non-isomorphic, generalized cospectral graphs we created were pairs of controllable graphs.Moreover, it seems that the majority of the pairs of generalized cospectral overgraphs produced by Theorem 12 or Theorem 13 end up being non-isomorphic, even though not all of them are controllable graphs.
i / ∈ S. The overgraph G + b of the graph G [13] is obtained from G by introducing a new vertex to G and forcing this new vertex to be incident to the vertices identified by the indicator vector b.The adjacency matrix of G + b would thus be the block matrix A G b b T 0 , denoted more succinctly by A G+b .If v is a vertex of G, then the vertex-deleted subgraph G − v is the graph obtained from G after removing v and all edges incident to v.

Corollary 7 .
If G and H are generalized cospectral graphs and Q is as described in the proof of Lemma 6, then W G = QW H .
and Qc = b, we apply Theorem 10 to deduce the relation φ(G + b, x) = φ(H + c, x).Furthermore, by Theorem 11, U T A G+b U = A H+c where U = Q 0 0 T 1 .Since Uj n+1 = j n+1 , we again apply Lemma 6 using this orthogonal matrix U on G + b and H + c to prove the fourth relation φ(G + b, x) = φ(H + c, x).

Corollary 14 .
Let G and H be a pair of generalized cospectral graphs and let the overgraphs G + b and H + c be another pair of generalized cospectral graphs for some indicator vectors b and c.Then b T W G = c T W H .

Theorem 15 .
If G is a controllable graph, then no two distinct overgraphs of G are generalized cospectral.Proof.Suppose G + b and G + c are generalized cospectral graphs for distinct indicator vectors b and c.Letting G = H in Theorem 14, we conclude that bT W G = c T W G .But G is controllable, so W G is invertible.This implies that b = c,which contradicts the assumption that the vectors b and c are distinct.Hence, by Theorem 15, no pair of non-isomorphic, generalized cospectral graphs G and H can have isomorphic vertex-deleted subgraphs G − u and H − v that are controllable.Observe, by taking the two conditions Qj = j and Qc = b of Theorem 12, that Q(j−c) = j−b holds as well.Thus, if G and H are a pair of generalized cospectral graphs and G + b and H + c are generalized cospectral overgraphs, then the graphs G + (j − b) and H + (j − c) are also generalized cospectral; moreover, so are their complements G + b and H + c.

Theorem 16 .
Let G and H be generalized cospectral graphs and let G + b and H + c also be generalized cospectral graphs, so that the relations in (9) hold.If G + b and H + c are controllable, then so are G and H; furthermore, G + b and H + c are isomorphic if and only if G and H are isomorphic.theelectronic journal of combinatorics 26(1) (2019), #P1.14

Theorem 17 .
The graphs G and H are generalized cospectral and the vertex-deleted subgraphs G − u and H − v are generalized cospectral for some vertex u in G and some vertex v in H if and only if there exists an orthogonal matrix Q satisfying Q T A G Q = A H , Qj = j and Qe v = e u .

and A H C C T K 2 , where K 2
is the adjacency matrix of the graph having two vertices and the electronic journal of combinatorics 26(1) (2019), #P1.14
Corollary 8 ([23,Lemma 2.4]).Let G and H be two graphs satisfying φ(G, x) = φ(H, x) and φ(G, x) = φ(H, x).Then G and H are controllable if and only if the matrix Q satisfying the conditions of Lemma 6 is the unique matrix W G W H −1 .
Corollary 9 ([23,Lemma 2.5]).If G and H are controllable graphs satisfying both φ(G, x) = φ(H, x) and φ(G, x) = φ(H, x), then they are isomorphic if and only if the matrixQ = W G W H −1 is a permutation matrix.4ConstructingCospectral Overgraphs From Cospectral GraphsThe next result is a new development similar in nature to Johnson and Newman's result in Lemma 6.The difference is that it provides necessary and sufficient conditions for a pair of cospectral graphs G and H to have a pair of cospectral overgraphs G + b and H + c.Theorem 10.The graph G is cospectral to the graph H and the overgraph G + b of G is cospectral to the overgraph H + c of H if and only if there exists an orthogonal matrix Q satisfying Hence G and H are controllable by Corollary 8.In addition, by Corollary 9, Q is a permutation matrix if and only if G and H are isomorphic; likewise, U is a permutation matrix if and only if G + b and H + c are isomorphic.But clearly U is a permutation matrix if and only if Q is, proving the result.
(10)e graphs G + e n and H + e 1 are cospectral if and only if G − n and H − 1 are cospectral.Moreover, from the relations Qj = j and Qe 1 = e n , we obtain Q(j − e 1 ) = j − e n , and hence, by applying Theorem 12, the graphs G + (j − e n ) and H + (j − e 1 ) are generalized cospectral.Thus, replacing G and H in(10)with G and H respectively and noting that G − n is isomorphic to G − n (and likewise for H − 1 and H − 1), we infer that the graphs G + e n and H + e 1 are cospectral if and only if G − n and H − 1 are cospectral, proving the result.