Graph families with constant distance determinant

This paper introduces a new class of graphs, the clique paths (or the CP graphs), and shows that their distance determinant and distance inertia are independent of their structures. The CP graphs include the family of linear 2-trees. When a graph is attached to a CP graph, it is shown that the distance determinant and the distance inertia are also independent of the structure of the CP graph. Applications to the addressing problem proposed by Graham and Pollak in 1971 are given. Mathematics Subject Classifications: 05C50, 05C12, 15A15


Introduction
On a simple connected graph G, the distance between two vertices i and j is the length of the shortest path between them, denoted as dist G (i, j).The distance matrix of a connected graph G is D(G) = dist G (i, j) .
Various properties of the distance matrix of a graph have been studied intensively; see [1] for a survey and the references therein.Suppose A is an n × n symmetric matrix.The inertia inertia(A) of A is the triple (n + , n − , n 0 ), where n + , n − , and n 0 are the number of positive, negative, and zero eigenvalues of A, respectively.The i, j-cofactor of A is (−1) i+j det(A(i|j)), where A(i|j) is the matrix obtained from A by removing the i-th row and the j-th column.Let cof(A) be the sum of all cofactors.That is, cof(A) = When A is invertible, cof(A) = det(A)(1 A −1 1), where 1 is the all-ones vector.For convenience, we write det D (G) = det(D(G)), inertia D (G) = inertia(D(G)), and cof D (G) = cof(D(G)).
In 1971, Graham and Pollak [6] proved that det D (T ) = (−1) n−1 (n − 1)2 n−2 for any tree T on n vertices, so the distance determinant is independent of the structure of the tree.(In 2006, a simple proof of this result was given in [10].)Graham, Hoffman, and Hosoya [5] then gave a generalization by showing both det D (G) and cof D (G) are determined by det D (G i ) and cof D (G i ) for i = 1, . . ., k, where G i 's are the blocks of G. (A block of a graph is a maximal induced subgraph of G without a cut-vertex.)This means det D (G) and cof D (G) are independent of how the blocks are attached to each other.Several variants of the distance matrices were considered, such as the weighted distance matrix [3], the q-analog and the q-exponential distance matrix [4,11], and the determinant of these matrices of a tree are shown to be independent of the structure of the tree.These results gave elegant formulas for various types the distance matrices of a tree, or graphs with cut-vertices.A natural question is: Can the distance determinant be a constant for other families of graphs with tree-like structure, or graphs without a cut-vertex?The family of k-trees is an immediate candidate to answer the question.A k-tree on n vertices is constructed by the following process: Start with a k-clique on vertices {1, . . ., k}.For j = k + 1, . . ., n, add a new vertex j and join it with an existing k-clique.A linear k-tree is a k-tree where each added vertex j is joined with an existing k-clique that contains vertex j − 1.Note that a 1-tree is a tree, and a linear 1-tree is a path.Figure 1 shows three 2-trees G 1 , G 2 , and G 3 of the same order.By direct computation, det D (G 1 ) = −8 and det D (G 2 ) = det D (G 3 ) = −9.It seems giving a negative answer to the questions.However, it also suggests that the family of linear 2-trees is probably promising.
Indeed, Corollary 31 shows every linear 2-tree on n vertices has the same distance determinant.(Example 32 shows that the same behavior does not occur for linear 3trees.)Section 4 defines a 2-clique path, which is obtained by gluing the edges from several cliques into a path-like structure; the family of linear 2-trees is a special case of the family of 2-clique paths.Theorem 28 shows the distance determinant only depends on the size of each clique.In fact, the 2-clique paths belong to a bigger family of graphs, the clique paths (or the CP graphs); see Figure 2 for some examples of the CP graphs.Section 2 defines the CP graphs and shows that the distance determinant of the CP the electronic journal of combinatorics 25(4) (2018), #P4.45 graphs only depends on the input parameters; the distance inertia and cof D (G) are also considered.Section 3 shows gluing the initial edges of two different CP graphs to any given connected graph will give two new graphs with the same distance determinant.
Finally, we turn our attention to the addressing problem.Graham and Pollak [6] proposed an addressing scheme on a graph G as an assignment of strings in {0, 1, * } of length d to each vertex such that the distance between any pair of vertices is equal to the Hamming distance of their strings, ignoring the digits of * .Let N (G) be the minimum d so that there is an addressing scheme on G.In [6], it was shown that where inertia D (G) = (n + , n − , n 0 ), and was conjectured that N (G) n − 1 for any graph of order n.This conjecture was then proved by Winkler [9] in 1983.If G is a tree or a clique tree on n 2 vertices, then it is known [6,8] Here a clique tree (or a block graph in some literature) is a graph whose blocks are cliques.Section 5 shows that inertia D (G) = (1, n − 1, 0) and N (G) = n − 1 for any graph G whose blocks are 2-clique paths, generalizing the known results.
For convenience, we use weighted graphs to record matrices.A weighted graph is a simple graph whose vertices and edges are associated with weights.The weight w(i, j) of an edge {i, j} is nonzero, and the weight w(i) of a vertex can possibly be zero.The weighted adjacency matrix of a weighted graph is a i,j with

The CP graphs and their distance matrices
A sequence of integers q 1 , . . ., q n (n 2) is called non-leaping if q 1 = 0, q 2 = 1, and 2 q k q k−1 + 1 for any k = 3, . . ., n. (So q 3 = 2 if n 3.) For a given non-leaping sequence, a neighborhood sequence is a sequence of sets W 1 , . . ., W n with the following properties: We vacuously define a 2 = 1 and b 2 = 2.Note that each b k is determined by the given non-leaping sequence, yet the neighborhood sequences may vary by the choices of a k .
Therefore, each set W k contains q k elements, while q k − 1 of them are fixed with respect to the non-leaping sequence.
A neighborhood sequence gives the construction of a graph: Start with vertex 1.For k = 2, . . ., n, add vertex k and join it to every vertex in W k .In other words, a neighborhood sequence describes the "backward" neighborhoods of its graph.Note that a non-leaping sequence may lead to more than one neighborhood sequence, depending on the choices of a k , but the neighborhood sequence uniquely determines the graph.
Observation 1.By the definition of a non-leaping sequence, by the definition of a neighborhood sequence.As a result, if G is the graph constructed by a neighborhood sequence, then W k ∪ {k} forms a clique in G for each k.
Definition 2. Given a non-leaping sequence q 1 , . . ., q n , the family CP q 1 ,...,qn consists of the graphs of any possible neighborhood sequences of q 1 , . . ., q n .Graphs in CP q 1 ,...,qn for any non-leaping sequence are called CP graphs.The family of all CP graphs is denoted as CP .Note that when s = 0, 1, 2, . . ., 2 with m copies of 2, the family CP s is exactly the family of linear 2-trees on m + 2 vertices.Definition 3. The reduced graph of a non-leaping sequence q 1 , . . ., q n is a weighted graph on n vertices whose edges are {1, 2} with weight 1 and with weight − 1, {k − 1, k} with weight 1 for k = 3, . . ., n.For each k, if any edges of the three edges above are the same, then they merge as an edge and the weight is the sum of the weight of each edge; when the sum of the weights is zero, the edge degenerates as a nonedge.Finally, the weight for vertices 1 and 2 are 0 while the weight of all other vertices is −2.
Here we elaborate all cases of Definition 3. First observe that b happens only when k = 3; in this case, the three edges merge together as a single edge {2, 3} with weight 1 − 1 + 1 = 1.Now consider the cases when k 4. When q k = 2, the edges {b k , k} and {k − 1, k} cancel with each other since the weight is −1 + 1 = 0; similarly, when q k = q k−1 + 1, the edges {b k−1 , k} and {b k , k} cancel with each other.Remark 4. In the reduced graph, for any k = 3, . . ., n, if q k = 2, then the only neighbor  Example 5. Let s = 0, 1, 2, 2, 2, 2, 3, 3 be a non-leaping sequence.The two cases below are both neighborhood sequences of s.
The graphs G 1 and G 2 are shown in Figure 2, and both of them are in CP s .
Notice that a k is always the minimum element in W k and b k is the next element after a k for any k = 3, . . ., n.Therefore, the values of b k are invariants of s as shown below.
Example 7 illustrates the main result Theorem 13: Given a non-leaping sequence s, for any graph G ∈ CP s , its distance matrix D and its reducing matrix E always have E DE equal to the weighted adjacency matrix of the reduced graph.Before showing Theorem 13, we need some lemmas.
Inductively, a is adjacent to any c with a < c < b.
Corollary 9. Suppose G is a CP graph.For any two vertices a < b, each vertex k on any shortest path a to b has k b.
for some i.Then v i is adjacent to b by Lemma 8, giving a shorter path from a to b.
Proof.It is sufficient to verify the distances given in Figure 4.By definition, a 2 = 1 and b 2 = 2, so the result holds for k = 2.For the following, we assume k 3.
Suppose h is a vertex with h < a k .Pick a shortest path from h to k, and let b be the last vertex on the path before reaching k and a the previous vertex of b.
and a k < a < k.In either cases, we can replace b by a k , and then a k is adjacent to k.It follows that every vertex h with h < a k has a shortest path from h to k through a k , so Other cases are straightforward.
Corollary 11.Let s be a non-leaping sequence and G ∈ CP s with distance matrix D. For k 3, let d = D(e k−1 − e a k−1 ).Then the h-th entry of d with h k is and Corollary 12. Let s be a non-leaping sequence and G ∈ CP s with distance matrix D.
, so the result follows directly from Lemma 10 and Corollary 11.For convenience, we align the results from Lemma 10 and Corollary 11 together.
By taking the differences of the corresponding terms, this completes the proof.
the electronic journal of combinatorics 25(4) (2018), #P4.45 Theorem 13.Let s be a non-leaping sequence with the reduced graph H.If G is in CP s with D = D(G) and E is the reducing matrix for G, then E DE is the weighted adjacency matrix of H.
Proof.Let R = E DE = r i,j .Since R is a symmetric matrix, it is sufficient to show that R is the same as the weighted adjacency matrix of H for the i, j-entry with i j.
Since the principal submatrix of R on the first two columns and rows is 0 1 1 0 , which agrees with H, we assume j 3. Let φ i,j = j h=i e h , which is defined as a zero vector when j < i.By Corollary 12, where s = 1, 0 depending on a j−1 = a j or not and y is a vector that vanishes on all entries from 1 to j.First, we examine the diagonal entries.For i = j and i, j 3, Here we use the fact that a j−1 = a j implies a j < b j−1 , and a j−1 < a j implies b j−1 a j b j − 1.
If j > i 3, then a i , a i−1 < b j−1 .Thus, In fact, this formula holds also for i = 1, 2 and j 3. When i = 1, 2, The two formulas agree since b j−1 2 for any j and e i φ b j−1 +1,b j +1 vanishes when i = 1, 2. Therefore, for j 3 and i < j, the electronic journal of combinatorics 25(4) (2018), #P4.45 In other words, where y is a vector that vanishes on entries from 1 to j − 1.Therefore, R is the weighted adjacency matrix of H.
Corollary 14.Let s be a non-leaping sequence with the reduced graph H and A the weighted adjacency matrix of Proof.Let D be the distance matrix of G.By Theorem 13, A = E DE, where E is the reducing matrix corresponding to G. Since E is an upper triangular matrix with diagonal entries equal to 1, det(D) = det(A).Since D is congruent to A, the inertia of D is the same as the inertia of A.
Let J k be the k × k all-ones matrix.Let J k,n be the matrix obtained by embedding J k to the top-left corner of the n × n zero matrix.
Corollary 15.Let s be a non-leaping sequence of length n with the reduced graph H and A the weighted adjacency matrix of Proof.Let D be the distance matrix of G.By Theorem 13, A = E DE, where E is the reducing matrix corresponding to G. Notice that E has column sums zero except for the first and the second columns.Therefore, Therefore, the value cof D (G) is determined by s.

Attaching the CP graphs
Lemma 18.Let G 0 be a connected graph with an edge e = {v 1 , v 2 } and G ∈ CP .For ∈ V (G), then b ∈ {1, 2}; by the assumption that k is not adjacent to both 1 and 2, the only neighbor of k in {1, 2} is a k = b, a contradiction.Suppose a ∈ V (G) and b > a k .Either a < a k < b with {a, b} ∈ E(G) or a k < a < k with {a k , k} ∈ E(G).By Lemma 8, a is adjacent to a k , and we may replace the vertex b by a k and then a k is adjacent to k.Therefore, every vertex This completes the proof.
Lemma 19.Let G 0 be a connected graph with an edge e = {v 1 , v 2 } and G ∈ CP .For if k 4 is adjacent to 1 and 2.
the electronic journal of combinatorics 25(4) (2018), #P4.45 Proof.Since k is adjacent to 1, k is adjacent to 2. Therefore, {1, 2, . . ., k} forms a clique from the definition of CP graphs, and Theorem 20.Let s = q 1 , . . ., q n be a non-leaping sequence.If G 0 is a connected graph with an edge e = {v 1 , v 2 } and G ∈ CP s , then for Ĝ = G 0 ⊕ e G, each of det D ( Ĝ), inertia D ( Ĝ), and cof D ( Ĝ) is independent of the choice of G.
Proof.Let Ĝ = G 0 ⊕ e G.By Observation 17, we may write D( Ĝ) as the form where E is the reducing matrix corresponding to G. Then We know that D(G 0 − {v 1 , v 2 }) is independent of the choice of G, and so is E T D(G)E by Theorem 13.It remains to show that A 12 E is independent of the choice of G. Let t 4 be the first vertex such that q t = t − 1.Then t is not adjacent to 1 and 2 simultaneously.Likewise, k is not adjacent to both 1 and 2 for each k t since By Lemma 18, Let e 1 , . . ., e k be edges of a connected graph G 0 .Let G 1 , . . ., G k be CP graphs (not necessarily from the same non-leaping sequence).Define Corollary 21.Let G 0 be a connected graph, s (i) a non-leaping sequence, and e i = {v the electronic journal of combinatorics 25(4) (2018), #P4.45 where p 1 , . . ., p m are integers at least 3.Such a sequence is abbreviated as 2 : p 1 , . . ., p m .It is possible that m = 0, in which case the sequence is 0, 1 and CP 0,1 = {K 2 }.Let this sequence be q 1 , . . ., q 8 .Figure 7 shows a graph G from CP s and its reduced subgraph.The graph is obtained from a disjoint union of four cliques K p 1 , K p 2 , K p 3 , and K p 4 by gluing an edge from each of two consecutive cliques.
By Remark 4, the reduced graph is a weighted graph on 8 vertices such that • vertices 1 and 2 are adjacent and with weight 0; • for k = 3, . . ., 8, vertex k is adjacent to k − 1 if q k = q k−1 + 1, and is adjacent to b k−1 if q k = 2; • each edge has weight 1, and every vertex except for 1 and 2 has weight −2.
Therefore, on the reduced graph H, vertices 3 and 6 form a path of length (p 1 −2)+(p 3 −2), and vertices 4, 5, 7, 8 form another path of length (p Any graph from CP 2:p 1 ,...,pm is obtained from a disjoint union of K p 1 , K p 2 , . .., K pm by gluing an edge of K p i to an edge of K p i+1 while an edge cannot be glued twice.
Definition 24.A graph is called a 2-clique paths if it is in CP 2:p 1 ,...,pm for some integers p 1 , . . ., p m 3 and m 0.
When • Start with two adjacent vertices 1 and 2, each with weight 0; • join an endpoint of P −2 to vertex 2 by an edge; • join an endpoint of P −2 r to vertex 2 by an edge; and • every edge has weight 1.
Observation 26.Let 2 : p 1 , . . ., p m be a non-leaping sequence.Let Then the reduced graph of 2 : p 1 , . . ., p m is isomorphic to the seesaw graph S ,r .
Proof.Let H be the reduced graph of 2 : p 1 , . . ., p m and A its weighted adjacency matrix.By Corollary 14, det D (G) = det(A) and inertia D (G) = inertia(A) for any G ∈ CP 2:p 1 ,...,pm , so it is enough to find the determinant and the inertia of A. By Observation 26, the reduced graph H is isomorphic to S ,r .Thus, up to permutation similarity, we may write A as .
By using the first row and column to eliminate the ones on the second column and row, there is a matrix M with det(M ) = ±1 such that By Observation 26, up to permutation similarity, the matrix A + J 2,n can be written as , which leads to by applying the Schur complement to the 1, 1-entry; that is, subtract twice of the first column from the second column and then do the same for rows.Since Here the second equality follows from Lemma 27 and Theorem 28, while the third equality follows from Lemma 27.As a consequence, cof the electronic journal of combinatorics 25(4) (2018), #P4.45 Remark 30.Let s = 2 : p 1 , . . ., p m .According to Theorem 28, the distance determinant of a graph in CP s only depends on the sum of the odd terms and the sum of the even terms.Therefore, applying any permutation to the odd terms and any permutation to the even terms of s will not change the distance determinant.
Corollary 31.Let G be a linear 2-tree on n vertices.Then Example 32.The linear 2-trees are special cases of the CP graphs.However, not every linear 3-tree is a CP graph.For example, let G 1 and G 2 be the two graphs shown in Figure 8.By labeling the vertices with 1, . . ., 7 from left to right, G 1 is a CP graph in CP 0,1,2,3,3,3,3 , while G 2 is not a CP graph.Indeed, their distance determinants are different with det D (G 1 ) = 4 and det D (G 2 ) = 6.

Applications to the addressing problem
In this section we will study the applications of our results to the addressing problem and show that N (G) = |V (G)| − 1 for graphs each of whose blocks are 2-clique paths.
The following lemma is from [5].
For any real number x, define sign(x) as 1, 0, or −1 when x is positive, zero, or negative, respectively.Then we have the following lemma about sign(det D (G)).
Lemma 34.Let G be a connected graph of order n with r blocks G 1 , . . ., G r of order n 1 , . . ., n r , respectively.If In 1950, Jones [7] gave an approach to get the inertia of a symmetric matrix from its principal leading minors.Lemma 36 states Theorem 4 in [7].
Lemma 36.[7] Let A be a nonsingular symmetric n × n matrix with principal leading minors D 1 , . . ., D n .If there is no consecutive two zeros in the sequence D 1 , . . ., D n , then n − is the number of sign changes in the sequence 1, D 1 , . . ., D n , ignoring the zeros in the sequence.
Remark 37. The original statement of [7,Theorem 4] says that n − is the number of sign changes in the sequence 1, D 1 , . . ., D n , where any zero D i may be given arbitrary sign.It was also shown that every zero is guaranteed to appear between a '+' and a '−' under the assumption; therefore, ignoring the zeros leads to the same number of sign changes.Proof.We will show that there is an ordering of the vertices v 1 , . . ., v n such that the induced subgraph G[{v 1 , . . ., v k }] is also a connected graph whose blocks are 2-clique paths for any k 2.
First we claim that if H is a 2-clique path with |V (H)| 3, then there exists at least two vertices u and v such that both H − u and H − v are a 2-clique path.Let H ∈ CP 2:p 1 ,...,pm .Then H is obtained by gluing the cliques K p 1 , . . ., K pm into a path-like structure.If m 2, then we may pick a vertex from each of the two ending cliques so that the vertex was not used for gluing.If m = 1, then H is a complete graph with |V (H)| 3, so removing any vertex from H gives a smaller complete graph.In either cases, we found two vertices with the desired property.
If G itself is a block with |V (G)| 3, then by the previous claim we can find a vertex v n such that G − v n is still a 2-clique path.If G has more than one block, then there is a pendent block B, which is incident to only one cut-vertex x.If B = K 2 , then let v n be the vertex in B other than x.If B has more than three vertices, then there are two vertices u and v such that B − u and B − v are still 2-clique paths, so we may pick v n as one of u and v that is different from x.In either cases, G − v n is still a graph whose blocks are 2-clique paths.Inductively, keep removing a vertex while preserving the structure, and name the removed vertices as v n , . . ., v 3 .This process will stop when the remaining graph is K 2 .At this point, name the remaining two vertices as v 2 and v 1 in any order.
Thus, we find an ordering of the vertices v 1 , . . ., v n such that the induced subgraph G[{v 1 , . . ., v k }] is also a connected graph whose blocks are 2-clique paths for any k Note that the set of graphs considered in Theorem 38 or Corollary 39 contains complete graphs, trees, clique trees, and 2-clique paths, so they generalize several known results; see, e.g., [6,8].

For any connected graph G 0 with an edge e = {v 1 , v 2 } 1 C 5
and for any G ∈ CP , define G 0 ⊕ e G as the graph obtained from G 0 ∪ G by identifying the edges {v 1 , v 2 } ∈ E(G 0 ) and {1, 2} ∈ E(G) with v 1 to 1 and v 2 to 2. Example 16.Let C 5 be the five cycle and G 1 , G 2 the two graphs shown in Figure 2. Let e be an edge on C 5 .Then the two graphs C 5 ⊕ e G 1 and C 5 ⊕ e G 2 are shown in Figure 5. Theorem 20 will show that det D (C 5 ⊕ e G 1 ) = det D (C 5 ⊕ e G 2 ). the electronic journal of combinatorics 25(4) (2018), #P4.45 ⊕ e G 2

1 and 2
simultaneously.Proof.Pick a shortest path from x to k.Let b be the last vertex on the path before reaching k and a the previous vertex.Since k 3, b ∈ W k ⊆ [a k , k − 1].If b = a k , then we found a shortest path from x to k through a k , so assume b > a k .If a /

1 )
since A 12 e k−1 = A 12 e 3 by Lemma 19 and a k−1 = 1.When k ∈ [4, t − 1], a k = a k−1 = 1 and k is adjacent to both 1 and 2, so A 12 Ee k = A 12 (e k − e a k − e k−1 + e a k−1 ) = A 12 (e k − e k−1 ) = 0 by Lemma 19.For k = 3, A 12 Ee k = A 12 (e 3 − e 2 ).Therefore, A 12 E = A 12 e 1 A 12 e 2 A 12 (e 3 − e 2 ) O 1 − A 12 (e 3 − e 1 ) O , where the first O is a zero matrix with t − 4 columns and the second O has |V (G)| − t columns.Note that A 12 e 1 and A 12 e 2 are determined by D(G 0 ), which is independent of the choice of G. Also, A 12 e 3 is independent of the choice of G by Observation 17.And t is determined only by s.In conclusion, det D ( Ĝ) and inertia D ( Ĝ) are independent of the choice of G ∈ CP s .Also, let D = D( Ĝ), c = |V (G 0 )|, and d = |V ( Ĝ)| = c + n − 2. Then cof D ( Ĝ) = det(D + J d ) − det(D) = det(F (D + J d )F ) − det(F DF ) = det(F DF + J c,d ) − det(F DF ), which is independent of the choice of G ∈ CP s .

8 HFigure 7 :
Figure 7: A graph G in CP 2:3,4,3,4 and its reduced graph H pm is the family of linear 2-trees on m + 2 vertices.Definition 25.Define P −2 n as a weighted path on n vertices such that each vertex has weight −2 and each edge has weight 1.The seesaw graph S ,r is a weighted graph on n = 2 + + r vertices constructed by the following process: