Spec. Matrices 2016; 4:270–282

Research Article Open Access Special Issue: Proceedings of the 24th International Workshop on Matrices and Statistics

Hiroshi Kurata* and Ravindra B. Bapat Moore-Penrose inverse of a hollow symmetric and a predistance matrix

DOI 10.1515/spma-2016-0028 Received August 21, 2015; accepted June 10, 2016

Abstract: By a hollow we mean a symmetric matrix with zero diagonal elements. The no- tion contains those of predistance matrix and Euclidean as its special cases. By a centered symmetric matrix we mean a symmetric matrix with zero row (and hence column) sums. There is a one-to- one correspondence between the classes of hollow symmetric matrices and centered symmetric matrices, and thus with any hollow symmetric matrix D we may associate a centered symmetric matrix B, and vice versa. This correspondence extends a similar correspondence between Euclidean distance matrices and positive semidenite matrices with zero row and column sums. We show that if B has rank r, then the corresponding D must have rank r, r + 1 or r + 2. We give a complete characterization of the three cases. We obtain formulas for the Moore-Penrose inverse D+ in terms of B+, extending formulas obtained in Kurata and Bapat ( and Its Applications, 2015). If D is the distance matrix of a weighted tree with the sum of the weights being zero, then B+ turns out to be the Laplacian of the tree, and the formula for D+ extends a well-known formula due to Graham and Lovász for the inverse of the distance matrix of a tree.

Keywords: Euclidean distance matrix, Predistance matrix, Positive semidenite matrix, , Moore-Penrose inverse, , Tree

MSC: 15B48, 05C05

1 Introduction

A hollow symmetric matrix is a symmetric matrix with zero diagonal elements. If a hollow symmetric matrix is nonnegative (that is, all its elements are nonnegative), then it is called a predistance matrix. Let Sn be the + set of all n × n symmetric matrices, which is a linear space of dimension n(n + 1)/2. Let SH(n) and SH(n) be the set of hollow symmetric matrices and predistance matrices, respectively. That is,

SH(n) = {D = (dij) ∈ Sn | d11 = ... = dnn = 0}, (1) + SH(n) = {D = (dij) ∈ SH(n) | dij ≥ 0 (i, j = 1, ... , n)}.

+ Needless to say, while SH(n) is a linear subspace of Sn (with dimension n(n − 2)/2) , the set SH(n) is a convex + cone in Sn. The most important subset of SH(n) may be the set of n × n Euclidean distance matrices (EDMs). Here, an n × n predistance matrix D = (dij) is said to be an n × n EDM, if there exist n points p1, ··· , pn in r some Euclidean space R such that

2 dij = kpi − pjk (i, j = 1, 2, ··· , n), (2)

r where k · k is the Euclidean norm in R . The minimum of such r is called the embedding dimension of D.

*Corresponding Author: Hiroshi Kurata: Graduate School of Arts and Sciences, The University of Tokyo, Tokyo, 153-8902, Japan, E-mail: [email protected] Ravindra B. Bapat: Indian Statistical Institute, New Delhi, 110016, India, E-mail: [email protected]

© 2016 Hiroshi Kurata and Ravindra B. Bapat, published by De Gruyter Open. This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 License. Moore-Penrose inverse of a hollow symmetric matrix and a predistance matrix Ë 271

Recall that a symmetric matrix is said to be positive semidenite (psd) if its eigenvalues are all nonnega- tive. We write A  0 to denote that A is psd. By a centered symmetric matrix we mean a symmetric matrix with zero row (and hence column) sums. As is well known, a necessary and sucient condition for a predistance matrix D to be an EDM is that 1 1 T − PDP  0 with P = In − ee (3) 2 n (see, for example, Gower [6], pp. 82), where e denotes the vector of all ones of appropriate dimension. This characterization is based on a one-to-one correspondence between the set of EDMs and a set of positive semidenite (psd) matrices. To state this more precisely, let Λn be the set of n × n EDMs and let

Ωn(e) = {B ∈ Sn | B  0, Be = 0} be the set of n×n centered symmetric psd matrices, both of which form convex cones in Sn. Then the following two mappings τ and κ are mutually inverse:

1 T τ : Λn −→ Ωn(e): D −→ − PDP , 2 T T κ : Ωn(e) −→ Λn : B = (bij) −→ (bii + bjj − 2bij) = eb + be − 2B, (4)

T where b = (b11, b22, ··· , bnn) is the vector consisting of the diagonal elements of B (see for instance [9], pp.380). The matrix B is often referred to as the associated with the EDM D. EDMs can be classied into two types: spherical EDMs and nonspherical EDMs. An EDM D is called spher- r ical if the points p1, ··· , pn satisfying (2) are on a hypersphere in R . Otherwise it is called nonspherical. This paper is based on the following two results due to Tarazaga, Hayden and Wells [12] and Kurata and Bapat [10]. The former is on characterizations of spherical EDM, and the latter discusses matrices of spherical and nonspherical EDMs.

Proposition 1. (Theorems 2.1, 3.1 and 3.2 of Tarazaga, Hayden and Wells [12]) Let D ∈ Λn be an EDM and B = τ(D) be the corresponding psd matrix. Then D admits the following expression: 1 − D = B + zeT + ezT + λeeT, (5) 2 n where the quantities z ∈ R and λ ∈ R are given by

T T z = −(1/2)Pb and λ = −e b/n with b = (b11, ... , bnn) .

Furthermore, (i) D is spherical if and only if z ∈ R(B), (6) where R(·) denotes the range (column space) of a matrix. (ii) Let r = rank B. Then ( r + 1 if and only if D is spherical, rank D = (7) r + 2 if and only if D is nonspherical.

By denition, we have zTe = 0 and λ < 0 as long as D ≠ 0. It is well known that the rank of B coincides with the embedding dimension ([11], Theorem 1). The next result is concerned with the Moore-Penrose inverse of D, where for a matrix A, the Moore-Penrose inverse of A is dened as a matrix A+ satisfying the following four conditions:

(i) AA+A = A, (ii) A+AA+ = A+, (iii) (AA+)T = AA+, (iv) (A+A)T = A+A. (8)

As is well-known, the Moore-Penrose inverse always exists and is unique. (See, for example, page 9 of [2].) For an exposition of the theory of generalized inverse we refer to [4]. Note that when A is nonsingular, A+ = A−1. Thus in the following result, when D is nonsingular, we have a formula for D−1. 272 Ë Hiroshi Kurata and Ravindra B. Bapat

Proposition 2. (Theorems 3 and 4 of Kurata and Bapat [10]) Let D ∈ Λn be an EDM. The Moore-Penrose inverse D+ is expressed as follows: (i) When D is spherical, D+ B+ 1 xxT −2 = − nγ , (9) √ √ with x = e¯ + ( n/2)B+b and γ = eTb/n + bTB+b/4, where e¯ = e/ n. (ii) When D is nonspherical,

   T D+ B+ 1 xxT nγ y 1 x y 1 x −2 = − nγ + + nγ + nγ , √ with y = −2Z¯Z¯ Tb/( nbTZ¯Z¯ Tb), where Z¯ is an n × (n − r − 1) matrix such that

T T T Z¯ B = 0, Z¯ e = 0 and Z¯ Z¯ = In−r−1.

The above result is obtained in a dierent form by Balaji and Bapat [1], Theorems 3.1 and 3.4, which derived a formula for D+ for the rst time. In this paper, we extend the above two propositions on EDMs to the space SH(n) of hollow symmetric matrices and then derive some new results on the distance matrix of a tree. In Section 2, we discuss the rank of D ∈ SH(n) and clarify how it relates to the rank of B. The result gives not only an extension of (ii) of Proposition 1, but also an insight into the Laplacian matrix of a weighted tree. In Section 3, Proposition 2 is extended to a hollow symmetric matrix D. Section 4 is devoted to establishing some formulas on the distance matrix of a tree with possibly negative weights. Throughout this paper, we exclude the case D = 0, since it is trivial. Let SC(n) be the set of all n × n centered symmetric matrices:

SC(n) = {B ∈ Sn | Be = 0}, (10) which is a linear subspace of Sn and contains Ωn(e) as its subset. As shown by Critchley [5], Theorem 2.2, and Johnson and Tarazaga [9], pp.380, there is a one-to-one correspondence between SH(n) and SC(n). Indeed, the mapping τ and κ dened on Λn and Ωn(e) in (4) can be viewed as mappings between SH(n) and SC(n). Furthermore they are linear and still mutually inverse. This extension is the one that we consider from now on. Consider a connected graph G = (V, E) with vertex set V = {1, ... , n} and edge set E = {e, ... , em}. The Laplacian matrix of G is dened as the n × n symmetric matrix L = (`ij) indexed by the vertices such that, for i ≠ j, `ij = −1 if the vertices i and j are adjacent, `ij = 0 if i and j are not adjacent, and for each i, `ii = δi, where δi is the degree of the vertex i. It is well-known that the Laplacian matrix L is a centered psd matrix:

L  0 and Le = 0, (11) in other words, L ∈ Ωn(e). The rank of the Laplacian matrix of a connected graph equals always to n − 1. Moreover a connected graph is a tree if and only if m = n − 1, where m stands for the number of its edges. Let the distance matrix D = (dij) of a tree T be a nonnegative symmetric matrix such that dii = 0 (i = 1, ... , n) and dij is equal to the length (the number of edges) of the unique path between vertices i and j. Then, interestingly, D is a nonsingular spherical EDM and its inverse is expressed as

−1 1 1 T T D = − L + ττ with τ = (2 − δ , ... , 2 − δn) , (12) 2 2(n − 1) 1 which is a classical result due to Graham and Lovász [7], pp.66. (For a more detailed explanation on this topic, see, for example, Chapter 9 of Bapat [2].) As can be seen, for example, from (i) of Proposition 2, in the expression (9) of D+, the matrix B+ plays a role similar to the one played by the Laplacian matrix L in (12) in the sense that B+ is also a centered psd matrix: B  0 and B+e = 0. Moore-Penrose inverse of a hollow symmetric matrix and a predistance matrix Ë 273

2 Ranks of D and B = τ(D)

In this section, we clarify the relation between the ranks of a hollow symmetric matrix D and its corresponding matrix B = τ(D). Fix a hollow symmetric matrix D = (dij) ∈ SH(n). Then there exists a centered symmetric matrix B = (bij) ∈ SC(n) satisfying D = κ(B): D = ebT + beT − 2B, (13)

T where b = (b11, ... , bnn) . Although the vector b is nonnegative when D is an EDM, it is not necessarily nonnegative in our case. Let r = rank B. (14)

To calculate the rank of D, we begin with conrming that the equality (5) in Proposition 1 remains true even T when D is a hollow symmetric matrix. By using the identity In = P + (1/n)ee , we have

eTb b Pb e = + n .

Substituting it into (13) yields 1 − D = B − (1/2)beT − (1/2)ebT 2 eTb B PbeT ebTP eeT = − (1/2) − (1/2) − n = B + zeT + ezT + λeeT, (15)

T where z = −(1/2)Pb and λ = −(e b)/n. Thus we have extended (5) to the case in which D ∈ SH(n). We use (15) to calculate the rank of D. By the , there exists a matrix C¯ of order n × r matrix such that T T B = CΘ¯ C¯ , Θ = diag(θ1, ... , θr): r × r, C¯ C¯ = Ir , (16) θ ... θ θ ... θ where diag( 1, , r) denotes the with diagonal elements 1√, , r , which are the nonnull T eigenvalues of B. Since θi’s are nonnull, Θ is a nonsingular matrix. Let e¯ = e/ n so that e¯ e¯ = 1. Then there exists an n × (n − r − 1) matrix Z¯ such that

Γ = (e¯, C¯ , Z¯): n × n is an . Since zTe = 0, we can write z in (15) as

r n r z = Cp¯ + Zu¯ for some p ∈ R and u ∈ R − −1. (17)

Substituting (16) and (17) into (15) yields 1 √ √ − D = CΘ¯ C¯ T + n(Cp¯ + Zu¯ )e¯T + ne¯(Cp¯ + Zu¯ )T + nλe¯e¯T 2  √ √    nλ npT nuT e¯T √ = (e¯, C¯ , Z¯)  np Θ 0   C¯ T   √    nu 0 0 Z¯ T

= ΓUΓT (18) with  √ √  nλ npT nuT √ U =  np Θ 0  .  √  nu 0 0 274 Ë Hiroshi Kurata and Ravindra B. Bapat

Let  √  1 npTΘ−1 0   T =  0 Ir 0  . 0 0 In−r−1 Then the matrix U is further decomposed as  √  n(λ − pTΘ−1p) 0 nuT U = TUT˜ T with U˜ =  0 Θ 0  . (19)  √  nu 0 0

Since Γ and T are nonsingular, it holds that

rank D = rank U = rank U˜ .

By noting the location of zero matrices in U˜ , we can calculate its rank as √ ! n(λ − pTΘ−1p) 0 nuT rank U˜ = rank (0, Θ, 0) + rank √ nu 0 0 √ ! n(λ − pTΘ−1p) nuT = r + rank √ (since rank Θ = r). nu 0

Thus, when λ − pTΘ−1p ≠ 0, the rank is determined as ( r + 2 if u ≠ 0 rank D = (20) r + 1 if u = 0.

On the other hand, when λ − pTΘ−1p = 0, we have ( r + 2 if u ≠ 0 rank D = (21) r if u = 0.

By summarizing the above results in terms of the original notation, we obtain

Theorem 3. Let D be a hollow symmetric matrix and B = (bij) the corresponding centered symmetric matrix.   Let r = rank B and γ = eTb n + bTB+b 4. Then the rank of D is determined as  r if z ∈ R B and γ  ( ) = 0 rank D = r + 1 if z ∈ R(B) and γ ≠ 0 (22)   r + 2 if z ∉ R(B)

Proof. We only need to show that u = 0 ⇐⇒ z ∈ R(B) (23) and λ − pTΘ−1p = 0 ⇐⇒ eTb/n + bTB+b/4 = 0. (24) It follows from (17) that u = 0 is equivalent to z ∈ R(C¯). Since R(C¯) = R(B) (see (16)), the condition is further equivalent to z ∈ R(B). Thus (23) is proved. Next we check (24). By the denition of λ, it holds that λ = −eTb/n. By using (17), we see that p = C¯ Tz. Since z = −(1/2)Pb (by denition) and PC¯ = C¯ (since C¯ Te = 0), we have 1 p = − C¯ Tb. 2 Moore-Penrose inverse of a hollow symmetric matrix and a predistance matrix Ë 275

Furthermore, as is easily seen, B+ = CΘ¯ −1C¯ T holds and hence 1 1 pTΘ−1p = bTCΘ¯ −1Cb¯ = bTB+b. 4 4 Thus (24) is obtained. The proof is complete.

As in (ii) of Proposition 1, when D is an EDM, the case where rank D = rank B does not happen. That is, no   EDM (except D = 0) satises the condition −eTb n = bTB+b 4. Indeed, if D is an EDM, the corresponding  B is psd and hence B+ is also psd and b is nonnegative nonnull vector, which implies bTB+b 4 ≥ 0 and  −eTb n < 0, and thus the equality does not hold. On the other hand, the above theorem suggests that when D is extended to a hollow symmetric matrix, its rank may be equal to rank B. Hence it is of interest to ask whether there exists a hollow symmetric matrix D that satises the condition −eTb/n = bTB+b/4. The answer is armative. But since, to explain an example of such matrices, we need the notion of weighted tree, we postpone it to Section 4. See Theorem 12, in which it is shown that a “distance matrix” of a weighted tree with arbitrary weights satises the condition if the total sum of the weights is zero. In this case, the distance between vertices i, j is dened as the sum of the weights of the edges in the unique path between i and j, if i ≠ j, and 0 if i = j. Hence the resulting distance matrix is a hollow symmetric matrix that may have some negative elements.

3 Moore-Penrose Inverse of a Hollow Symmetric Matrix

In this section, we derive the Moore-Penrose inverse of a hollow symmetric matrix, which can be viewed as an extension of Proposition 2. As is stated in (18) and (19), D is of the form

−(1/2)D = ΓTUT˜ TΓT, where the two matrices Γ and T are nonsingular. We will see below that the Moore-Penrose inverse can be expressed as −2D+ = Γ(T−1)TU˜ +T−1ΓT, (25) where T−1 is given by  √  1 − npTΘ−1 0 −1   T =  0 Ir 0  . 0 0 In−r−1 To see this, recall that, in general, for any orthogonal matrix H and any symmetric matrix S, the equality (HSHT)+ = HS+HT holds. Applying this fact, we have

−2D+ = Γ(TUT˜ T)+ΓT.

Thus it suces to show that (TUT˜ T)+ = (TT)−1U˜ +T−1. (26)

Here, we should note that for any nonsingular matrix G and any symmetric matrix S, the equality (GSGT)+ = (GT)−1S+G−1 does not necessarily hold. (More precisely, while the matrix in the right hand side always satis- es the conditions (i) and (ii) in (8), it does not always satisfy (iii) and (iv). In other words, the matrix is just a {1,2}-inverse of GSGT.) However, as will be seen below, both T and U˜ + are of quite simple structure, due to which the equality (26) happens to be valid. That is, the matrix in the right hand side of (26) will turn out to meet the conditions (iii) and (iv). The Moore-Penrose inverse of D takes dierent forms according to whether z ∈ R(B) holds or not. 276 Ë Hiroshi Kurata and Ravindra B. Bapat

Theorem 4. Let D be a hollow symmetric matrix such that z ∈ R(B) and γ ≠ 0, where γ = bTB+b/4 + eTb/n. Then the Moore-Penrose inverse D+ is expressed as

D+ B+ 1 xxT −2 = − nγ , (27) √ where x = e¯ − ( n/2)B+b.

Proof. Since z ∈ R(B) is equivalent to u = 0 in (17), the matrix U˜ reduces to     n(λ − pTΘ−1p) 0 0 −nγ 0 0 ˜     U =  0 Θ 0  =  0 Θ 0  , 0 0 0 0 0 0 whose inverse is easily obtained as   −(1/nγ) 0 0 ˜ +  −1  U =  0 Θ 0  . 0 0 0

We need to prove that (26) is valid. To do so, it suces to show that the two matrices n o n o (TUT˜ T) (TT)−1U˜ +T−1 and (TT)−1U˜ +T−1 (TUT˜ T) are symmetric. As is stated above, since U˜ + and T have quite simple forms, both of them happens to be sym- metric. Indeed, by a direct calculation, we have   0 0 n o 1 ˜ T T −1 ˜ + −1 ˜ ˜ + −1   (TUT ) (T ) U T = TUU T =  0 Ir 0  (symmetric) 0 0 0 and   0 0 n o 1 T −1 ˜ + −1 ˜ T −1 ˜ ˜ +   (T ) U T (TUT ) = T UU T =  0 Ir 0  (symmetric). 0 0 0

Thus we have −2D+ = Γ(TT)−1U˜ +T−1ΓT. Since Γ(T−1)T = (x, C¯ , Z¯) holds, the Moore-Penrose inverse of −(1/2)D is derived as     −(1/nγ) 0 0 xT + ¯ ¯  −1   ¯ T  −2D = x, C, Z  0 Θ 0   C  0 0 0 Z¯ T

1 xxT CΘ¯ −1C¯ T = − nγ + . The proof is complete.

Next we consider the case of z ∉ R(B), in which the approach taken above also works.

Theorem 5. Let D be a hollow symmetric matrix such that z ∉ R(B). Then the Moore-Penrose inverse D+ is expressed as −2D+ = B+ + xyT + yxT + nγyyT and hence if γ ≠ 0,    T D+ B+ 1 xxT nγ y 1 x y 1 x −2 = − nγ + + nγ + nγ  √ where y = −2Z¯Z¯ Tb ( nbTZ¯Z¯ Tb). Moore-Penrose inverse of a hollow symmetric matrix and a predistance matrix Ë 277

Proof. It is straightforward to see that the Moore-Penrose inverse of U˜ in (19) is given by  √  0 0 uT/( nuTu) U˜ + =  0 Θ−1 0  .  √  uT/( nuTu) 0 γuuT/(uTu)2

As in the proof of Theorem 4, we need to prove that (26) is valid. That is, it is necessary to show that the two matrices (TUT˜ T){(TT)−1U˜ +T−1} = TU˜ U˜ +T−1 and {(TT)−1U˜ +T−1}(TUT˜ T) = T−1U˜ U˜ +T are symmetric. By a direct but simple calculation again, we have   1 0 0 ˜ ˜ + −1   TUU T =  0 Ir 0  (symmetric) 0 0 1 uuT uT u and   1 0 0 −1 ˜ ˜ +   T UU T =  0 Ir 0  (symmetric). 0 0 1 uuT uT u

Thus we have −2D+ = Γ(TT)−1U˜ +T−1ΓT. Since Γ(T−1)T = (x, C¯ , Z¯) holds, the Moore-Penrose inverse of D is derived as  √    0 0 uT/( nuTu) xT  −2D+ = x, C¯ , Z¯  0 Θ−1 0   C¯ T   √    u/( nuTu) 0 γuuT/(uTu)2 Z¯ T √ = B+ + xaT + axT + nγaaT with a = Zu¯ /( nuTu), where the equalities B+ = CΘ¯ −1C¯ T is used. Finally we show that a is equal to y that is dened in the statement of the theorem. To do so, use u = Z¯ Tz = −(1/2)Z¯ Tb. Then we have  √  √  √ a = Zu¯ ( nuTu) = Z¯Z¯ Tz ( nzTZ¯Z¯ Tz) = −2Z¯Z¯ Tb ( nbTZ¯Z¯ Tb) = y.

Thus we have −2D+ = B+ + xyT + yxT + nγyyT.

This completes the proof. Finally we consider the case in which z ∈ R(B) and γ = 0. In this case, (25) is not true. But the matrix U in (18) is simple enough to calculate the Moore-Penrose inverse directly. Indeed, U is of the form  √ √   √  nλ npT nuT npTΘ−1p npT 0 √ √ U =  np Θ 0  =  np Θ 0  ,  √    nu 0 0 0 0 0

T −1 since γ = 0 ⇐⇒ λ = p Θ p and z ∈ R(B) ⇐⇒ u = 0. By letting Θ1 and Θ2 be any diagonal matrices such that Θ = Θ1Θ2, we have the following maximal rank decomposition: √ ! √ ! npTΘ−1p npT npTΘ−1Θ−1p npT √ = √2 1 np Θ np Θ1Θ2 √ ! T −1 √  np Θ2 −1 = nΘ1 p, Θ2 Θ1 = XYT (say), 278 Ë Hiroshi Kurata and Ravindra B. Bapat where X and Y are (r + 1) × r full rank matrices. Thus the Moore-Penrose inverse of XYT is given by (XYT)+ = Y(YTY)−1(XTX)−1XT √ ! npT √ = G−1ΘG−1( np, Θ) with G = nppT + Θ2, Θ from which we have  √  npTG−1ΘG−1p npTG−1ΘG−1Θ 0 √ +  −1 −1 −1 −1  U =  nΘG ΘG p ΘG ΘG Θ 0  , 0 0 0 and hence   e¯T + + T ¯ ¯ +  ¯ T  −2D = ΓU Γ = (e¯, C, Z)U  C  Z¯ T √ √ = ( nep¯ T + CΘ¯ )G−1ΘG−1( npe¯T + ΘC¯ T). (28)

Theorem 6. Let D be a hollow symmetric matrix such that z ∈ R(B) with γ = 0. Then the Moore-Penrose inverse −2D+ is expressed as (28).

4 Distance Matrix of a Tree with Arbitrary Weights

Let T be a weighted tree with vertex set V(T) = {1, ... , n} and edge set E(T) = {e1, ... , en−1}, where the edge ej is assigned the weight wj , which we assume to be a (possibly negative). The distance dij between vertices i and j is dened to be the sum of the weights of the edges on the (unique) ij-path. We set dii = 0, i = 1, ... , n. The distance matrix D of T is the n × n matrix D with its (i, j)-element equal to dij . Needless to say, D = (dij) is a hollow symmetric matrix: D ∈ SH(n). If the weights are all nonzero, then the Laplacian matrix L = (`ij) of T is dened as follows. The rows and the columns of L are indexed by V(T). For i ≠ j, the (i, j)-element of L is zero if i and j are not adjacent and it is −1/w({i, j}) if i and j are adjacent, where {i, j} is the edge joining i and j and w({i, j}) denotes the weight {i j} i ... n ` P ` L ∈ S n assigned on , . For = 1, , , the element ii is set equal to − j≠i ij . It is obvious that C( ), and as will be seen soon, the Laplacian matrix thus dened is also the Laplacian matrix of D in our sense. That is, L is the Moore-Penrose inverse of B = τ(D). (See Lemma 10 below.)

Example Consider the weighted tree ◦6 ◦3 AA } AA 2 −5 }} AA }} AA }} −4 } −1 ◦1 ◦2 ◦4 } AA 9 }} AA −1 } AA }} AA }} 7 ◦5 Its distance matrix is   0 −4 −9 −5 −5 2 9    −4 0 −5 −1 −1 −2 5     −9 −5 0 −6 −6 −7 0    D =  −5 −1 −6 0 −2 −3 4       −5 −1 −6 −2 0 −3 4     2 −2 −7 −3 −3 0 11  9 5 0 4 4 11 0 Moore-Penrose inverse of a hollow symmetric matrix and a predistance matrix Ë 279

and its Laplacian matrix is   13/36 1/4 0 0 0 −1/2 −1/9    1/4 −49/20 1/5 1 1 0 0     0 1/5 −1/5 0 0 0 0    L =  0 1 0 −1 0 0 0  .      0 1 0 0 −1 0 0     −1/2 0 0 0 0 1/2 0  −1/9 0 0 0 0 0 1/9

If T is an unweighted tree (that is, wj = 1, j = 1, ... , n − 1) with n vertices, then according to a classical result of Graham and Pollak [8], pp.2511, the determinant of D is given by det D = (−1)n−1(n−1)2n−2. Thus the determinant of the distance matrix depends only on the number of vertices. A formula for D−1 was given by Graham and Lovász [7], pp.66. Extensions of these results for weighted trees have been obtained, for example, by Bapat, Kirkland and Neumann [3], Theorem 2.1. We state the results next. It may be remarked that the trees in which some of the edge-weights are negative have not been considered in the literature. Thus the results in [3] were proved assuming that all the weights are positive. However the proof reveals that the results hold even when the weights are more general. To state them, we denote the degree of the vertex i by δi , i = 1, ... , n. We set τi = 2 − δi , i = 1, ... , n and let τ be the n × 1 vector with components τ1, ... , τn .

Theorem 7. (Bapat, Kirkland and Neumann [3]), Theorem 2.1 and Corollary 2.5 Let T be a weighted tree with vertex set V(T) = {1, ... , n}, let D and L be the distance matrix and the Laplacian of T, respectively. Then the following assertions hold: n−1 n−2 P Q (i) det D = (−1) 2 ( j wj)( j wj) (ii) Let the weights be all nonzero and suppose Pn−1 w Then D is nonsingular and j=1 j ≠ 0.

1 1 D−1 = − L + ττT. 2 Pn−1 w 2 j=1 j

+ P In this section we obtain a formula for D , when j wj = 0, thereby extending (ii) of Theorem 7 to the case when D is singular. The following result is known for an unweighted tree (see [2],Lemma 9.7). We include a proof which is dierent from the one given in [2] for the unweighted case. Recall that we denote by e the vector of all ones of the appropriate size.

Lemma 8. Let T be a weighted tree with vertex set V(T) = {1, ... , n}. Let D be the distance matrix of T. Then

 n  X−1 Dτ =  wj e. j=1

Proof. Let i ∈ V(T) be xed. For j ∈ V(T), j ≠ i, let j(i) be the predecessor of j on the i − j path. Then dij = dij(i) + w({j(i), j}). Since dii = 0, we have

n X X X dij = dij(i) + w({j(i), j}). (29) j=1 j≠i j≠i 280 Ë Hiroshi Kurata and Ravindra B. Bapat

Note that any vertex k adjacent to j appears as a predecessor of a path to j precisely δk − 1 times. We have

n n n X X X 2 dij = dij + dij j=1 j=1 j=1 X X X = dij + dij(i) + w({j(i), j}) j≠i j≠i j≠i n X X X−1 = dij + (δk − 1)dik + w` j≠i k≠i `=1 n X X−1 = δk dik + w` k≠i `=1

It follows that n n X X dij τj = dij(2 − δj) j=1 j=1 n n X X = 2 dij − δj dij j=1 j=1 n X−1 = w` `=1 and the proof is complete.

The next result is known for the case of an unweighted tree (see [2], Lemma 9.8). The proof for the weighted case is similar and is omitted.

Lemma 9. Let T be a weighted tree with vertex set V(T) = {1, ... , n} with all the weights being nonzero. Let D be the distance matrix of T and let L be the Laplacian of T. Then

T T LD + 2In = τe , DL + 2In = eτ , LDL = −2L.

By using the lemma, let us conrm

Lemma 10. L is the Moore-Penrose inverse of B:

L = B+.

Proof. Since LP = PL = L holds, the last equality in Lemma 9 can be expressed as

LPDPL = −2L, (30) which is equivalent to LBL = L. Thus L satises the condition (ii) in (8). Similarly, by postmultiplying the rst equality in Lemma 9 by P and using L = LP, we have LPDP + 2P = τeTP, which is further expressed as LB − P = 0 since Pe = 0. This shows that LB is symmetric. By arguing in the same way, we can prove that BL is also symmetric. Finally, premultiplying LB − P = 0 by B and using BP = B entails BLB = B. Thus L satises the four conditions in (8), or equivalently, L = B+.

The following is the main result of this section.

Theorem 11. Let T be a weighted tree with vertex set V(T) = {1, ... , n}, with all the weights being nonzero, and suppose Pn−1 w Let D be the distance matrix of T and let L be the Laplacian of T Then D is singular `=1 ` = 0. . and 1 D+ = − L + uτT + τuT, 2 Moore-Penrose inverse of a hollow symmetric matrix and a predistance matrix Ë 281 where   1 eTD+e u = D+e − τ . 2 4

n−1 n−2 P Proof. First note that by Theorem 7, det D = (−1) 2 ` w` = 0 and hence D is singular. Let i be a pendant vertex of T and let D(i, i) be the submatrix obtained by deleting row i and column i of D. Then D(i, i) is the T {i} D D n Pn−1 w distance matrix of \ , and by Theorem 7, det ≠ 0. Thus has rank − 1. Since `=1 ` = 0, then by Lemma 8, Dτ = 0. Thus τ spans the null space of D and hence T + + ττ DD = D D = In − , (31) τTτ which is the projection on the orthogonal complement of the null space of D. Let 1 H = − L + uτT + τuT, 2 u Dτ 0 DH 1 DL DuτT where is as given in the hypothesis. Since = , then = − 2 + . By Lemma 9 and (31) it follows DH I ττT HD I ττT DH HD that = n − τT τ . It can be shown similarly that = n − τT τ . Thus both and are symmetric. Also DHD D I ττT D HDH H = ( n − τT τ ) = . It remains to verify = . A simple computation shows that uTDu = eTu. (32)

Using Lemma 9 and (32) we have 1 HDH = (− L + uτT + τuT)DH 2 1 1 = (− LD + τuTD)(− L + uτT + τuT) 2 2 1 1 1 = LDL − LDuτ − τuTDL + τuTDuτ 4 2 2 T T T 1 τe T T e τ T T = − L + (In − )uτ + τu (In − ) + (u Du)ττ 2 2 2 1 = − L + uτT + τuT − (eTu)ττT + uTDu(ττT) 2 = H, in view of (32). Hence H = D+ and the proof is complete.

We end this paper with an answer to the question, raised in the end of Section 2, of whether there exists a hollow symmetric matrix D such that rank D = rank B. Let T be a weighted tree with vertex set V(T) = {1, ... , n}, with all the weights being nonzero, and Pn−1 w D T L ` T suppose `=1 ` = 0. Let be the distance matrix of , = ( ij) the Laplacian matrix of . It is well- known that L has rank n − 1 and as observed in the proof of Theorem 11, D has rank n − 1 as well. Thus rank D = rank L = rank B. In the next result we prove an identity which is of independent interest, thereby providing another veri- cation of fact that rank D = rank B.

Theorem 12. Let T be a weighted tree with vertex set V(T) = {1, ... , n}, with all the weights being nonzero, and suppose Pn−1 w Let D be the distance matrix of T, L ` the Laplacian matrix of T, B b the `=1 ` = 0. = ( ij) = ( ij) T Moore-Penrose inverse for L, and b = (b11, ... , bnn) . Then the equality

bTB+b 4 eTb + n = 0 (33) holds.

−1 Proof. Let X = (xij) = (L + (1/n)J) , where J is the n × n matrix of all ones. Since Le = 0, the matrix X is nonsingular and satises X−1e = e and Xe = e. By using L = X−1 − (1/n)J, we can easily see that

L+ = X − (1/n)J. 282 Ë Hiroshi Kurata and Ravindra B. Bapat

On the other hand, the vector τ is expressed as (see Lemma 10.8, [2],p.140)

τ LXe˜ 2 e X˜ {x ... x } = + n with = diag 11, , nn   L b 1 e 2 e = + n + n

Lb 2 e = + n . (34) From (34) we get the equations bTτ bTLb 2 bTe = + n . (35) and L+τ L+ Lb 2 e I n J b = ( + n ) = ( − (1/ ) ) = (36) Using D = ebT + beT − 2L+ we get

Dτ = ebTτ + 2b − 2L+τ ebTLb 2 ebTe b I n J b = + n + 2 − 2( − (1/ ) ) by (35), (36) bTLb e 4 eTbe eTτ = ( ) + n since = 2. Since Dτ = 0 by Lemma 8 and since L = B+, it follows from the preceding equation that

bTB+b 4 eTb + n = 0 and the proof is complete.

Since rank B = rank L = n − 1 and since eTz = 0, where z is as in Theorem 3, it follows that z ∈ R(B). Now using (22) and Theorem 12 we get rank D = rank B.

Acknowledgement: We sincerely thank two anonymous referees for a careful reading of the manuscript and for several helpful comments. This research is nancially supported by Grants-in-Aid for Scientic Research (Kiban (C), 26330035). The second author acknowledges support from the JC Bose Fellowship, Department of Science and Technology, Government of India as well as hospitality during his visit to the University of Tokyo where this work was initiated.

References

[1] R. Balaji and R. B. Bapat, On Euclidean distance matrices, Linear Algebra Appl., 424 (2007), 108-117. [2] R. B. Bapat, Graphs and matrices (2nd ed.), Springer, 2014. [3] R. B. Bapat, S. J. Kirkland and M. Neumann, On distance matrices and Laplacians, Linear Algebra Appl., 401 (2005), 193- 209. [4] A. Ben-Israel and T.N.E. Greville, Generalized Inverses: Theory and Applications, Wiley-Interscience, 1974. [5] F. Critchley, On certain linear mappings between inner products and squared distance matrices, Linear Algebra Appl., 105 (1988), 91-107. [6] J. C. Gower, Properties of Euclidean and non-Euclidean distance matrices. Linear Algebra Appl., 67 (1985),81-97. [7] R. L. Graham and L. Lovász, Distance matrix polynomials of trees, Adv. Math., 29 (1978), no. 1, 60-88. [8] R. L. Graham and H. O. Pollak, On the addressing problem for loop switching, Bell System Technology Journal, 50 (1971), 2495-2519. [9] C. R. Johnson and P. Tarazaga, Connections between the real positive semidenite and distance matrices completion prob- lems, Linear Algebra Appl., 223/224 (1995), 375-391. [10] H. Kurata and R. B. Bapat, Moore-Penrose inverse of a Euclidean distance matrix, Linear Algebra Appl., 472 (2015), 106-117. [11] I. J. Schoenberg, Remarks to Maurice Fréchet’s article “Sur la dénition axiomatique d’une classe d’espace distanciés vectoriellement applicable sur l’espace de Hilbert” Ann. of Math. (2), 36, 1935, 724-732. [12] P. Tarazaga, T. L. Hayden and J. Wells, Circum-Euclidean distance matrices and faces, Linear Algebra Appl., 232 (1996), 77-96.