arXiv:1808.03411v2 [cs.DS] 20 Nov 2018 mle hti ssnua.A singular. is it that implies fcnetdcmoet.Let components. connected of Let Introduction 1 05C05. 15A15, Classifications. Subject AMS ijitunion disjoint | hr 1 where nFigure in arxo order of matrix of rp bandfo h ijitunion disjoint the from obtained graph h eemnn of determinant the vr lc fagahi opeegahte ti alda called is it then graph complete a is graph a of block every s merging is, ult [ nullity once rp a octvre,te tisl sabok h blo The block. a [ is time itself linear it then in cut-vertex, no has graph connected and r r called are coalescence ⋆ V ( G iertm loih ocektesnuaiyo lc grap block of singularity the check to algorithm time Linear onaino hn n h salSineFudto (Nos. Foundation Science Israel Progra Research the NSFC-ISF and Joint China the of by Foundation supported is work This ( G G elkonpolm rpsdi 97 yClazadSngwt,i t is Sinogowitz, and Collatz by 1957, in proposed problem, well-known A A + ) G { eoe by denoted , ) 1 | block yBptadRyi 03 nti ril,w iealna time linear a give we Keywords: article, not. this or In singular 2013. is in graph Roy block and Bapat by bloc nonsingular Characterizing (singular). nonsingular Abstract. rp n let and graph ( = , A as called (also η 10 20 ≤ ( ( 1 G G , daetblocks adjacent V .Nliyo rpsi plcbei aiu rnhso cec,i partic in science, of branches various in applicable is graphs of Nullity ]. a,weetebok r h nue ugaho h vertex-se the on subgraph induced the are blocks the where (a), 8 ,j i, = ) .If ). v nagahi aia once ugahta a ocut-vertex no has that subgraph connected maximal a is graph a in ( v , G 1 9 ilhv opo egt( weight of loop a have will v , } ) G 11 ≤ E , o oedtiso h lc rpsse([ see graphs block the on details more For . n G 2 n. 1 .Aboki graph a in block A ]. lc rp sagahi hc vr lc sacmlt grap complete a is block every which in graph a is graph block A noasnl vertex single a into + n. endby defined ( a ulrn,ta is, that , full has η lc,bokgah osnua rp,nullity graph, nonsingular graph, block block, hsazr ult fagraph a of nullity zero a Thus G ( A A h re of order the G ave Singh Ranveer G )b nietdgahwt etxset vertex with graph undirected a be )) graph A ( ( 2 2 G ) G , stegraph the is eis(,)ajcnymti.Graph matrix. (0,1)-adjacency its be ) h a tr ere alyClee ere aly19300, Valley Yezreel College, Valley Yezreel Stern Max The snneo(eo.The (zero). nonzero is ) seult h ubro eoegnausof eigenvalues zero of number the to equal is fte hr u-etxof cut-vertex a share they if 3 1 a ij ehinIre nttt fTcnlg,Hia300 Isr 32000, Haifa Technology, of Institute Technion-Israel ehinIre nttt fTcnlg,Hia300 Isr 32000, Haifa Technology, of Institute Technion-Israel cut-vertex = G G ( 1 G scalled is if 0 ftevertices the if 1 ( = eeulto equal be ) 1 am Shaked-Monderer Naomi , G V v 1 1 G If . G i + r E , of = ( 1 α G scle a called is G osnua (singular) nonsingular + [email protected] 1 1 G [email protected] v j [email protected] 2 = ) and ) 1 + G or ( = and , savre hs eoa eut na nraei h number the in increase an in results removal whose vertex a is α 2 n ,j i, 2 yietfigavertex a identifying by V n then , ). rank 1 G h daec matrix adjacency The . v ∪ G r o once ya edge an by connected not are 2 ,j i, 2 edn block pendant V ( = G mle hti snniglrwieapstv nullity positive a while nonsingular is it that implies aeloso weights of loops have 2 of r once ya edge an by connected are G opeegahon graph complete A . E , V rpsi nitrsigoe rbe proposed problem open interesting an is graphs k G snniglr tews,i ssnua.The singular. is it otherwise, nonsingular, is 2 1 E , eoe by denoted , ∪ 2 16110,2219/15). 11561141001, G lc graph block ,Catr7). Chapter ], jityfne yteNtoa aua Science Natural National the by funded (jointly m E 2 2 V egah ndson eso etcs Their vertices. of sets disjoint on graphs be ) n baa Berman Abraham and , scle osnua snua)if (singular) nonsingular called is 2 , ) , ( . G k n u-etcsi n rp a found can graph any in cut-vertices and cks if A fi a n u-etxof cut-vertex one has it if n deset edge and ) A loih ocekwehragiven a whether check to algorithm coalescence ( G v neapeo lc rp sgiven is graph block of example An . A is ) 1 ts r ( hrceiegah ihpositive with graphs characterize o ( of G A G { α 3 .B h aknliytheorem rank-nullity the By ). osnua (singular) nonsingular ( G ) G , , 1 n 1 5 α , stern fteadjacency the of rank the is ( = ) ael ael , etcsi eoe by denoted is vertices ihavertex a with , fgraphs of , Israel 6 2 ([ .Let h. , E , lr unu chemistry, quantum ular, 21 7 epciey hni the in then respectively, ( } a G ,p1) oeta fa if that Note p.15). ], , ij { 3 .Lttecardinality the Let ). 1 of ) G , 4 G , eablock a be 3 G 1 , G 2 v and A stesquare the is w blocks Two . } 2 ( , G of { is ) 2 G htis, that , G hs , 2 11 2 nullity K sany is that , , 12 n ⋆ If . } , H¨uckel molecular orbital theory [9,14] and social networks theory [15]. There has been significant work on the nullity of undirected graphs like trees [6,8,10], unicyclic graphs [12,16,12], and bicyclic graphs [3,5,23]. It is well-known that a tree is nonsingular if and only if it has a perfect matching. Since a tree is a block graph, it is natural to investigate in general which block graphs are nonsingular. The combinatorial formulae for the determinant of block graphs are known in terms of size and arrangements of its blocks [4,18,17]. But, due to a myriad of the possibility of sizes and arrangements of the blocks it is difficult in general to classify nonsingular or singular block graphs. In [19], some classes of singular and nonsingular block graphs are given. However, it is still an open problem. In this paper, we give a linear time algorithm to determine whether a given graph is singular or not. Thanks to the eminent computer scientist Alan Turing, the matrix determinant can be computed in the polynomial time using the LUP decomposition of the matrix, where L is a lower triangular matrix, U is an upper triangular matrix, P is a permutation matrix. Interestingly, the asymptotic complexity of the matrix determinant is the same as that of matrix multiplication of two matrices of the same order. The theorem which relates the complexity of matrix product and the matrix determinant is as follows.

Theorem 1. [1] Let M(n) be the time required to multiply two n × n matrices over some ring, and A be an n × n matrix. Then, we can compute the determinant of A in O(M(n)) steps.

Rank, nullity is also calculated using LUP decomposition, hence their complexities are also the same as that of the matrix determinant or product of two matrices of the same order. The fastest matrix product takes time of O(n2.373)[7,22,13]. In this article, we give a linear time algorithm to check whether a given block graph G of order n, is singular or nonsingular (full rank). The algorithm is linear in n. We will not make use of matrix product or elementary row/column operations during any stage of the computation, instead, we prove first results using elementary row/column operation on matrices and use them to treat pendant blocks of the block graphs. The rest of the article is organised as follows. In Section 2, we mention some notations and preliminar- ies used in the article. In Section 3, we give necessary and sufficient condition for any block graph to be nonsingular by using prior results of elementary row/column operation given in Section 2. In Section 4, we provide an outline for Algorithm 1 and provide some examples in support of it. A proof of the correctness of Algorithm 1 is given in Section 5.

2 Notations and preliminary results

If Q is a subgraph of graph G, then G \ Q denotes the induced subgraph of G on the vertex subset V (G) \ V (Q). Here, V (G) \ V (Q) is the standard set-theoretic subtraction of vertex sets. If Q consists of a single vertex v, then we write G \ v for G \ Q. J, j, O, o denote the all-one matrix, all-one column vector, zero matrix, zero column vector of suitable order, respectively. w denotes a (0, 1)-column vector of suitable order. diag(x1,...,xn) denotes the diagonal matrix of order n, where the i-th diagonal entry is xi,i = 1,...,n. If a graph has no vertices (hence no edges) we call it a void graph.

Theorem 2. Consider a matrix x1 1 ... 1 .. .  1 x2 . .  M = = J − D, (1) . . .  . .. .. 1     1 ... 1 x   n   where D = diag(1 − x1,..., 1 − xn).

1. If exactly one of x1,...,xn is equal to 1, then M is nonsingular. 2. If any two (or more) of x1,...,xn are equal to 1, then M is singular. 3. If xi 6=1,i =1,...,n. Let n 1 S = . 1 − x i=1 i X Then (a) M is nonsingular if and only if S 6=1. (b) if S =1 and xn+1 is any real number, then the matrix

M j jT x  n+1 is nonsingular. 4. If M is nonsingular, then the matrix M j M˜ = jT α   can be transformed to the following matrix using elementary row and column operations M o , oT α + γ   where − S if x 6=1,i =1, . . . n, γ = S−1 i (2) (−1 if exactly one of x1,...,xn is equal to 1.

Proof. 1. Without loss of generality, let x1 = 1. By subtracting the 1-st row from the rest of the rows, M can be transformed to the matrix, 1 1 ... 1 . . 0 (x − 1) .. .  2  , . . . . .. .. 1    0 ... 0 (x − 1)  n  n   whose determinant i=2(xi − 1) is nonzero. 2. In this case two rows (or columns) are the same. 3. (a) We have Q D − J = D1/2(I − D−1/2JD−1/2)D1/2, T D−1/2JD−1/2 = D−1/2jjT D−1/2 = D−1/2j D−1/2j . Let y = D−1/2j. The J − D = M is nonsingular if and only if I− yyT is nonsingular. Since the eigenvalues of yyT are ||y||2 = yT y and 0, the eigenvalues of the matrix I − yyT are 1 − ||y||2 and 1 hence it is nonsingular if and only if ||y||2 6=1. That is M is nonsingular if and only if

n 1 6=1. 1 − x i=1 i X (b) i. If xn+1 6=1: as S =1, this implies 1 S + 6=1. 1 − xn+1 Hence the result follows by 3(a). ii. If xn+1 = 1 : then result follows by 1. −1/2 4. (a) If xi 6=1,i =1,...n. Let y = D j. We have, (I − yyT )(I + tyyT )= I + (t − 1 − t||y||2)yyT ,

and therefore if ||y||2 6=1, 1 (I − yyT )−1 = I + yyT . 1 − ||y||2

Thus if J − D is invertible, where di =1 − xi, then, by the above, 1 (J − D)−1 = −(D − J)−1 = −D−1/2 I + yyT D−1/2, 1 − ||y||2   where y = D−1/2j.

1 jT M −1j = −jT D−1/2 I + yyT D−1/2j 1 − ||y||2   1 ||y||2 = −yT I + yyT y = . 1 − ||y||2 ||y||2 − 1   Let I −M −1j P = . oT 1   Then M o P T MP˜ = , oT α + γ   where ||y||2 S γ = −jT M −1j = − = − . ||y||2 − 1 S − 1

(b) When exactly one of x1,...,xn is equal to 1, without loss of generality, x1 =1, we can write

1 1 ... 1 1 .. . . 1 x2 . . .  M˜ = . . . . .. .. 1 1   1 ... 1 x 1  n  1 ... 1 1 α     On subtracting the first column from the last column, and subsequently subtracting the first row from the last row. We get the following matrix,

1 1 ... 1 0 .. . . 1 x2 . . .  M˜ = . . . , . .. .. 1 0    1 ... 1 x 0   n  0 ... 0 0 α − 1     hence γ = −1.

Lemma 1. [18, Lemma 2.3] If G is a coalescence of G1 and G2 at a vertex v having loop of weight α, then

det(G) = det(G1) det(G2 \ v) + det(G1 \ v) det(G2) − α det(G1 \ v) det(G2 \ v).

3 Transformation of the

Elementary row/column operations transform the adjacency matrix A(G) into another matrix EA(G), which may have nonzero diagonal entries. The graph corresponding to EA(G) can be obtained by a change of weights on the edges and addition of loops on the vertices in G according to the elementary row/column operations on A(G). This can be seen as follows. Let B be a pendant block of a block graph G, having the cut-vertex v of G. As reordering the vertices of G does not change the rank of G, we can write the adjacency matrix A(G) as the follows. A(B \ v) j OT A(G)= jT 0 wT .  O w A(G \ B) Let the pendant block B have m vertices.   6 6 6 6

5 7 5 7 5 7 5 7

− 3 − 3 − 3 2 2 2 4 3 4 3 4 3 4 3

11 11 11 11

1 2 1 2 1 2 1 − 9 2 − 3 − 3 4 12 12 2 12 2 12

10 9 10 9 10 9 10 9

8 8 8 8 (a) (b) (c) (d)

Fig. 1: Results of elementary row/column operations on the succesive pendant blocks of the block graph in (a). In (d) all the four weighted induced subgraphs are nonsingular, hence, the block graph in (a) is nonsingular.

5 4 5 4 5 4 5 4

−2 −2 −2 3 3 3 3

6 6 6 6

1 2 1 2 1 2 1 2 −2 7 7 −2 7 −2 7

8 9 8 9 8 9 8 9 (a) (b) (c) (d)

Fig. 2: Results of elementary row/column operations on the succesive pendant blocks of the block graph in (a). In (d) the weighted induced subgraph on vertices 1, 2, 3 is singular, hence, the block graph in (a) is singular.

5 4 3 5 4 3

6 1 2 6 1 2

7 8 9 7 8 9 (a) (b)

Fig. 3: Results of elementary row/column operations on the succesive pendant blocks of the block graph in (a). In (d) there are isolated vertices with zero weights, hence, the block graph in (a) is singular. 1. If m ≥ 3: as A(B \ v) is the complete graph on m − 1 ≥ 2 vertices, it is nonsingular. All the diagonal elements in A(B \ v) are zero. Using Theorem 2(4), A(G) is transformed to the following matrix. A(B \ v) o OT M = oT − m−1 wT . 1  m−2  O w A(G \ B)   Let − m−1 wT M = m−2 . 12 w A(G \ B)   We have, r(A(G)) = r(M1)= r(A(B \ v)) + r(M12). As A(B \ v) is nonsingular, A(G) is nonsingular if and only if M12 is nonsingular. 2. If m = 2 : In this case G is a coalescence of B = K2 with G \ (B \ v) at the vertex v. As K2 is nonsingular and K2 \ v is singular, using Lemma 1, G is nonsingular if and only if A(G \ B) is nonsingular. In view of the above discussion, in order to know whether block graph G is singular or nonsingular, we need to further examine the matrices M12 for m ≥ 3, A(G \ B), for m = 2. Note that, M12, is the matrix corresponding to the induced subgraph on the vertex-set V (G) \ V (B \ v) of G, with a loop on the m−1 vertex v having weight − m−2 . By selecting a pendant block from the graph G \ B (for m = 2) or the graph corresponding to M12 ( for m ≥ 3) we can further investigate the rank of G. This process will continue until we cover all the blocks of G. The matrix corresponding to the pendant block at any step is of the form M in Theorem 2. Hence we use the prior results from Section 2 to check whether G is singular or not. Examples are given in Figure 1 (nonsingular), Figure 2 (singular) and Figure 3 (singular), where at each step a pendant block is chosen for the elementary row/column operations. The detailed algorithm is given in the next section.

4 Algorithm

For the purpose of the algorithm we first define two auxiliary operations on a set of sets of integers.

4.1 Auxiliary operations

Let U = {S1,...,Sk}, where, Si,i =1, . . . , k, is a set of positive integers. We define two operations on U :

1. U − Si = {Sj | j 6= i}. ⋆ 2. U − Si = {Sj \ Si | j 6= i}.

Example 1. Let S1 = {2, 3, 4, 5},S2 = {2, 7, 6, 5},S3 = {1, 3, 8, 5}. Consider U = {S1,S2,S3}. Then,

1. U − S2 = {{2, 3, 4, 5}, {1, 3, 8, 5}}. ⋆ 2. U − S2 = {{3, 4}, {1, 3, 8}}. The cardinality of a set U is denoted by |U|. In Example 1, the cardinality of U is 3.

4.2 Algorithm

Given a block graph G, with blocks B1,...,Bk. We have a set BV which is the set of vertex-sets of the blocks B1,...,Bk, in G. CV is the set of cut-vertex-sets of the blocks B1,...,Bk. Let V (Bi) denote the vertex set of the block Bi and C(Bi) be the set of cut-vertices in it. That is, we have

BV = {V (B1),...,V (Bk)},

CV = {C(B1),...,C(Bk)}.

A vertex-set V (Bi) in BV is pendant vertex-set if C(Bi) contains exactly one cut-vertex, that is, |C(Bi)| = 1. Let f(p) be the number of times the cut-vetex p appears in CV . Let w(i) be the weight assigned to the vertex i, i =1,...,n of G. We first give an outline of the procedure to check whether a given block graph G is singular or nonsingular. We start with the sets BV,CV . Initially, w(i)=0,i =1, . . . , n. BEGIN- If BV has no pendant vertex-set, go to END. Otherwise, pick a pendant vertex-set Vp, where the cut-vertex is p. Check if w(i) 6=1, ∀i ∈ (Vp \ p). Algorithm 1: Algorithm to check whether a block graph G is singular or not. Result: G is singular or G is nonsingular. BV = {V (B1),...,V (Bk )}, CV = {C(B1),...,C(Bk )}, W = {w(1), . . . , w(n)}, w(i) = 0, i = 1,...,n, f(i) is the number of times vertex i appears in CV . 1 GSING (BV,CV ); 2 m := 0; ⊲ m is a variable to check the existence of a pendant vertex-set. 3 for i =1: |CV | do 4 if (|CV (i)| = 1) then 5 SBV := BV (i); 6 p := CV (i); 7 V := SBV \ p; 8 m := 1; 9 break; 10 end 11 end 12 if (m = 1) then 13 t := 0; ⊲ t is a variable to count the number of nonzero weights. 14 for i =1: |V | do 15 if (w(V (i)) ∼= 1) then 16 t := t + 1; 17 end 18 end 19 if (t ∼ = |V |) then 20 if (t < |V |− 1) then 21 G is singular ; 22 exit; 23 else 24 w(p) := w(p) − 1; 25 BV = BV − SBV ; 26 if (f(p) == 2) then 27 CV := CV −⋆ p; 28 else 29 CV := CV − p; 30 f(p) := f(p) − 1; 31 end 32 end 33 GSING (BV,CV ) 34 else 35 S := 0; ⊲ S is a variable to calculate the sum as in Theorem 2.3. 36 for i =1: |V | do 37 1 S := S + 1−w(V (i)) ; 38 end 39 if S 6= 1 then 40 S w(p) := w(p) − S−1 ; 41 BV := BV − SBV ; 42 if (f(p) == 2) then 43 CV := CV −⋆ p; 44 else 45 CV := CV − p; 46 f(p) := f(p) − 1; 47 end 48 else 49 BV := BV −⋆ SBV ; 50 CV := CV −⋆ p; 51 end 52 GSING (BV,CV ) 53 end 54 else 55 for i =1: |BV | do 56 if BV (i) is singular then 57 G is singular; 58 break; 59 end 60 end 61 G is nonsingular; 62 end 1. If false: (a) If for more than one i, w(i) is 1, then G is singular. STOP. (b) If for exactly one i, w(i) is 1, then induced subgraph on Vp \ p is nonsingular. DO i. w(p) := w(p) − 1. ii. BV := BV − Vp. iii. If f(p)=2, then CV := CV −⋆ p, else, CV := CV − p,f(p) := f(p) − 1. BEGIN the algorithm for BV,CV . 2. If true: Let S = 1 . Check If S 6=1. i∈(Vp\p) 1−w(i) (a) If true: ThenP the induced subgraph on Vp \ p is nonsingular. DO S i. w(p) := w(p) − S−1 . ii. BV := BV − Vp. iii. If f(p)=2, CV := CV −⋆ p, else, CV := CV − p,f(p) := f(p) − 1. BEGIN the algorithm for BV,CV . (b) If false: then induced subgraph on Vp \ p is singular. DO ⋆ i. BV := BV − Vp. ii. CV := CV −⋆ p. BEGIN the algorithm for BV,CV .

END: Let H1,...,Ht be the induced subgraphs of G on the vertex sets in BV with the addition of weighted loops added in the process. If Hi is nonsingular for all i =1, . . . , t, then G is nonsingular else G is singular. Note that, each of Hi is of form M in Theorem 2, hence, using Theorem 2, it is checked in linear time whether Hi is singular or nonsingular. The algorithm of the above outline is given in Algorithm 1. Where the function GSING takes BV,CV as input, and makes recursive use of basic arithmetic, auxiliary operations which take at the most linear time, and check whether the block graph G is singular or not. Now we provide some examples in support of Algorithm 1.

Example 2. Consider the block graph given in Figure 1(a).

BV = {{3, 5, 6, 7}, {1, 10, 8, 9}, {3, 4, 1, 2}, {2, 11, 12}},

CV = {{3}, {1}, {3, 1, 2}, {2}}, f(3) = f(2) = f(1) = 2.

1. 1stcallto GSING(BV,CV ). As 3 is the only vertex in {3} in CV , the corresponding vertex-set {3, 5, 6, 7} in BV is selected as pendant vertex-set. Next, induced graph on vertex set {3, 5, 6, 7}\ 3 is investigated. 3 S = 3, as w(5) = w(6) = w(7) = 0. Then w(3) will be updated to w(3) − 2 , that is vertex 3 will now 3 have a loop of weight − 2 . Now,

BV = {{1, 10, 8, 9}, {3, 4, 1, 2}, {2, 11, 12}},

As, f(3) = 2, CV = {{1}, {1, 2}, {2}}.

2. 2nd call to GSING(BV,CV ). As 1 is the only vertex in {1} in CV , the corresponding vertex-set {1, 10, 8, 9} in BV is selected as pendant vertex-set. Next, induced graph on vertex set {1, 10, 8, 9}\ 1 is 3 investigated. As w(10) = w(8) = w(9) = 0, S = 3. Then w(1) will be updated to w(1) − 2 , that is vertex 3 1 will now have a loop of weight − 2 .

BV = {{3, 4, 1, 2}, {2, 11, 12}},

As, f(1) = 2, CV = {{2}, {2}}. 3. 3rdcallto GSING(BV,CV ). As 2 is the only vertex in {2} in CV , the corresponding vertex-set {3, 4, 1, 2} in BV is selected as pendant vertex-set. Next, induced graph on vertex set {3, 4, 1, 2}\ 2 is investigated. 3 3 9 9 As w(1) = − 2 , w(3) = − 2 , w(4) = 0,S = 5 . Then w(2) will be updated to w(2) − 4 , that is vertex 2 will 9 now have a loop of weight − 4 . BV = {{2, 11, 12}}, As, f(1) = 2, CV = {}. 4. 4-th call to GSING(BV,CV ). As CV is empty, there is no pendant vertex-set. We need to investigate 9 the induced graph H1 on vertex set {2, 11, 12} (with loop on 2). As w(2) = − 4 , w(11) = 0, w(12) = 0, 30 and hence S = 13 6= 1. Which means H1 is nonsingular, hence G is nonsingular. Example 3. The steps for block graph in Figure 2(a) are similar to the steps in Example 2 for block graph in Figure 1(a). In the 4-th call to GSING(BV,CV ), we need to investigate the induced graph H1 on vertex set {1, 2, 3} (with loops). As w(1) = w(2) = w(3) = −2, and hence S = 1. Which means H1 is singular, hence G is singular.

Example 4. Consider block graph in Figure 3(a). We have,

BV = {{1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {1, 7}, {1, 8}, {1, 9}},

CV = {{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}}, f(1) = 2.

1. 1st call to GSING(BV,CV ). As 1 is the only vertex in {1} in CV , the corresponding vertex-set {1, 2} in BV is selected as pendant vertex-set. Next, induced graph on vertex set {1, 2}\ 1 is investigated. As w(2) = 0, S = 1. Thus BV = {{3}, {4}, {5}, {6}, {7}, {8}, {9}}, CV = {{}, {}, {}, {}, {}, {}, {}}, 2. 2nd call to GSING(BV,CV ). As CV is empty, there is no pendant vertex-set. We need to investigate the induced graphs on vertex-sets in BV . But as all are singleton vertices without loops. Hence the block graph is singular.

5 Proof of correctness

Just before (i)-th calling of function GSING(BV,CV ) in Algorithm 1, the adjacency matrix A(G) is trans- formed to the matrix Mi which is of the form

A(G1) .  ..  A(G ) Mi =  i−1  .  A(G \ i) j   i   jT α wT     wM ⋆     where each Gj , j =1,...,i − 1, are some induced subgraph of block B (possibly with loops) whose vertex- set selected as pendant vertex-set during j-th calling of GSING(BV,CV ). It is clear that if any one of G1,...,Gi−1 is singular, then G is singular. Note that if any of G1,...,Gi−1 is empty then it is to be considered as nonsingular by convention. Now, Gi is the induced subgraph (possibly with loops) whose vertex-set is selected as pendant vertex-set during i-th calling of GSING(BV,CV ). Let i be the cut-vertex in the selected pendant vertex-set. Let α be the weight of loop at i, if there is no loop at i then α = 0. M ⋆ is the matrix corresponding to induced subgraph (with possible loops) of G, on the vertex-set V (G) \ (V (G1)∪...∪V (Gi)). Thus, if G1,...,Gi−1 are nonsingular, then G is nonsingular if and only if the following submatrix is nonsingular, A(Gi \ i) j O M˜ = jT α wT . (3)  OT wM ⋆   A(Gi) is of form J − D, where D = diag(d1, d2,...,d|V (Gi)|) is diagonal matrix, di = 1 − w(i),i = 1, 2,..., |V (Gi)|.

1. If more than one diagonal entries of A(Gi \ i) are equal to 1, then as, at least two rows and two columns of A(Gi \ i) are same, it is obvious that G is singular. 2. If exactly one diagonal entry of A(Gi \ i) is 1, the using Theorem 2.1., A(Gi \ i) is nonsingular. By Theorem 2.4., M˜ can be transformed to the following matrix,

A(Gi \ i) o O oT α − 1 wT .  OT w M ⋆   Thus, M˜ is nonsingular if and only if the following nonsingular matrix is nonsingular,

α − 1 wT . w M ⋆  

|V (Gi)−1| 1 3. If w(i) 6= 1,i = 1,..., |V (Gi) − 1| and S = i=1 1−w(i) 6= 1. Then A(Gi \ i) is nonsingular. By ˜ Theorem 2.4., M can be transformed to the followingP matrix,

A(Gi \ i) o O oT α − S wT .  S−1  OT w M ⋆   Thus, M˜ is nonsingular if and only if the following nonsingular matrix is nonsingular,

α − S wT S−1 . w M ⋆  

4. If A(Gi \ i) is singular. Then by Theorem 2.3.(b), A(Gi) is nonsingular. The graph corresponding to M˜ ⋆ is a coalescence of Gi with the induced graph (possibly with loop) of M . ⋆ As, A(Gi \ i) is singular and A(Gi) is nonsingular, by Lemma 1, M˜ is nonsingular if and only if M is nonsingular.

This completes the proof.

Acknowledgments The authors are grateful to Dr. Cheng Zheng for his valuable comments and suggestions.

References

1. Aho, A.V., Hopcroft, J.E.: The design and analysis of computer algorithms. Pearson Education India (1974) 2. Bapat, R.B.: Graphs and Matrices. Springer (2014) 3. Bapat, R.: A note on singular line graphs. Bull. Kerala Math. Assoc 8(2) (2011) 4. Bapat, R., Roy, S.: On the adjacency matrix of a block graph. Linear and Multilinear Algebra 62(3), 406–418 (2014) 5. Berman, A., Friedland, S., Hogben, L., Rothblum, U.G., Shader, B.: An upper bound for the minimum rank of a graph. Linear Algebra and its Applications 429(7), 1629–1638 (2008) 6. Cvetkovic, D.M., Doob, M., Sachs, H.: Spectra of graphs, volume 87 of pure and applied mathematics (1980) 7. Davie, A.M., Stothers, A.J.: Improved bound for complexity of matrix multiplication. Proceedings of the Royal Society of Edinburgh: Section A Mathematics 143(02), 351–369 (2013) 8. Fiorini, S., Gutman, I., Sciriha, I.: Trees with maximum nullity. Linear algebra and its applications 397, 245–251 (2005) 9. Gutman, I., Borovicanin, B.: Nullity of graphs: an updated survey. Selected topics on applications of graph spectra, Math. Inst., Belgrade pp. 137–154 (2011) 10. Gutman, I., Sciriha, I.: On the nullity of line graphs of trees. Discrete Mathematics 232(1-3), 35–45 (2001) 11. Hopcroft, J.E., Tarjan, R.E.: Efficient algorithms for graph manipulation (1971) 12. Hu, S., Xuezhong, T., Liu, B.: On the nullity of bicyclic graphs. Linear Algebra and its Applications 429(7), 1387–1391 (2008) 13. Le Gall, F.: Powers of tensors and fast matrix multiplication. In: Proceedings of the 39th international symposium on symbolic and algebraic computation. pp. 296–303. ACM (2014) 14. Lee, S.L., Li, C.: Chemical signed . International journal of quantum chemistry 49(5), 639–648 (1994) 15. Leskovec, J., Huttenlocher, D., Kleinberg, J.: Signed networks in social media. In: Proceedings of the SIGCHI conference on human factors in computing systems. pp. 1361–1370. ACM (2010) 16. Nath, M., Sarma, B.K.: On the null-spaces of acyclic and unicyclic singular graphs. Linear Algebra and its Applications 427(1), 42–54 (2007) 17. Singh, R., Bapat, R.B.: B-partitions, application to determinant and permanent of graphs. Transactions on Com- binatorics 7(3), 29–47 (2018) 18. Singh, R., Bapat, R.: On characteristic and permanent polynomials of a matrix. Spec. Matrices 5, 97–112 (2017) 19. Singh, R., Zheng, C., Shaked-Monderer, N., Berman, A.: Nonsingular block graphs: An open problem. arXiv preprint arXiv:1803.03947 (2018) 20. Von Collatz, L., Sinogowitz, U.: Spektren endlicher grafen. In: Abhandlungen aus dem Mathematischen Seminar der Universit¨at Hamburg. vol. 21, pp. 63–77. Springer (1957) 21. West, D.B.: Introduction to graph theory, vol. 2. Prentice hall Upper Saddle River (2001) 22. Williams, V.V.: Breaking the coppersmith-winograd barrier. E-mail address: jml@ math. tamu. edu (2011) 23. Xuezhong, T., Liu, B.: On the nullity of unicyclic graphs. Linear algebra and its applications 408, 212–220 (2005)