Microelectron. Reliab., Vol. 30, No. 2, pp. 249-263, 1990. Printed in Great Britain.
0026-2714/90 $3.00 + .00 © 1990 Pergamon Press plc
COMBINING VERTEX DECOMPOSITIONS WITH FACTORING IN AN ALL-TERMINAL NETWORK RELIABILITY ALGORITHM LAVON B. PAGE a n d JO ELLEN PERRY D e p a r t m e n t o f M a t h e m a t i c s and D e p a r t m e n t o f C o m p u t e r S c i e n c e N o r t h C a r o l i n a State U n i v e r s i t y , R a l e i g h N C 2 7 6 9 5 - 8 2 0 5
(Received for publication 22 August 1989) Abstract The all-terminal network reliability problem is to determine the probability that all nodes can communicate in a network in which edges may fail independently of each other. One well known type of algorithm for treating this problem involves repeated deletion and contraction of edges in the network. These are commonly referred to as "factoring" algorithms and are especially effective on sparse graphs. On the other hand, a quite different approach known as the Buzacott algorithm is widely regarded as the most efficient algorithm for complete graphs. We demonstrate a manner in which higher degree vertex decomposition can be utilized within a factoring framework. This approach is compared to conventional factoring algorithms and the Buzacott algorithm from the standpoint of arithmetic operations performed and, in the ease of the factoring algorithms, the search structures encountered during execution. Examples suggest that the higher degree vertex decompositions frequently reduce computational complexity to a greater extent than can be achieved by concentrating instead on an edge selection strategy to be used in factoring.
1. Introduction
graphs. Another algorithm may find the reliability efficiently for graphs of some restricted type. The most common practices used to measure the performance of reliability algorithms are these: (1) Count the number of operations of a certain type that are performed in the application of the algorithm to the problem at hand. Frequently the operations counted are arithmetic operations such as floating point multiplications. (2) Trace the workings of the algorithm via some kind of tree or search structure. This practice is useful in particular for recursive algorithms. (3) Measure the real time requirements of implementations of the algorithm. Each of these bases for comparison is widely used, and each has serious limitations. A count of arithmetic operations does not reflect the amount of graph maintenance or searching that the algorithm uses. Comparison of search structures is relevant only for algorithms based on similar recursive techniques. And with real time comparisons it is often difficult to know whether one is measuring the compiler, the programmer, the hardware, or the algorithm. The Buzacott algorithm [3] is widely heralded
This paper addresses the all-terminal network reliability problem. In a network in which the nodes are completely reliable but in which the edges are subject to failures independent of each other, what is the probability that every node is able to communicate with every other node? In other words, what is the probability that every pair of nodes is joined by a path of functioning edges? Though this problem has not been studied as extensively as its two-terminal counterpart in which a source must be able to communicate with a sink, the symmetry of the all-terminal problem makes it both an intriguing mathematical problem and a useful reliability measure for real-world networks such as communication or computer networks. There are numerous existing algorithms which may be applied to the all-terminal reliability problem. Because of the intractable nature of the problem [8], there are no algorithms which exhibit uniformly good behavior over all classes of networks. One algorithm may work better than another on sparse graphs, but behave poorly on dense 249
250
L.B. PAGEand J. E. PERRY
as the most efficient procedure known for complete graphs. For sparse graphs, there is increasing evidence [2, 5, 6, 7, 9, 10] that some form of factoring (pivotal decomposition based on deletion and contraction of successive edges) works about as well as anything else. The best known strategy for factoring combines factoring with degree-2 vertex reduction and parallel edge reduction, and in this case an optimal edge-selection strategy is known [5, 10]. In Section 3 we examine a refinement of the conventional factoring algorithm which utilizes vertex decompositions for vertices of degree greater than 2. In Section 4 we use a variety of examples to compare the performance of this algorithm with conventional factoring and with the Buzacott algorithm. First, however, in Section 2 we will review the Buzacott algorithm and a factoring algorithm that employs degree-2 vertex reduction, parallel edge reduction, and an optimal edge-selection strategy.
2. The Buzacott and A3 Algorithms The Buzacott algorithm is essentially given by a single recursive equation. It may be described as follows: If we use node number 1 in the graph as the "reference" node, then for each set S of nodes containing node 1 we denote by P(S) the probability that for each pair of nodes in S there is a path of good edges connecting the pair and passing only through nodes in S. In other words, P(S) is the probability that the subgraph determined by S is connected. The only other notation required is to let qid denote the probability that the edge joining nodes i a n d j is failed. The algorithm then is based on the equation
P(S) = 1 - Z
P(s') H
qij
(1)
where the summation is over all subsets S' C S containing node 1, and where the product extends over all node pairs id where one node is in S' and the other is in S - S'. It is understood here that P(S') = 1 if S' is the singleton node set consisting of node 1 and no others. The all-terminal reliability of the
entire network is then computed by taking S in the equation to be the set of all nodes, and the equation recursively defines P(S) in terms of the reliabilities of smaller networks. Though Buzacott describes his algorithm as a recursive algorithm, he intends that it be implemented iteratively, and he describes a procedure for doing this. Basically, first use Equation (1) to compute all probabilities P(S') where S' contains node 1 and one other node. Then use Equation (1) again to compute all probabilities P(S') where S' contains node 1 and two other nodes, and so forth. The amount of memory required to store these values grows exponentially with the size of the network, and this is an essential requirement of the algorithm. To program Equation (1) recursively and to recompute each P(S') on the right every time it is needed would be extremely inefficient. For complete graphs, it is not difficult to count exactly the number of real multiplications that Buzacott's algorithm requires, and the following formula is given in [3]. For the complete graph with n vertices, the number of multiplications is ( n - 1 ) ( n + 1) 3n - 3 - 2 n-1 +1 (2) At the price of still greater storage requirements, Buzacott describes what he calls alternative (ii) in which the products of Equation (1) are stored and reused, thereby reducing the number of required multiplications. This version was not implemented in [3], and memory requirements would limit it to graphs with a small number of vertices. Buzacott [3] states that his method "has a substantially lower asymptotic computational complexity than any other algorithm which has appeared in the literature," and other authors have confirmed this. While Buzacott suggested modifications of the algorithm which can be used on sparse graphs, its known usefulness is restricted to very dense graphs. Factoring, by contrast, is most competitive for graphs of low connectivity. Previous papers [2, 6, 7] have demonstrated that for a wide range of commonly encountered networks, implementations of factoring appear to perform as well as or better than other methods. While there are many ways in which factoring
All-terminal network reliabilityalgorithm can be combined with series and parallel edge reduction, one of the most attractive is proposed by Johnson [5]. An important feature of the allterminal reliability problem (unlike the source-sink problem) is that degree-2 vertices may always be removed, that is, series edge reduction is always possible. The procedures for doing this are well known and are based on the idea of replacing the degree-2 vertex and incident edges by a single edge whose probability is the conditional probability that both of the original edges are good given that at least one is good. Additionally, the reliability of the reduced graph must be multiplied by the probability that at least one of the two original edges is good. With degree-2 vertex reduction always available, the A3 algorithm of [5] may be loosely described as follows: (It is assumed that the graph is biconnected initially.)
Algorithm A3
Input: A biconnected graph G Output: The all-terminal reliability of G The recursive function Rel acts as follows: 1. Perform parallel edge reductions and degree-2 vertex reductions whenever possible. 2. If G is reduced to a single edge, return the reliability of that edge times the appropriate multiplying factor. 3. Otherwise, pick an edge whose removal will leave the graph biconnected, and use that edge for factoring. Return the reliability of the graph G via Rel (G) = p x Rel (G • e) + ( l - p ) x Rel ( G - e )
(3)
where e is the edge used for factoring, p is the reliability of this edge, and G * e and G - e denote G with edge e contracted and deleted respectively. Others [5, 9, 10] have examined the complexities of several factoring algorithms in terms of the search structure or recursion tree generated when the algorithm is used. Since Equation (3)
251
splits the problem into two subproblems, a map of the calls to the recursive function "Rel" in Equation (3) leads to a binary tree, and the number of leaves in this tree has been suggested as a measure of the complexity of such algorithms. Such a count ignores all other reductions that may be performed on the graph, such as series and parallel edge reduction, since these reductions do not lead to a splitting of the problem. (To include these non-splitting reductions in the tree would not change the number of leaves.) The rationale behind the edge-selection strategy employed in the A3 algorithm is that it is optimal in conjunction with the other reductions being used and the manner in which optimality is being measured. If edges for factoring are chosen in this manner, the number of leaves in the search structure will be minimized. The weakness of factoring-based algorithms is found in their behavior on very dense graphs. For the complete graph with n vertices, for example, the number of leaves in the search structure is (n - 2)!. Thus the factoring approach is not competitive with Buzacott's algorithm when applied to complete graphs.
3. Using higher-degree vertex decompositions in conjunction with factoring As indicated in Section 2, degree-2 vertices may always be removed within the context of the allterminal reliability problem. In this section we describe a decomposition method that has useful computational characteristics if properly applied to higher degree vertices. We have implemented this decomposition for vertices of degrees 3, 4, and 5. For reasons that will become apparent when the complexity of the method is discussed later, it is not clear whether it will be practical for vertices of degree much greater than 5. In Section 4, however, we document the utility of these decompositions on a rather wide range of networks and compare results with the results produced by the two algorithms presented in the previous section. Our algorithm repeatedly calls for reliability evaluation of small complete graphs. We will
252
L.B. PA~Eand J. E. PERRY
denote by kn a function which computes the reliability of a complete graph with n vertices. Since the inputs to kn are to be edge reliabilities, we must pass to the function kn a total of n(n-1)/2 numbers representing the edge reliabilities, and the order of these inputs is significant. The purpose of Definition 1 below is to specify uniquely an order for passing the necessary parameters to the function kn for arbitrary positive integer n.
if and only if x and y are equivalent relative to the equivalence relation E.
Definition 1: If n is a positive integer and r = n(n-1)/2, the function kn is the function of r variables defined as follows: kn returns the allterminal reliability of the graph with vertices numbered from 1 to n, with edge reliabilities Pl . . . . .
Pr, and with the edge reliabilities assigned so that if Pi joins vertices u and v, where u < v, and ifpj joins vertices x and w, where x < w, then i < j if and only i f u < x or u = x and v < w.
Definition 2: For any network G, Rel (G) denotes the all-terminal reliability of the network.
Definition 3: Suppose G is a network, v is a vertex of G, and E is an equivalence relation on the neighbors of v. Then Gv,~ is the network obtained from G by (a) deleting vertex v and all edges incident to v, Co) contracting into a single vertex each equivalence class of vertices that were originally neighbors of v, and removing edges that may have originally joined neighbors of v belonging to different equivalence classes. (These contractions will generally produce parallel edges which may be combined in the usual manner for handling parallel edges.)
Definition 4: Suppose G is a network, v is a vertex of G, and E is an equivalence relation on the vertices that are neighbors of v. Then PG,v,~. is the probability of the following event: (a) at least one edge incident to v is a good edge, ard (b) for each pair x and y of neighbors of v, there exists a path of good edges joining x and y and passing through only vertex v and its neighbors
Figure 1: Vertex v is a degree-4 vertex. Equation (4) shows the computation of the term PG, v,F, used in Equation (5) for the particular equivalence relation on the neighbors of v shown in this figure. The shaded groupings represent the two equivalence classes.
The objective of Definitions 3 and 4 is to enable a splitting of the all-terminal reliability problem into several subproblems, one for each equivalence relation E on the set of neighbors of the reference vertex v. Refer to Figure 1 which shows a degree-4 vertex v with neighbors w, x, y, and z. The neighbors are shown as being connected to other vertices in the graph. Also w, x, y, and z are shown joined together and forming a subgraph which is the complete graph on four vertices. This situation can be achieved by inserting edges with reliability zero if necessary. Given the graph G and vertex v of Figure 1, and given the equivalence relation E whose equivalence classes consist of the shaded clusters {w} and {x, y, z}, the graph Gv,E is then obtained by deleting vertex v and edges 1, 2 . . . . . 7, and by collapsing vertices x, y, and z into a single vertex, performing subsequent parallel edge reductions as needed. For the vertex v and equivalence relation E
All-terminal network reliabilityalgorithm shown in Figure 1, the probability PG,v,E is given by
PG,v,E = q5 q6 q7 [ Pl q2 q3 q4 k3(P8,P9,PlO) + ql k4(P2,P3,P4, PS,P9,PlO) ] (4) An explanation for Equation (4) is as follows: The event whose probability is represented by PG,v,E requires that edges 5, 6, and 7 fail and that v be joined to exactly one of the two equivalence classes {w} and {x, y, z}. The latter occurs if edge 1 is good and edges 2, 3, and 4 are bad, and the appearance of the factor k3(PS, P9, Pl0) guarantees that the vertices x, y, and z are linked together. Alternately, edge 1 c~dd be bad if v is linked to the equivalence class {x, y, z}, and the factor k4(P2, P3, P4, P8, P9, Pl0) is the probability that {v, x, y, z} are linked. These cases are mutually exclusive, so their probabilities are added in Equation (4). Once a vertex of a graph G is chosen, the decomposition that utilizes the ideas above is given by the equation Rel (G) = ~ P G , v , E Rel (Gv,E) (5) E where the summation is over all equivalence relations on the neighbors of vertex v. Equation (4) is simply a special case of the pivotal decomposition theorem that is generally stated in conjunction with Bayes' Theorem: Given a partition A 1 . . . . . A n of the sample space, the probability of any event B may be expressed as
253
presents the interface represented by the equivalence relation E. An outline for an all-terminal reliability algorithm based on Equation (5) is as follows: Outline for algorithm based on Eeuation (57 (1) Perform parallel edge reductions and degree-1 and degree-2 vertex reductions whenever possible. (2) When no more such reductions are available, pick a vertex of minimal degree in the graph and evaluate the reliability of the graph using Equation (5). One drawback to this approach is that the number of summands in Equation (5) grows superexponentially with the degree of the vertex v. Table 1 shows this growth and was shown in [8] in conjunction with a somewhat different way of using these equivalence relations to decompose the overall network reliability into a number of subproblems. The outline above is incomplete in that it specifies no way of evaluating the PG,v,E terms which appear in each summand.
Table 1: Number of distinct equivalence classes on the neighbors of a vertex of degree nfor 3 < n< 8. degree of vertex number of equivalence classes
3
4
5
6
7
8
5
15
52
203
877
4,140
P(B) = ~--a P(Ak) P(B I Ak) In Equation (5), the mutually exclusive cases considered (the partitioning of the sample space) consist of all possible ways to partition the neighbors of the vertex v, that is, the different equivalence relations on the neighbors of v. Intuitively, the idea is that one simply looks at the subgraph consisting of v and its neighbors and considers all the possible ways that this subgraph can interface with the rest of the graph. The factor Rel (Gv,E) is equivalent to the conditional probability that the entire graph is connected, given that the subgraph consisting of v and its neighbors MR 30,2
D
Notice that for the equivalence relation shown in Figure 1, computation of PG,v,E was shown in Equation (4) based on the functions k3 and k4 which return values representing the all-terminal reliabilities of complete graphs on 3 and 4 vertices. It is not difficult to see that if v is a degree-4 vertex, then PG,v,F, can always be defined in terms of the functions k3, k4, and k5. (The function k5 is needed to treat the equivalence relation in which all the neighbors of v constitute a single equivalence class.) Similarly, if one wishes to utilize Equation (5) on
254
L . B . PAGE and J. E. PERRY
vertices v of degree 5, formulas for all the terms PG,v,E can all be computed based on the ability to evaluate the functions k3, k4, k5, and k6. In principle, of course, one could use any of the standard algorithms for evaluating the reliabilities of the complete graphs which are returned by the functions kn. Since these functions are to be called repeatedly, however, the efficiency with which they perform will largely determine the efficiency of any algorithm that incorporates them. Our intent is to minimize the amount of arithmetic performed in evaluation of these functions. While it is trivial to implement k3 with 4 multiplications, we have used Buzacott's alternative (ii) algorithm [3] to implement k4, k5, and k6. We wrote a program which utilized Buzacott's alternative (ii) approach and which in turn wrote the source code for the functions kn for n < 6. The source code for the function k4 is shown in Figure 2. Each call to k4 requires 25 multiplications. If Buzacott's alternative (i) were used, 38 multiplications would be required. For k4 the difference in the number of multiplications is minor, but with k6 alternative (ii) requires only 281 multiplications whereas alternative (i) requires 914. The algorithm which we have investigated is summarized as follows: Fix a positive integer n, and whenever vertices of degree less than or equal to n are present in a graph use vertex decomposition on a vertex of minimum degree as an alternative to factoring. Conventional factoring (selecting an edge for deletion and contraction) will occur in the recursion only when graphs are encountered wherein all vertices are of degree greater than n. As a suggestive acronym we give the name FWVD(n) to this algorithm for "factoring with vertex decomposition applied to vertices of degree less than or equal to n." Using computer-generated source code for the functions k4, k5, and k6 as described above we have implemented FWVD(n) for n < 5. The method by which we incorporate parallel edge reductions and degree-2 vertex reductions is identical with such methods in [5, 6]. As indicated earlier, Rosenthal [8] proposed an algorithm based on partitions of cut sets in a graph, but his use of these partitions is quite different from ours. Also Fratta
function k4(pr 12,pr 13,pr 14,pr23,pr24,pr34:real):real; var
P12, P13, P14, P123, P124, P134, Q1_2, Q1_3, Q 1 4 , Q2_3, Q2_4,Q3_4, P1Q1_2, P1Q1 3, P1Ql_4, P1Q1 23, P12Q12 3, Q12 3, P13Q13_2, Q13_2, P1Ql_24, P12Q12_4, Q12_4, P14Q14_2, Q14_2, P1Ql_34, P13Q13_4, Q13_4, P14Q14 3, Q14_3, P1Q1_234, P12Q12 _34, P13Q13 24, P14Q14_23, P123Q123_4, Q123_4, P124Q124_3, Q124_3, P134Q134 2, Q 1 3 4 2 : real;
begin Q1_2 := 1.0- pr12; Q1_3 := 1.0-pr13; Q1 4:=1.0-pr14; Q2_3 := 1.0- pr23; Q2_4 := 1.0- pr24; Q3 4 := 1.0- pr34; Q 1 2 3 := Q1_3 * Q 2 3 ; Q13_2 := Q1_2 * Q2_3; Q 1 2 4 := Q1_4 * Q2_4; Q14 2:=Q1_2*Q2_4; Q13_4 :=Q1_4 *Q3_4; Q14 3 :=Q1 3 * Q3_4; Q123_4 := Q1-2_4 * Q 3 4 ; Q 1 2 4 3 : = Q 1 2 _ 3 * Q 3 4; Q134_2 := Q13 2 * Q2-4; P1Q12 := Q1-_2; P12 := 1.0 - P 1 Q 1 _ 2 ; P1Q1_3 := Q 1 3 ; P13:= 1.0 - P1Q1 3; P1Q1_4:= Q1 4; P14:= 1.0 - PIQl_4; P1Q1_23 := PIQl_2 ° Q1_3; P12Q12-3 := P12 * Q12_3; P13Q13_2 := P13 * Q13_2; P123:= 1.0 (P1Q1_23 + P12Q12_3 + P13Q13 2);
P1Q1 24 := P1Q1 2 ° Q1_4; P12Q1-2_4 := P12 ~-Q124; P14Q14 2 := P14" Q14 2; P124:= 1.0 (P1Q1_24 + P12Q12_4 + P14Q14_2); P1Q1_34 := P1Q1_3 * Q1_4; P13Q13_4 := P13 * Q13_4; Pl 4Q14_3 := P14 * Q14_3; P134:= 1.0 (P1Q1 34 + P13(~13_4 + P14Q14_3); P1Q1 234:=PIQ1 23"Q1_4; P12Q1-2_34:= P12Q12_3 * Q12_4; P13Q13_24 := P13Q13_2 * Q13_4; P14Q14_23 := P14Q14_2 * Q14_3; P123Q123_4 := P123 ° Q123 4; P124Q124_3:=P124*Q124 3; P134Q134_2:=P134*Q134 2; k4:= 1.0 (P1Ql_234 + P12Q12_34 + P13Q13 24 + P14Q14 23 + P123Q123_4 + P124Q124_3 + P134Q134_2 ) end;
Figure 2: Computer generated source code (in Pascal) for evaluation of the function k4. Variable names are indicative of values the variable represents. For example, the variable P14Q14_23 stores the probability that the subgraph consisting of nodes 1 and 4 is connected but that neither vertex 1 nor 4 can communicate with nodes 2 or 3.
and Montanari [4] described a loose framework for decomposing a network which could perhaps be applied in a way similar to the vertex decompositions we are proposing, though the actual algorithms they have implemented do not proceed along these lines.
The FWVD(n) Algorithm
Input: A network G Output: The all-terminal reliability of G 1. 2.
If G is disconnected, return 0. Otherwise, perform parallel edge reductions and degree-1 and degree-2 vertex reductions when-
All-terminal network reliabilityalgorithm
3. 4.
5.
ever possible. If G is reduced to a single vertex, return the appropriate multiplying factor from step 2. Otherwise, pick a vertex of minimal degree in the graph and evaluate the reliability of the graph using Equation (5) if the minimal degree is no greater than n. (The values of the factors PG,v,E are evaluated in the fashion illustrated by Equation (4). Such evaluations utilize calls to functions k 3 ..... kn+l which return the reliabilities of complete graphs with 3 ..... n+l vertices respectively. The method of computation used by the functions k4 ..... kn+l is that described by Buzacott [3] as his alternative (ii) method.) If no vertex of degree _< n is present in the graph, pick a random edge and factor in the usual way: Rel(G) = p × R e l ( G * e ) + (1 - p ) x Rel (G - e)
255
the function k4 shown in Figure 2 consists of about 60 lines of code, a similar computer-generated body for the function k6 consists of around 500 lines of code. Clearly to proceed to vertices of still higher degree we would have to forego evaluation of functions k7, k8 . . . . via pre-computed arithmetic expressions and instead fall back on one of the reliability algorithms. Memory demands would preclude extension to vertices of high degree based on the type of modified Buzacott algorithm used to generate Figure 2. (4) The fact that we ultimately resort to factoring in step (3) means that asymptotically for complete graphs the size of our search structure grows factorially with the number of vertices in the graph. Examples in the next section show, however, a substantial decrease in computation as compared to the A3 algorithm for a number of graphs, including complete ones.
4. Comparisonof Algorithms Comments Comparison of search structures (1) Each summand on the right side of Equation (5) consists of two factors. For certain equivalence relations E, the graph Gv,E may be disconnected. In implementing the algorithm Rel(Gv,E) may be assigned value zero in this case and the factorpG,v,E need not be computed. (2) Degree-1 vertices may be encountered if random edge selection is employed and one does not insist that the graphs initially be biconnected. Remove degree-1 vertices. (Degree-1 vertices are not encountered in the A3 algorithm where one begins with a biconnected graph.) (3) We have implemented the algorithm F W V D ( n ) for n < 5. We do not know whether implementations for n > 5 are practical. The ability to create such implementations is restricted by the growth in the number of terms to be treated (see Table 1) and the method used to evaluate the reliabilities of small complete graphs. In treating vertices of degree 5, there are 52 summands in the sum in the right side of Equation (5), and availability of the function k6 is required. Whereas the body of
Although Buzacott calls his algorithm a "recursive" algorithm, it is not to be implemented via recursion. It is clear at the start of the problem exactly what probabilities of small subgraphs must be computed and stored, and one builds the reliability of the entire graph from these pre-computed terms. The A3 algorithm and our FWVD(n) algorithm are recursive in the sense that they require recursive programming in the implementation. One has no way of knowing at the beginning of the problem all the modified subgraphs that will be encountered during the solution process, so one computes nothing in advance. Each decomposition generates new subproblems, which in turn must be solved, and pending calculations require use of a recursion stack. These observations are very relevant to the runtime characteristics of program execution. Since the Buzacott algorithm requires that much information be computed and stored for later use, it has large storage demands. With algorithms that are
256
L.B. PAGEand J. E. PEggy
implemented via recursion, on the other hand, the amount of memory required is proportional to the depth of the recursion. And insight into the overall behavior of the algorithm is provided by an analysis of the recursion tree (search structure). While this tree will be too large to "observe" in any practical sense for complex networks, it is worth comparing the recursion trees for A3 and for FWVD(n) for a small network in order to understand the difference in their workings.
degree-4 vertex
Figure 3: The recursion trees in Figures 4, 5, and 6 illustrate how the A3 and FWVD(n) algorithms work on this network.
the recursion tree becomes that of Figure 5(b). The degree-4 vertex initially present is used, and the problem splits into 15 subproblems (corresponding to the 15 equivalence relations on the 4 neighbors of the vertex) all of which are solvable via parallel edge reduction and degree-1 and degree-2 vertex reduction. Thus there is no further recursion. When vertices of degree less than or equal to n are present, FWVD(n) tends to produce recursion trees which are of significantly less depth than does the A3 algorithm. Intuitively one might say that the recursion tends to be "wide" rather than "deep" since a large number of subproblems are generated by the vertex decompositions, but individually the problems are much simpler than the subproblems produced by factoring. A consequence of this is that memory requirements during execution of FWVD(n) tend to be less than for A3 even when n is small.
Counting real operations For complete graphs, an analysis of Buzacott's algorithm is given in [3] in terms of real multiplications required. While it might seem preferable to count all real operations, Buzacott [3] observes that additions/subtractions are on the same
Figure 3 shows a small network with seven vertices. If the A3 algorithm is used on this network, each application of Equation (3) generates a splitting of the problem into two subproblems. Thus the recursion Iree is binary, and for the network of Figure 3 a recursion tree is shown in Figure 4. (While the A3 algorithm uniquely determines the number of leaves in the recursion tree, the exact shape of the tree depends on the specific edges used for factoring.) If one uses our algorithm FWVD(3), one gets a recursion tree that looks like the tree in Figure 5(a). Each binary splitting is caused by the fact that no degree-3 vertex is present so factoring is required. Whenever a degree-3 vertex can be found, the problem splits into 5 subproblems (because there are 5 equivalence relations on the 3 neighbors of a degree-3 vertex). If FWVD(4) is used, Figure 4: This is a recursion tree that results from use of the A3 algorithm on the network of Figure 3.
All-terminal network reliability algorithm order as multiplications, so he focuses on multiplications. Buzacott's algorithm uses no divisions, but we will count multiplication/divisions since division is required by the degree-2 vertex reductions performed by the other algorithms. (See the proof of the corollary to Proposition 1 below.) While the edge-selection strategy of the class A3 of algorithms described in Section 2 uniquely determines the number of leaves in the search structure for biconnected graphs, it does not uniquely determine the number of real multiplications performed. For complete graphs, we will indicate a refinement to the A3 edge-selection strategy which does lead to a predetermined number of real operations. For the other examples considered, the precise choices of edges for factoring using an A3 algorithm may lead to minor variations in the number of real operations performed. The same is true with the vertex reductions in FWVD(n); that is, the precise choice of vertex for reduction (when more than one vertex of the same lowest degree is present) can influence the number of real operations performed. For this reason the numbers that are shown in most of the tables of this section for both the A3 algorithms and the FWVD(n) algorithms are not uniquely determined by the graphs themselves, but will fluctuate somewhat depending on precisely which edges or vertices are used for decomposition. All numbers in the following tables were obtained from p r o g r a m m e d implementations of the algorithms. Further details are provided throughout this section on the manner in which real operations
257
are counted. In counting operations for the Buzacott algorithm, Equation (1) is used. For complete graphs, formulas for the number of operations are obtained in [3]. Clearly, however, for other graphs it would be advantageous not to multiply by the qi,j terms in Equation (1) which are 1. (In other words, don't multiply by the unreliability of an edge that isn't present in the graph.) In counting multiplications for the Buzacott algorithm, we count only multiplications by factors qi,j which are not 1. As an illustration, consider a 4-vertex tree with vertex 1 as a hub with spokes leading out to vertices 2, 3, and 4. If only the factors not equal to 1 are shown, and if vertex 1 is used as the reference vertex, the Buzacott algorithm computes the reliability of the tree via the following computations: P123 = 1 - (q12 q13 +P12 q13 + P l 3 q12) P124 = 1 - (q12 q14 +P12 q14 +P14 q12) P134 = 1 - (q13 q14 +p13 q14 + p 1 4 q13) P1234 = 1 - (q12 q13 q14 +p12 q13 q14 +P13 q12 q14 +p14 q12 q13 +P123 q14 +p124 q13 +p134 q12)
This system of equations uses 20 multiplications to compute the reliability of the tree, which of course is P12 P13 P14. For a complete graph of 4 vertices, 38 multiplications are required. This illustration also appears to indicate that a formula given in [3] is incorrect. In the section of [3] on application to sparse graphs, there is commentary on eliminating non-essential multiplications in sparse graphs, and the formula 2 n-1 - n is given as the number of multiplications required in the case of a tree with n vertices consisting of a hub with n 1 spokes and assuming that the hub is chosen as the reference vertex. When n = 4, 2 n-1 n = 4. The actual number of essential multiplications is 20, as shown. (Variations of the Buzacott algorithm reduce the number of multiplications somewhat. For example, his alternative (ii) algorithm would reduce the Figure 5: Recursion tree (a) results if FWVD(3) is number of multiplications from 20 to 16.) applied to the network of Figure 3. Recursion tree (b) results if FWVD(4) is used on the same network.
258
L.B. PAGEand J. E. PERRY
Complete Graphs
parallel edge reductions. At this point v remains as a degree-2 vertex. Performing the degree-2 reduction on v leads to one final parallel edge reduction. So
With a complete graph one can predetermine for the A3 algorithm all the arithmetic that will be performed if one uses the edge-selection strategy of always factoring on an edge leading into a vertex of minimal degree in the graph. (For complete graphs this strategy is consistent with the edge-selection strategy in the A3 algorithm.) Such a strategy predetermines the number of times factoring, parallel edge reduction, and degree-2 vertex reduction are employed. Based on this knowledge it is possible to compute the number of arithmetic operations performed.
parallel edge reductions have been performed and we are left with n - 2 copies of the complete graph on n - 1 vertices. This is the basis for (2) in the proposition. Equation (1) is based on the observation that n - 3 factorings were required in order to arrive at the n - 2 copies of the complete graph on n - 1 vertices, and (3) stems from the fact that only 1 degree-2 vertex was encountered during this splitting.
Proposition 1 : If the edge-selection strategy
Corollary: Let MULTn denote the number of
of the A3 algorithm is amended to specify that edges for factoring should always be chosen incident to a vertex of minimal degree, and if FACn, PARn, and D E G 2 n denote respectively the number of times factoring, parallel edge reduction, and degree-2 vertex reduction must be employed to evaluate the overall reliability of a complete graph with n vertices, then the values of FACn, PARn, and DEG2n satisfy the following recurrence relations:
real multiplications/divisions employed by the A3 algorithm (amended as in the above proposition ) in determining the all-terminal reliability of the complete graph on n vertices. Then 1 MULTn = ( n - 2 ) MULTn_I + ~ ( n 2 + n - 4 )
(1) FACn = n - 3 + (n - 2) FACn-1 = (n-2)! - 1 1
(2) PARn = ~ (n - 1 ) (n - 2) + (n - 2) PARn_ 1 (3) DEG2n = 1 + ( n - 2 ) DEG2n_I Initial conditions on the recurrence relations are given by FAC3 = 0, PAR 2 = 0, and DEG22 = 0.
Proof: Suppose G is the complete graph on n vertices. Pick a vertex v. Factoring on n-3 edges leading out of v reduces v to a degree-2 vertex. Contracting the first edge leads to n-2 parallel edge reductions, contracting the second leads to n - 3 parallel edge reductions, and so forth. When only 3 edges remain leading into v, factoring on one of these leads to 2 parallel edge reductions. So the n 3 contractions yield (n - 2) + (n - 3) + . . . + 2
1
(n-2)+(n-3)+...+2+l
= ~ (n - 1 ) (n - 2)
Proof:
Each use of factoring requires 2 multiplications, each parallel edge reduction requires 1 multiplication, and each degree-2 vertex reduction requires 2 multiplications and 1 division. (A degree2 vertex reduction requires one multiplication to compute the probability that both of the incident edges are good, one division to compute the conditional probability that both are good given that at least one is good, and a further multiplication to multiply the probability that at least one is good times the reliability of the reduced graph.) The recursive formula in the corollary then follows easily from the preceding proposition.
Table 2: Number of multiplications/divisions required for complete graphs of 7 to 10 vertices. number of vertices Buzacott A3 FWVD(5)
7
8
3,825 1,341 3,390
15,182 8,080 12,944
9
10
58,065 216,002 56,603 452,877 41,275 210,855
All-terminal network reliability algorithm
For a given value of n, deriving a general expression for the number of multiplications performed by FWVD(n) on complete graphs does not appear feasible. It is easy enough, however, to count during program execution the operations being performed during the various vertex decompositions and other reductions performed by the algorithm. Equation (4), for instance, uses 8 multiplications. For graphs which are not complete, some of these multiplications may be unnecessary. For example, if there were no edge joining vertices w and x in Figure 1 then the factor q5 in Equation (4) would be 1, and hence multiplication by q5 is unnecessary. In order to simplify the counting, however, we will count Equation (4) as always utilizing 8 multiplications, and we similarly treat all such expressions encountered during vertex reductions. Since the term PG,v,E is multiplied in Equation (5) by Rel (Gv,E), there is no reason to compute PG,v,E at all in the cases where Rel(Gv,E) = 0. And since there is no exlxa work involved in computing Rel(Gv,E) before considering PG,v,E, our implementation does not compute PG,v,E, nor count the multiplications that would be necessary to evaluate it, for the equivalence classes for which Rel(Gv,E) is zero. Of course, the function calls to to k3 and k4 in Equation (4) can be treated separately. These function evaluations are discussed in Section 5. (See also Table 7.) Results for complete graphs of 7 to 10 vertices are shown in Table 2. Buzacott's algorithm will begin to show a distinct advantage if larger complete graphs are considered.
Table 3: Number of leaves in recursion tree (search structure) for complete graphs of 7 to 10 vertices number of vertices A3 FWVD(5)
7
8
9
10
120 53
720 209
5,040 778
40,320 4,292
Table 3 shows the number of leaves in the recursion trees (search structures) for the A3 algorithm in comparison to FWVD(5) when applied
259
to complete graphs of size 7 to 10 vertices.
Street Networks with Diagonals Figure 6 shows a 3 x 4, a 4 x 4, and a 2 x 10 street network with diagonals. All of these are far enough from being complete graphs that factoring is substantially better than the Buzacott algorithm. Table 4 shows the total number of multiplications/divisions required by the Buzacott algorithm, the A3 algorithm, and the FWVD(5) algorithm on these two networks. For the 3 x 4 network, the table also shows the number of multiplications required if two modifications of the Buzacott algorithm are employed. In the modification for sparse graphs, one computes and stores and reuses only those P(S') terms in Equation (1) which are non-zero. Additionally, Table 4 shows the number of leaves in the recursion tree (search structure) for A3 and for FWVD(5) when applied to these two networks.
(c) Figure 6 : 3 x 4, 4 x 4 and 2 x 10 street networks with diagonals. Behavior of the various algorithms on these networks is shown in Table 4.
The thin network of Figure 6(c) is of particular interest because it is an example in which the edge-selection strategy for the A3 algorithms pays off handsomely. For this network, random edge selection typically leads to two or three times the amount of computation as does the strategy of A3. The reason is that the A3 edge-selection strategy limits factorization to only one edge per "block" in the 9 side-by-side blocks that make up the network. This in effect means that the number of times
260
L.B. PAGEand J. E. PERRY
factoring is required doubles with the addition of each block to the network. Notice that the 512 leaves in the recursion tree given in Table 4 bears this out, since there are 9 blocks and 512 = 29.
Table 4: Number of multiplications/divisions and number of leaves in recursion tree for the networks of Figure 6.
Buzacott (complete graph version) Buzacott modified*
Number of multiplications/divisions Fig. 6(c) Fig. 6(a) Fig. 6(b) 5.15x1010 2,812,622 406,519,598
1,199,916
unknown
unknown
B uzacott sparse version**
466,756
unknown
unknown
A3
7,131
351,251
7,666
FWVD(5)
2,632
60,859
5,512
Number of leaves in recursion tree Fill. 6(a) Fig. 6(b) Fig. 6(c) A3
544
25,792
512
FWVD(5)
81
1,825
81
multiplications by qij in Equation (1) are counted only when qi,j¢ 1 multiplications by qi,jin Equation (1) are counted only when qi,j¢ 1, and products are computed only for those terms in which P(S') ¢ 0 Given the usefulness of the edge-selection strategy of the A3 algorithm in this example, it is of all the more interest that the FWVD(3) algorithm significantly outperforms A3 on this example while doing no factoring at all. (See Table 6; all the branching in the recursion tree for FWVD(5) on this network comes from degree-3 vertex reduction. This means that FWVD(5) and FWVD(3) behave identically as far as this network is concerned.) Why are there only 81 leaves in the recursion tree for FWVD(3) (see Table 4) for this network? The explanation is that the first degree-3 vertex
Figure 7: Network from [1]. Algorithms similar to A3 are known to be very effective on this network in comparison to other approaches [6]. decomposition performed by FWVD(3) splits the problem into 5 pieces in which each piece (after degree-2 vertex reductions and parallel edge reductions) consists of 7 blocks rather than 9 as in the original problem. Among the 5 cases, however, 2 are degenerate in that the resultant graph Gv,~. of Equation (5) is disconnected. So rather than one problem with 9 blocks, we have 3 problems with 7 blocks. These subsequently split into 9 problems with 5 blocks each, then 27 problems with 3 blocks each, and finally 81 copies of a complete graph with 4 vertices (1 block). When a final degree-3 vertex decomposition is performed on each of these, 4 of the 5 resulting subproblems are degenerate, so there is no further branching in the recursion tree.
A sparse graph The network of Figure 7 has been used for the purpose of comparing a number of different algorithms [1, 6]. The Buzacott algorithm does not perform well on a graph this sparse. (See [1] for example.) Table 5 shows the number of multiplications/divisions required and the number of leaves in the respective search structures. On the basis of the count of operations in Table 5, factoring appears to have a slight advantage over the FWVD(5) algorithm on this network. (Actually, FWVD(5) is equivalent to FWVD(3) on this network also. This is not obvious initially, since it is not apparent what kinds of graphs may emerge during the decomposition process.) Our experience with real time measure-
All-terminal network reliabilityalgorithm ments tends to support this, provided one foregoes the complicated edge-selection strategy of the A3 algorithm. (Again for this network, as with many others, the edge-selection strategy called for by the A3 algorithms has no significant advantage over random selection in terms of either the recursion tree or the number of arithmetic operations.) Previous research [1, 6] has shown factoring to work very well on this network in comparison to other methods.
Table 5: Number of multiplications/divisions performed and number of leaves in recursion tree for the network in Figure 7 from [1].
Buzacott (complete £1raph version) A3 FWVD(5)
No. of multiplications or divisions
No. of leaves in recursion tree
1,377,429,537
not applicable
4,377
312
6,645
201
It is of some interest to observe the types of operations that the FWVD(n) algorithm is pcrlbrming in order to evaluate network reliability for the examples shown. This information is given in Table 6. Notice that FWVD(5) performs no factoring at all on the networks of Figures 6 and 7. Yet even in the case of the relatively sparse network of Figure 7, the FWVD(5) algorithm performs at a level roughly comparable to the A3 algorithm.
261
5. Concluding Remarks
While we are uncertain as to whether there is a feasible manner to implement FWVD(n) for n > 5, there are additional refinements that could be included to reduce still further the amount of arithmetic performed by FWVD(n) as it is described in Section 3. Table 7 shows the number of calls to the functions k3, k4, k5, and k6 that are made during the process of a degree-5 vertex decomposition and the number of multiplications performed by these calls. The table also shows the number of redundant calls of each type. These redundant calls stem from the fact that different equivalence relations include common equivalence classes, and thus if each equivalence relation on the neighbors of a degree-5 vertex is treated separately in Equation (4), the result will be that a substantial number of small complete graphs will have their reliability evaluated more than once. The table shows that by storing these values and reusing them, the number of multiplications required for each degree-5 vertex decomposition could be reduced from 1631 to 1181. A Small reduction in the number of multiplications required for degree-4 vertex reduction could be similarly achieved (though the redundancy is less in the degree-4 case). Real time comp,risons between the A3 algorithm and FWVD(n) are difficult to make in part because of the edge-selection strategy of the A3 algorithm. To implement this strategy efficiently one must incorporate a tri-connected component decomposition algorithm. Yet our practical ex-
Table 6: Number of operations of each type performed on various networks by the FWVD(5) algorithm. Operation parallel edge reduction degree-1 vertex reduction degree-2 vertex reduction degree-3 vertex decomp. degree-4 vertex decomp. degree-5 vertex decomp. factoring
complete graph network of network of network of network of on 10 vertices Fig. 6(a) Fig. 6(b) Fig. 6(c) Fig. 7 28,088 3,417 5,611 356 53 65
440 45 117 36 0
9,565 1,222 1,984 832 10
886 0 200 121 0
754 164 343 98 0
0
0
0
0
64
0
0
0
0
262
L.B. PAGEand J. E. PERRY Table 7: Number of evaluations of the functions k 3, k4, ks, and k s required during a degree-5 vertex decomposition. function
ks k4 ks ke
number of evaluations
number of redundant evaluations
number of multiplications per evlauation
total number of multiplications
number of redundant multiplications
7O
5O
4
28O
2OO
25
10
25
625
250
5
0
89
445
0
1
0
281
281
0
Total
1631
450
perience indicates that the optimal edge selection strategy is rarely much better than random edge selection. Table 3, for instance, shows 40,320 leaves in the search structure if the optimal edgeselection strategy is used in the A3 algorithm to evaluate the reliability of the complete graph on 10 vertices. By comparison, random edge selection typically leads to something in the range of 40,350 leaves on this problem. If real time of execution is the measurement criteria, except for certain specially constructed graphs, there is little indication that it is worthwhile to resort to a complicated edge selection strategy. For this reason we have not specified an edge selection strategy in the FWVD(n) algorithm. When the A3 algorithm is simplified so as to use random edge selection (as in [6]), our experience with a relatively large number of examples has been that our implementation of FWVD(5) varies from slightly slower than A3 to several times as fast as A3, with the shift generally occurring as one moves from very sparse graphs to denser graphs. It has already been demonstrated [2, 6, 7] that factoring-based algorithms appear extremely favorable when comparisons are made to numerous published results regarding tests of other algorithms on standard examples from the recent literature. The favorable comparison between the FWVD(5) algorithm and factoring algorithms is therefore somewhat encouraging. A drawback to FWVD(n), even for n < 5, is the relative difficulty of implementation. The source code for the factoring algorithm of [6] is only around 500 lines, and the A3 algorithm can be implemented in a similar amount of code if one settles for a relatively crude manner of implementing the optimal
edge-selection strategy. We implemented Buzacott's alternative (i) algorithm in around 150 lines. By contrast, our implementation of FWVD(5) handling degree-3, 4, and 5 vertex decompositions is over 2000 lines of code. While the bodies of the functions k3, k4, k5, and k6 are part of this and were computer generated, there remains a substantial amount of coding to implement the terms of Equation (5) for the various equivalence classes. The memory required for the source code, of course, is a constant that is independent of the size of networks treated. During execution the only memory demands made by either the A3 or FWVD(5) algorithm is for the recursion stack, and this memory requirement is roughly proportional to the square of the size of the network input. Thus both A3 and FWVD(5) have memory requirements that grow quadratically with network size, as opposed to the exponential memory requirements of the Buzacott algorithm. In practice this means that one can treat only networks of limited size via the Buzacott algorithm. (The main example in [1], for instance, was chosen to accommodate the memory requirements of the Buzacott algorithm.) With A3 or FWVD(5), memory is not a factor. By this we mean that the relation of time complexity (as measured by the yardsticks discussed in this paper) to memory demands is such that one never has enough time to use all the available memory. This is true in all computing environments, from microcomputer (where we have done all our implementation and testing) to mainframe.
All-terminal network reliability algorithm
References
1.
2.
3.
4.
M.P. Bailey and V. G. Kulkarni, A recursive algorithm for computing exact reliability measures. IEEE Transactions on Reliability R35 (1986) 36-40. M.O. Ball and E. Cameron, Experiments with network reliability analysis algorithms. Modeling and Simulation: Proceedings of the Seventeenth Annual Pittsburgh Conference (ed. by W. G. Vogt and M. H. Mickle) vol 17 (1986) 1799-1803. J . A . Buzacott, A recursive algorithm for finding reliability measures related to the connection of nodes in a graph. Networks 10 (1980) 311-327. L. Fratta and U. G. Montanari, A recursive method based on case analysis for computing network terminal reliability. IEEE Transactions on Communications C-26 (1978) 1166-
5. 6.
7.
263
1177. R. Johnson, Network reliability and acyclic orientations. Networks 14 (1984) 489-505. L . B . Page and J. E. Perry, A practical implementation of the factoring theorem for network reliability. IEEE Transactions on Reliability R-37 (1988) 259-267. L.B. Page and J. E. Perry, Directed networks and the factoring theorem. Submitted to IEEE Transactions on Reliability.
8.
A. Rosenthal, Computing the reliability of complex networks. SlAM Journal of Applied Mathematics 32 (1977) 384-393. 9. A. Satyanarayana and M. K. Chang, Network reliability and the factoring theorem. Networks 13 (1983) 107-120. 10. R. K. Wood, Factoring algorithms for computing K-terminal network reliability. IEEE Transactions on Reliability R-35 (1986) 269-278.