600 IEEE TRANSACTIONS ON RELIABILITY, VOL. 43, NO. 4, 1994 DECEMBER
Finding the Most Vital Edges with Respect to
the Number
of Spanning Trees
FuShang P. Tsen
TingYi Sung
MenYang Lin
LihHsing Hsu
Wendy Myrvold
National Chiao Tung University, Hsinchu
Academia Sinica, Taipei
National Taichung Institute
ofCommerce, Taichung
National Chiao Tung University, Hsinchu
University
ofVictoria, Victoria
Key Words

Reliability optimization, number of spanning trees, most vital edges, matrix operationReader Aids

General purpose: Sensitivity analysis of network reliability Special math needed for derivations: Matrix operations, graph Special math needed to use results: Same
Results useful to: Reliability analysts, network designers theory, and associated jargon
Summary & Conclusions

A most vital edge of a graph (w.r.t. the spanning trees) is an edge whose deletion most drastically decreases the number of spanning trees. We present an algorithm for determining the most vital edges based on Kirchoff’s matrix tree theorem whose asymptotic timecomplexity can be reduced to that of the fastest matrix multiplication routine, currently O(n2.”$. The foundation for this approach is a more general algorithm for directed graphs for counting the rooted spanning arborescences containing each of the arcs of a digraph. A network can be modeled as a probabilistic graph. Under one such model proposed by Kel’mans, the allterminal network reliability, max imizing the number of spanning trees is critical to maximizing reliability when edges are very unreliable. For this model, the most vital edges characterize the locations where an improvement of the reliability of the link most improves the reliability of the network.
1. INTRODUCTION
Any elementary linear algebra text can be used as a reference for the linear algebra in this paper, eg, [19]. See [3] for any graph theoretic questions.
1.1 Definitions
An undirected graph G = ( V , E ) consists of a set V of n vertices and a set E of m edges, where each edge is an unordered pair of vertices from V . Graph
H
= ( V ’ , E ’ ) is a subgraph of G if V ’ C V and E ‘ G E . A spanning subgraph is any subgraph of G satisfying V‘ = V . A spanning tree of G is a connected spanning subgraph of G that contains no cycles.A most vital edge in G is an edge whose deletion results in a maximum decrease in the number of spanning trees. This paper presents an algorithm for determining the most vital edges of a graph (w.r.t. spanning trees). The same approach can be used to pinpoint locations where an added edge most increases the number of spanning trees. Refs [7,10121 present algorithms for determining the most vital edges for some other graph parameters.
1.2 Algorithm Background
The cornerstone of the algorithm is the famous Matrix tree theorem of Kirchoff’ which expresses the number of span ning trees of a graph in terms of the determinant of a matrix of order n. A naive approach for pinpointing the most vital edges is to count the spanning trees of each of the m graphs created by removing each of the m edges of G in turn; this approach involves m determinant computations. We develop a more sophisticated approach by first considering the more general question of counting the rooted spanning arborescences con taining each arc of a directed graph. The time complexity of our algorithm reduces to that of matrix multiplication’; or equivalently, the amount of work done by the entire algorithm is asymptotically equivalent to the time it takes to do just one determinant computation as required by the naive approach. This algorithm has applications in network reliability. The allterminal network reliability model is defined as:
Vertices represent sites, and edges represent links between the sites. The vertices are perfectly reliable, but edges operate sindependently with the same probability, p . The network is operational if the underlying probabilistic graph is con
nected. 4
Kel’mans [14] first proposed this model of reliability. Col bourn’s monograph [5] is an excellent survey of the work on this problem.
1.3 Purpose
Since computing the allterminal reliability of a network appears to be intractable (the problem is #Pcomplete), approx imation schemes have been proposed [5: chapter 51. When the edges are very unreliable, maximizing the number of spanning trees is critical to maximizing reliability. Maximizing the number of spanning trees over all graphs with the same numbers of edges 8c vertices does not guarantee a network that is most reliable for all values of p [17].
’See theorem 2  which can also be induced as a corollary of Tutte ’The fastest algorithm for this so far is O ( n 2 . 3 7 6 ) [ 6 ] .
1211.
TSEN ET AL: FINDING THE MOST VITAL EDGES FOR THE NUMBER OF SPANNING TREES

601
Other authors have concentrated on the problem of deter mining the graphs on n vertices and m edges with the maximum number of spanning trees [2,4,13,15,18,20,22]. However in many applications, the graph topology is already given. For this situation, determining the most vital edges of a network highlights the locations where an improvement to link reliability most improves reliability.
Standard notation is given in “Information for Readers &
Authors” at the rear of each issue.
2. COUNTING ARBORESCENCES
To get an improved algorithm, it helps to consider the more general problem for directed graphs. In a directed graph (digraph), a rooted spanning arborescence or rooted spanning outtree (or simply arborescence) is a spanning subdigraph which has no directed cycles, and in which one vertex r distinguished as the root can reach each other vertex by directed paths. The digraph D associated with an undirected graph G is constructed by replacing each edge (u,v) of G with the arcs (u,v) & (v,u). Lemma 1 is wellknown; eg, it follows from the intuitive proof of Kirchoffs theorem [8: theorem 2.5, p 531. Lemma 1. Let G be an undirected graph and D the digraph associated with G. There is a onetoone correspondence be tween the spanning trees of G and the spanning arborescences
*
Furthermore, from the onetoone correspondence stated in lemma 1, it follows that the number of spanning trees of an undirected graph G containing a particular edge (u,v) equals ‘the number of arborescences in the associated digraph contain ing arc (u,v)’ plus ‘the number of them containing (v,~)’. For this reason, we restrict our attention to the problem of deter mining the number of arborescences containing a fixed arc in a digraph. The digraphs can have multiple arcs (more than one arc between a pair of vertices). Loops (arcs whose endpoints are the same vertex) can be safely erased since they do not con tribute to any arborescences.
We now present theorem 1, a classical result for counting spanning rooted arborescences of a digraph. The Kirchoff matrix (indegree matrix) K associated with a digraph D is defined as: the diagonal entry kii is the indegree of vertex i ; the off diagonal entry k, is nu where nu is the number of arcs entering vertex i from vertexj.
Theorem 1 [ 161. The number of spanning arborescences rooted at r in a digraph D equals det(Krr), where Krr is the Kirchoff matrix of D with the row and the column corresponding to vertex
r deleted. rl
To avoid treating the arcs which are incident to the root vertex r of D as a special case, we augment the original digraph D with a new vertex U , along with a new arc (u,r). There is a onetoone correspondence between the arborescences of D and those of the augmented digraph. Correspondingly, the augmented Kirchoff matrix A for a rooted digraph D is defined as:
rooted at any one of the vertices of D.
the Kirchoff matrix K with one added to the diagonal entry for the root vertex (or equivalently, the matrix of the augmented digraph with ‘the row and the column correspon ding to the new root’ removed).
Corollary 1. The number of spanning arborescences of D rooted at a vertex r equals the determinant of the corresponding
augmented Kirchoff matrix. 4
Because exactly one arc enters each nonroot vertex in an arborescence, there is a onetoone correspondence between the arborescences of D which contain arc a and those of D o a which is obtained from D by removing all arcs, except a , which enter the terminus of a . Thus, the number of spanning trees contain ing an arc can be computed by evaluating the determinant of the augmented Kirchoff matrix for D o a . However, if we first compute the inverse of the augmented Kirchoff matrix, the same result can be found in constant time.
Lemma 2 . The number of arborescences rooted at vertex r in digraph D can be computed in 0(1) time for any arc a = ( i j > , given the augmented Kirchoff matrix A, det(A), and A’. 4
3. THE ALGORITHM
The algorithm finds the most vital arcs (or edges). Algorithm 1
RELIABILITYNVE
1. Let A be the augmented Kirchoff matrix (as defined in section 2). Construct:
adj(A) = [b,] = det(A) . A
’.
2. For each arc ( i j ) , the number of arborescences con taining this arc is bjj

b,. (Alternatively, for the undirected case, the number of trees containing edge ( i j ) is:Select the arcs (edges) for which this is maximized. 4
Step 1 can be completed in O ( n 3, time by using Gaussian
elimination. It can be accelerated to O(n2.376) by using matrix multiplication [6], or in general to the speed of a fastest matrix multiplication routine. All the edges can be processed, as in step 2, in O ( n 2 ) time. n u s , the limiting factor is the complex ity of matrix multiplication.
Because of the structure of the augmented Kirchoff matrix, it is never necessary to permute rows or columns to avoid zero pivots when applying Gaussian elimination to compute the in verse. This can be used in a practical implementation. The theoretical implication of this is that a very fast matrix multi plication routine, eg,
o(n2),
implies that the inverse of the augmented Kirchoff matrix can be found in the same time; this is not true for the general inversion problem where row and/or column permutations might be required [ 1 : chapter 61.602 IEEE TRANSACTIONS ON RELIABILITY, VOL. 43, NO. 4, 1994 DECEMBER
We could alternatively define a most vital edge as an edge
e*
e
E whose insertion into the graph results in the largest increase in the number of spanning trees. The algorithm is exact ly as algorithm 1, except that step 2 is applied for each nonedge.
ACKNOWLEDGMENT
This work was partially supported by the National Science Council, Taiwan  R.O.C, and by NSERC.
APPENDIX Proof of Lemma 2
The classical adjoint matrix of a matrix A , adj(A) = [ b U ] , is det(A) . A
’.
The value of bij is (
1) ‘+jdet(Ajj), where Aji is the matrix obtained from A by deleting row j and column i. The determinant of A = [ cyuii ] is Cy=, aU (  1)’+jdet(AU) this is expansion by cofactors across row i. Thus, the deter minant of A can be computed by crossmultiplying row i of A and column i of the matrix adj(A). The crucial observation is that column i of adj(A) contains the cofactors of A obtained by deleting row i of A (along with one of the columns). Hence any change to row i of A has no effect on the column i of adj(A). ei is a vector which is 1 in position i but is 0 otherwise. The augmented Kirchoff matrix of D o a is obtained from A by changing row j to (ej

ei). Thus, from the above observa tions, the number of arborescences containing a is bj  bo. Given the information that we have, this can be computed inO(1) time. Q. E. D.
REFERENCES
A.V. Aho, J.E. Hopcroft, J.D. Ullman, The Design and Analysis of Com puter Algorithms, 1974; AddisonWesley .
F.T. Boesch, Z.R. Bogdanowicz, “The number of spanning trees in a prism”, Int’l J. Computer Mathematics, vol 21, num 314, 1987, pp J.A. Bondy, U.S.R. Murty, Graph Theory with Applications, 1980; NorthHolland.
C.S. Cheng, “Maximizing the total number of spanning trees in a graph two related problems in graph theory and optimum design theory”, J. Combinatorial Theory, series B, vol 31, 1981 Oct, pp 240248. C.J. Colboum, The Combinatorics of Network Reliability, 1987; Oxford University Press.
D. Coppersmith, S. Winograd, “Matrix multiplication via arithmetic pro gressions”, Proc. 19‘h Ann. ACM Symp. Theory of Computing, 1987, H.W. Corley, D.Y. Sha, “Most vital links and nodes in weighted net works”, Operations Research Letters, vol 1, 1982 Sep, pp 157160. A. Gibbons, Algorithmic Graph Theory, 1985; Cambridge University Press.
P.E. Gill, W. Murray, M.H. Wright, Numerical Linear Algebra and Op timization vol 1, 1991; AddisonWesley.
Hsu, Jan, Lee, Hung, Chem, “Finding the most vital edge with respect to minimum spanning tree in weighted graphs”, Information Process ing Letters, vol 39, 1991 Sep, pp 277281.
229243.
pp 16.
C.N. Hung, L.H. Hsu, T.Y. Sung, “The most vital edges of a matching in a bipartite graph”, Networks, vol 23, 1993 Jul, pp 309313. R.H. Jan, L.H. Hsu, Y.Y. Lee, “The most vital edges with respect to the number of spanning trees in 2terminal seriesparallel graphs”. BIT, vol 32, num 3, 1992, pp 403412.
A.K. Kel’mans, V. M. Chelnokov, “A certain polynomial of a graph and graphs with an extremal number of trees”, J. Combinatorial Zkeory, series B, vol 16, 1974 Apr, pp 197214.
A.K. Kel’mans, “Connectivity of probabilistic networks”, Automation and Remote Control, vol 29, 1967, pp 444460.
A.K. Kel’mans, “Comparison of graphs by their number of trees”, Discrete Mathematics, vol 16, 1976, pp 241261.
G. Kirchoff, Uber die Auflosung der Gleichungen, auf welche man bei der Untersuchung der linearen Verteilung galvanischer Strome gefiihrt wird, Ann. Phys. Chemistry, vol 72, 1847, pp 497%508, 1847. [Translated in: “On the solution of equations obtained from the investiga tion of the linear distribution of galvanic currents”, IRE Trans. Circuit Theory, vol CT5, 1958, pp 47.1
W.J. Myrvold, K.H. Cheung, L.B. Page, J.E. Perry, “Uniformlymost reliable networks do not always exist”, Networks, vol 21, 1991 Jul, pp D.R. Shier, “Maximizing the number of spanning trees in a graph with n nodes and m edges”, J. Res. National Bureau of Standards, vol78B,
G. Strang, Linear Algebra and Its Applications (31d ed), 1988; Harcourt Brace Jovanovich.
S.S. Tseng, L.R. Wang, “Maximizing the number of spanning trees of networks based on cycle basis representation”, Int ’1 J. Computer Mathematics, vol 28, num 1, 1989, pp 4756.
W.T. Tutte, “Lectures on matroids”, J. Res. National Bureau ofStan dards, vol 69B, 1965, pp 147.
J.F. Wang, C.S. Yang, “On the number of trees of circulant graphs”, Int’l J. Computer Mathematics, vol 16, num 314, 1984, pp 229241. 417419.
1974, pp 193196.
AUTHORS
Dr. FuShang P. Tsen; Dept. of Applied Mathematics; National Chiao Tung University; Hsinchu, TAIWAN  R.O.C.
email: fsptsenQtwnctu01 . bitnet
FuShang P. Tsen is an Associate Professor at the Dept. of Applied Mathematics, National Chiao Tung University. He received his PhD from Brown University. His research interests include differential equations and numerical analysis.
Dr. TingYi Sung; Inst. of Information Science; Academia Sinica; Taipei,
TingYi Sung is an Associate Research Fellow at the Institute of Infor mation Science, Academia Sinica. She received the PhD from New York Univer sity. Her research interests include mathematical programming, graph algorithms, and interconnection networks. Her papers have appeared in Mathematical Programming, Networks, etc.
TAIWAN  R.O.C.
MenYang Lin; Dept. of EDP; National Taichung Institute of Commerce; Taichung, TAIWAN  R.O.C.
MenYang Lin is a Lecturer at the Department of Electronic Data Pro
cessing, National Taichung Institute of Commerce. He received his MS from National Chung Hsing University.
Dr. LhHsing Hsu; Dept. of Computer & Information Science; National Chiao Tung University; Hsinchu, TAIWAN  R.O.C.
email : IhhsuQcc. nctu.edu. tw
LihHsing Hsu is a Professor at the Department of Computer & Infor mation Science, National Chiao Tung University. He received his PhD from State University of New York at Stony Brook. His research interests include graph algorithms, interconnection networks, and VLSI. His papers have ap peared in Discrete Mathematics, Networks, etc.