Twinless Strongly Connected Components
Total Page:16
File Type:pdf, Size:1020Kb
Twinless Strongly Connected Components S. Raghavan The Robert H. Smith School of Business & the Institute for Systems Research Van Munching Hall University of Maryland College Park, MD 20742 [email protected] Summary. Tarjan [9], describes how depth ¯rst search can be used to identify Strongly Connected Components (SCC) of a directed graph in linear time. It is standard to study Tarjan's SCC algorithm in most senior undergraduate or intro- ductory graduate computer science algorithms courses. In this paper we introduce the concept of a twinless strongly connected component (TSCC) of a directed graph. Loosely stated, a TSCC of a directed graph is (i) strongly connected and (ii) remains strongly connected even if we require the deletion of arcs from the component so that it does not contain a pair of twin arcs (twin arcs are a pair of bidirected arcs (i; j) and (j; i) where the tail of one arc is the head of the other and vice versa). This structure has diverse applications, from the design of telecommunication networks [7] to struc- tural stability of buildings [8]. In this paper, we illustrate the relationship between 2-edge connected components of an undirected graph|obtained from the strongly connected components of a directed graph|and twinless strongly connected com- ponents. We use this relationship to develop a linear time algorithm to identify all the twinless strongly connected components of a directed graph. We then consider the augmentation problem, and based on the structural properties developed earlier, derive a linear time algorithm for the augmentation problem. Key words: Digraph augmentation; strong connectivity; linear time algorithm. 1 Introduction Let D = (N; A) be a directed graph (digraph) with node set N and arc set A. A pair of nodes x and y are twinless reachable if there exists a directed path from node x to node y, and a directed path from node y to node x, such that for every arc (i; j) contained in the path from node x to node y, the path from node y to node x does not contain arc (j; i). The Twinless Strongly Connected Components (TSCCs) of a digraph are the equivalence classes of nodes under the \twinless reachable" condition (we will show later that the twinless reachable condition de¯nes an equivalence relationship). We 2 S. Raghavan TSCC Twinless Strongly Connected Component (TSCC) TSCC TSCC Fig. 1. Twinless Strongly Connected Components of a digraph. Bold arcs show twinless arcs that form a strongly connected component. say a digraph is Twinless Strongly Connected if every pair of nodes is twinless reachable. We now provide a slightly di®erent, but equivalent, de¯nition of twinless strongly connectedness. We say that a pair of bidirected arcs (i; j) and (j; i) are twins. Recall that a digraph is strongly connected if it contains a directed path between every pair of its nodes. Our alternate de¯nition then is as follows. A digraph D = (N; A) is Twinless Strongly Connected if for some subset A0 of A, the digraph (N; A0) is strongly connected and A0 does not contain an arc together with its twin. A Twinless Strongly Connected Component (TSCC) of a digraph is the node set of a maximal twinless strongly connected subdigraph of D. Figure 1 gives an example of four TSCCs, that contain 3 or more nodes, in a digraph. It should be apparent that every pair of nodes in a TSCC, as de¯ned by the second de¯nition, are twinless reachable. What may not readily apparent is the converse. That is, if N i is a TSCC under the ¯rst de¯nition of a TSCC. Then, Twinless Strongly Connected Components 3 the subdigraph Di = (N i;Ai), where Ai = f(x; y)j(x; y) 2 A; x 2 N i; y 2 N ig, is twinless strongly connected as per the second de¯nition. We will work with the second de¯nition until we show, in the next section, that both de¯nitions are indeed equivalent. Additionally, when considering digraphs, it is clear that reachability is a transitive property. That is, if there is a directed path from node x to node y, and a directed path from node y to node z, then there is a directed path from node x to node z. It turns out that the twinless reachable property is also transitive, but this is not so obvious. Transitivity of the twinless reachable property means that, if a pair of nodes x and y are twinless reachable, and a pair of nodes y and z are twinless reachable, then the pair of nodes x and z are twinless reachable. Transitivity is necessary to de¯ne an equivalence relationship and we will show this property in the next section. In this paper, we consider the following questions (analogous to those for SCCs) in connection with TSCCs. How do we recognize TSCCs of a digraph? Is it possible to recognize TSCCs of a digraph in linear time? We also consider the (unweighted) augmentation problem. That is, given a digraph D = (N; A) ¯nd the minimum cardinality set of arcs A0 to add to the digraph so that D = (N; A [ A0) is twinless strongly connected (In a seminal paper Eswaran and Tarjan [4] introduced and solved the augmentation problem for strong connectivity). Our answer to these questions is a±rmative. Speci¯cally, we develop linear time algorithms to recognize all TSCCs of a digraph and to solve the augmentation problem. The remainder of this paper is organized as follows. In Section 2 we ¯rst derive some structural properties of TSCCs. Speci¯cally we show a correspon- dence between TSCCs in a strongly connected digraph and 2-edge connected components of an associated undirected graph. Using these structural prop- erties, in Section 3 we describe a linear time algorithm for identifying the TSCCs of a digraph. In Section 4 we consider the augmentation problem and show how to solve the unweighted version of the augmentation problem in linear time. In Section 5 we describe some applications of this structure| one in telecommunications, and one in determining the structural rigidity of buildings. Finally, in Section 6 we discuss a connection between the notion of a twinless strongly connected digraph and strongly connected orientations of mixed graphs. 2 TSCCs of a Strongly Connected Digraph and 2-Edge Connected Components We now derive some structural properties of TSCCs in a strongly connected digraph D. For ease of exposition, we introduce some additional notation. The TSCC induced digraph of D is the digraph DTSCC = (N TSCC;ATSCC) obtained by contracting each TSCC in D to a single node. We replace parallel arcs that the contraction creates by a single arc. Every node in the TSCC 4 S. Raghavan q P' s jP i a t Fig. 2. Proof that the paths P and P 0 are twin paths. induced digraph DTSCC corresponds to a TSCC in the original digraph D. Consequently, for any node i 2 N TSCC we refer to the TSCC node i corre- sponds to in the original digraph, including the arcs and nodes in the TSCC, as TSCC(i). For any digraph D = (N; A), the associated undirected graph G(D) = (N; E) is a graph with edges E = ffi; jg :(i; j) 2 A and/or (j; i) 2 Ag. If (i; j) belongs to A, we refer to the edge fi; jg in E as an image of this arc. We say that two paths P and P 0 are twin paths if P is a path from node i to node j, and P 0 is a path from node j to node i that uses exactly the reversal (i.e., the twin) of each arc on the path P . We ¯rst prove a useful property concerning the structure of directed paths between TSCCs in a strongly connected digraph. Theorem 1 (Twin-arc). Let D = (N; A) be any strongly connected digraph and let DTSCC be its TSCC induced digraph. The associated undirected graph of DTSCC is a tree. Moreover, every edge in the associated tree is the image of a pair of twin arcs (and no other arcs) of D. Proof: First, consider the TSCC induced subdigraph DTSCC (note that since D is strongly connected, so is DTSCC). We show that DTSCC contains a twin path and no other path between any two nodes. As a result, the associated undi- rected graph of DTSCC is a tree. We will establish this result by contradiction. Assume the digraph DTSCC contains a path P from a node s to a node t and a path P 0 from node t to node s that are not twin paths. Let arc (i; q) be the ¯rst arc on P 0 that does not have a twin arc on the path P and let j be the ¯rst node following node i on the path P 0 that lies on the path P (see Figure 2). Then all nodes on P 0 between nodes i and j and all nodes on P between nodes j and i are twinless strongly connected and thus in the same TSCC. In other words, nodes i and j do not correspond to maximal twinless strongly connected subdigraph's of D (i.e., TSCCs). But, DTSCC is obtained by contracting TSCCs in D and thus each node in DTSCC is a TSCC. We now have a contradiction. We now show that every pair of twin arcs in DTSCC corresponds to a pair of twin arcs and no other arcs of D. As a result, every edge in the associated Twinless Strongly Connected Components 5 tree (i.e., G(DTSCC)) is the image of a pair of twin arcs and no other arcs of D.