Approximating the Smallest Spanning Subgraph for 2EdgeConnectivity in Directed Graphs^{†}^{†}thanks: A preliminary version of some of the results of this work was presented at ESA 2015.
Abstract
Let be a strongly connected directed graph. We consider the following three problems, where we wish to compute the smallest strongly connected spanning subgraph of that maintains respectively: the edgeconnected blocks of (2ECB); the edgeconnected components of (2ECC); both the edgeconnected blocks and the edgeconnected components of (2ECBC). All three problems are NPhard, and thus we are interested in efficient approximation algorithms. For 2ECC we can obtain a approximation by combining previously known results. For 2ECB and 2ECBC, we present new approximation algorithms that run in linear time. We also propose various heuristics to improve the size of the computed subgraphs in practice, and conduct a thorough experimental study to assess their merits in practical scenarios.
1 Introduction
Let be a directed graph (digraph), with edges and vertices. An edge of is a strong bridge if its removal increases the number of strongly connected components of . A digraph is edgeconnected if it has no strong bridges. The edgeconnected components of are its maximal edgeconnected subgraphs. Let and be two distinct vertices: and are edgeconnected, denoted by , if there are two edgedisjoint directed paths from to and two edgedisjoint directed paths from to . (Note that a path from to and a path from to need not be edgedisjoint.) A edgeconnected block of is a maximal subset such that for all . Differently from undirected graphs, in digraphs edgeconnected blocks can be different from the edgeconnected components, i.e., two vertices may be edgeconnected but lie in different edgeconnected components. See Figure 1.
A spanning subgraph of has the same vertices as and contains a subset of the edges of . Computing a smallest spanning subgraph (i.e., one with minimum number of edges) that maintains the same edge or vertex connectivity properties of the original graph is a fundamental problem in network design, with many practical applications [18]. In this paper we consider the problem of finding the smallest spanning subgraph of that maintains certain edgeconnectivity requirements in addition to strong connectivity. Specifically, we distinguish three problems that we refer to as 2ECB, 2ECC and 2ECBC. In particular, we wish to compute the smallest strongly connected spanning subgraph of a digraph that maintains the following properties:

the pairwise edgeconnectivity of , i.e., the edgeconnected blocks of (2ECB);

the edgeconnected components of (2ECC);

both the edgeconnected blocks and the edgeconnected components of (2ECBC).
Since all those problems are NPhard [7], we are interested in designing efficient approximation algorithms.
While for 2ECC one can obtain a approximation using known results, for the other two problems no efficient approximation algorithms were previously known. Here we present a lineartime algorithm for 2ECB that achieve an approximation ratio of . Then we extend this algorithm so that it approximates the smallest 2ECBC also within a factor of . This algorithm runs in linear time if the edgeconnected components of are known, otherwise it requires the computation of these components, which can be done in time [12]. Moreover, we give efficient implementations of our algorithms that run very fast in practice. Then we consider various heuristics that improve the size of the computed subgraph in practice. Some of these heuristics require time in the worst case, so we also consider various techniques that achieve significant speed up.
1.1 Related work
Finding a smallest edgeconnected (resp. vertexconnected) spanning subgraph of a given edgeconnected (resp. vertexconnected) digraph is NPhard for for undirected graphs, and for for digraphs [7]. More precisely, if the input graph consists of a single edgeconnected block then the problem asks for the smallest edgeconnected subgraph, whereas if the input graph consists of singleton edgeconnected blocks then the problem coincides with the smallest strongly connected spanning subgraph. Problems of this type, together with more general variants of approximating minimumcost subgraphs that satisfy certain connectivity requirements, have received a lot of attention, and several important results have been obtained. More general problems of approximating minimumcost subgraphs that satisfy certain connectivity requirements has also received a lot of attention; see, e.g., the survey [15].
Currently, the best approximation ratio for computing the smallest strongly connected spanning subgraph (SCSS) is , achieved by Vetta with a polynomialtime algorithm [20]. Although Vetta did not analyze exactly the running time of his algorithm, it needs to solve a maximum matching problem in a relaxation problem. A faster lineartime algorithm that achieves a approximation was given by Zhao et al. [21]. For the smallest edgeconnected spanning subgraph (kECSS), Laehanukit et al. [16] gave a randomized approximation algorithm. Regarding hardness of approximation, Gabow et al. [5] showed that there exists an absolute constant such that for any integer , approximating the smallest kECSS on directed multigraphs to within a factor in polynomial time implies . Jaberi [14] considered various optimization problems related to 2ECB and proposed corresponding approximation algorithms. The approximation ratio in Jaberi’s algorithms, however, is linear in the number of strong bridges, and hence in the worst case.
1.2 Our results
In this paper we provide both theoretical and experimental contributions to the 2ECB, 2ECC and 2ECBC problems. A approximation for 2ECC can be obtained by carefully combining the 2ECSS randomized algorithm of Laehanukit et al. [16] and the SCSS algorithm of Vetta [20]. A faster and deterministic 2approximation algorithm for 2ECC can be obtained by combining techniques based on edgedisjoint spanning trees [4, 19] with the SCSS algorithm of Zhao et al. [21]. We remark that the other two problems considered here, 2ECB and 2ECBC, seem harder to approximate. The only known result is the sparse certificate for edgeconnected blocks of [8]. In this context, a sparse certificate of a strongly connected digraph is a spanning subgraph of with edges. Such a sparse spanning subgraph implies a lineartime approximation algorithm for 2ECB. Unfortunately, no good bound for the approximation constant was previously known, and indeed achieving a small constant seemed to be nontrivial. In this paper, we make a substantial progress in this direction by presenting new 4approximation algorithms for 2ECB and 2ECBC that run in linear time (the algorithm for 2ECBC runs in linear time once the edgeconnected components of are available; if not, they can be computed in time [12]).
From the practical viewpoint, we provide efficient implementations of our algorithms that are very fast in practice. We further propose and implement several heuristics that improve the size (i.e., the number of edges) of the computed spanning subgraphs in practice. Some of our algorithms require time in the worst case, so we also present several techniques to achieve significant speedups in their running times. With all these implementations, we conduct a thorough experimental study and report its main findings. We believe that this is crucial to assess the merits of all the algorithms considered in practical scenarios.
The remainder of this paper is organized as follows. We introduce some preliminary definitions and graphtheoretical terminology in Section 2. Then, in Section 3 we describe our basic approaches and provide a approximation algorithm for 2ECC and approximation algorithms for 2ECB and 2ECBC. Our empirical study is presented in Section 4. Finally, in Section 5 we discuss some open problems and directions for future work.
2 Preliminaries
In this section, we introduce some basic terminology that will be useful throughout the paper.
Flow graphs, dominators, and independent spanning trees.
A flow graph is a digraph such that every vertex is reachable from a distinguished start vertex. Let be a strongly connected digraph. For any vertex , we denote by the corresponding flow graph with start vertex ; all vertices in are reachable from since is strongly connected. The dominator relation in is defined as follows: A vertex is a dominator of a vertex ( dominates ) if every path from to contains ; is a proper dominator of if dominates and . The dominator relation is reflexive and transitive. Its transitive reduction is a rooted tree, the dominator tree : dominates if and only if is an ancestor of in . If , , the parent of in , is the immediate dominator of : it is the unique proper dominator of that is dominated by all proper dominators of . The dominator tree of a flow graph can be computed in linear time, see, e.g., [1, 2]. An edge is a bridge in if all paths from to include .^{1}^{1}1Throughout, we use consistently the term bridge to refer to a bridge of a flow graph and the term strong bridge to refer to a strong bridge in the original digraph . Italiano et al. [13] showed that the strong bridges of can be computed from the bridges of the flow graphs and , where is an arbitrary start vertex and is the digraph that results from after reversing edge directions.
A spanning tree of a flow graph is a tree with root that contains a path from to for all vertices . Two spanning trees and rooted at are edgedisjoint if they have no edge in common. A flow graph has two such spanning trees if and only if it has no bridges [19]. The two spanning trees are maximally edgedisjoint if the only edges they have in common are the bridges of . Two (maximally) edgedisjoint spanning trees can be computed in lineartime by an algorithm of Tarjan [19], using the disjoint set union data structure of Gabow and Tarjan [6]. Two spanning trees and rooted at are independent if for all vertices , the paths from to in and share only the dominators of . Every flow graph has two such spanning trees, computable in linear time [10, 11] which are maximally edgedisjoint.
Condensed graph.
The condensed graph is the digraph obtained from by contracting each edgeconnected component of into a single supervertex. Note that is a multigraph since the contractions can create loops and parallel edges; see Figure 2. For any vertex of , we denote by the supervertex of that contains . Every edge of is associated with the corresponding original edge of . Given a condensed graph , we can obtain the expanded graph by reversing the contractions; each supervertex is replaced by the subgraph induced by the original vertices with , and each edge of is replaced with the corresponding original edge .
3 Approximation algorithms and heuristics
We start by describing our main approaches for solving problem 2ECB. Let be the input directed graph. The first two algorithms process one edge of the current subgraph of at a time, and test if it is safe to remove . Initially , and the order in which the edges are processed is arbitrary. The third algorithm starts with the empty graph , and adds the edges of spanning trees of certain subgraphs of until the resulting digraph is strongly connected and has the same edgeconnected blocks as .
 Two EdgeDisjoint Paths Test.

We test if contains two edgedisjoint paths from to . If this is the case, then we remove edge . This test takes time per edge, so the total running time is . We refer to this algorithm as Test2EDPB. Note that Test2EDPB computes a minimal approximate solution for the 2ECSS problem [3], which is not necessarily minimal for the 2ECB problem.
 EdgeConnected Blocks Test.

If is not a strong bridge in , we test if has the same edgeconnected blocks as . If this is the case then we remove edge . We refer to this algorithm as Test2ECBB. Since the edgeconnected blocks of a graph can be computed in linear time [8], Test2ECBB runs in time. Test2ECBB computes a minimal solution for 2ECB and achieves an approximation ratio of (see Section 3.3.1).
 Independent Spanning Trees.

We can compute a sparse certificate for edgeconnected blocks as in [8], based on a lineartime construction of two independent spanning trees of a flow graph [10, 11]. We refer to this algorithm as ISTB original. We will show later that a suitably modified construction, which we refer to as ISTB, yields a lineartime approximation algorithm.
The first two approaches Test2EDPB and Test2ECBB can be combined into a hybrid algorithm (HybridB), as follows:

if the tested edge connects vertices in the same edgeconnected block (i.e., ), then apply Test2EDPB; otherwise, apply Test2ECBB.
One can show that HybridB returns the same sparse subgraph as Test2ECBB.
Lemma 3.1.
Let be an edge of . Algorithm Test2EDPB deletes only if Test2ECBB does as well. Moreover, if and belong to the same edgeconnected block of , then algorithms Test2EDPB and Test2ECBB are equivalent for , i.e., edge is deleted by Test2ECBB if and only if it is deleted by Test2EDPB.
Proof.
To prove the first part of the lemma, suppose that is deleted by Test2EDPB. We show that the edgeconnected blocks of are not affected by this deletion. Consider any pair of edgeconnected vertices and that was affected by the deletion of , that is, the number of edgedisjoint paths from to was reduced. Let be a minimum  cut in , i.e., , , and . Then we also have and . Since has at least two edgedisjoint paths from to , Menger’s theorem implies that there are at least two edges directed from to . Thus, Menger’s theorem implies has at least two edgedisjoint paths from to .
We now prove the second part of the lemma. Suppose that and lie in the same edgeconnected block of , and edge is deleted by algorithm Test2ECBB. This implies that has two edgedisjoint paths from to , so algorithm Test2EDPB would also delete . ∎
3.1 Providing a sparse certificate as input
As we mentioned above, algorithm ISTB computes in linear time a sparse certificate for the edgeconnected blocks of an input digraph , i.e., a spanning subgraph of with edges that has the same edgeconnected blocks with . In order to speed up our slower heuristics, Test2EDPB, Test2ECBB and HybridB, we can apply them on the sparse certificate instead of the original digraph, thus reducing their running time from to . Moreover, given that ISTB achieves a approximation (Theorem 3.5), it follows that Test2EDPB, Test2ECBB and HybridB produce a approximation for 2ECB in time. Therefore, we applied this idea in all our implementations. See Table 1 in Section 4. We also note that for the tested inputs, the quality of the computed solutions was not affected significantly by the fact that we applied the heuristics on the sparse certificate computed by ISTB instead of the original digraph. Indeed, on average, the number of edges in the computed subgraph was reduced by for Test2EDPB and increased by less than for HybridB. The speed up gained, on the other hand, was by a factor slightly less than for Test2EDPB and by a factor slightly larger than for HybridB.
3.2 Maintaining the edgeconnected components
Although all the above algorithms do not maintain the edgeconnected components of the original graph, we can still apply them to get an approximation for 2ECBC, as follows. First, we compute the edgeconnected components of and solve the 2ECSS problem independently for each such component. Then, we can apply any of the algorithms for 2ECB (Test2EDPB, Test2ECBB, HybridB or ISTB) for the edges that connect different components. To speed them up, we apply them to the condensed graph of . Let be the subgraph of computed by any of the above heuristics, and let be the expanded graph of , were we replace each supervertex of with the corresponding edgeconnected sparse subgraph computed before. We refer to the corresponding algorithms obtained this way as Test2EDPBC, Test2ECBBC, HybridBC and ISTBC. The next lemma shows that indeed is a valid solution to the 2ECBC problem.
Lemma 3.2.
Digraph is strongly connected and has the same edgeconnected components and blocks as .
Proof.
Digraph is strongly connected because the algorithms do not remove strong bridges. It is also clear that and have the same edgeconnected components. So it remains to consider the edgeconnected blocks. Let and be two arbitrary vertices of . We show that and are edgeconnected in if and only if they are edgeconnected in . The “only if” direction follows from the fact that is a subgraph of . We now prove the “if” direction. Suppose and are edgeconnected in . If and are located in the same edgeconnected component then obviously they are edgeconnected in . Suppose now that and are located in different components, so . By construction, for any cut in such that and there are at least two edges directed from to and at least two edges directed from to . This property is maintained by all algorithms, so it also holds in . Then, for any cut in the expanded graph such that and there are at least two edges directed from to and at least two edges directed from to . So and are edgeconnected in by Menger’s theorem. ∎
As a special case of applying Test2EDPB to , we can immediately remove loops and parallel edges if has more than two edges directed from to . To obtain faster implementations, we solve the 2ECSS problems in lineartime using edgedisjoint spanning trees [4, 19]. Let be a edgeconnected component of . We select an arbitrary vertex as a root and compute two edgedisjoint spanning trees in the flow graph and two edgedisjoint spanning trees in the reverse flow graph . The edges of these spanning trees give a approximate solution for 2ECSS on . Moreover, as in 2ECB, we can apply algorithms Test2EDPBC, Test2ECBBC and HybridBC on the sparse subgraph computed by ISTBC. Then, these algorithms produce a approximation for 2ECBC in time. Furthermore, for these time algorithms, we can improve the approximate solution for 2ECSS on each edgeconnected component of , by applying the two edgedisjoint paths test on the edges of . We incorporate all these ideas in all our implementations.
We can also use the condensed graph in order to obtain an efficient approximation algorithm for 2ECC. To that end, we can apply the algorithm of Laehanukit et al. [16] and get a approximation of the 2ECSS problem independently for each edgeconnected component of . Then, since we only need to preserve the strong connectivity of , we can run the algorithm of Vetta [20] on a digraph that results from after removing all loops and parallel edges. This computes a spanning subgraph of that is a approximation for SCSS in . The corresponding expanded graph , where we substitute each supervertex of with the approximate smallest 2ECSS, gives a approximation for 2ECC. A faster and deterministic approximation algorithm for 2ECC can be obtained as follows. For the 2ECSS problems we use the edgedisjoint spanning trees approximation algorithm described above. Then, we solve SCSS on by applying the lineartime algorithm of Zhao et al. [21]. This yields a approximation algorithm for 2ECC that runs in linear time once the edgeconnected components of are available (if not, they can be computed in time [12]). We refer to this algorithm as ZNIC.
Theorem 3.3.
There is a polynomialtime algorithm for 2ECC that achieves an approximation ratio of . Moreover, if the edgeconnected components of are available, then we can compute a approximate 2ECC in linear time.
3.3 Independent Spanning Trees
Here we present our new algorithm ISTB and prove that it gives a lineartime approximation for 2ECB and 2ECBC. Since ISTB is a modified version of the sparse certificate for the edgeconnected blocks of a digraph [8] (ISTB original), let us review ISTB original first.
Let be an arbitrarily chosen start vertex of the strongly connected digraph . The canonical decomposition of the dominator tree is the forest of rooted trees that results from after the deletion of all the bridges of . Let denote the tree containing vertex in this decomposition. We refer to the subtree roots in the canonical decomposition as marked vertices. For each marked vertex we define the auxiliary graph of as follows.

The vertex set of consists of all the vertices in , referred to as ordinary vertices, and a set of auxiliary vertices, which are obtained by contracting vertices in , as follows.

Let be a vertex in . We say that is a boundary vertex in if has a marked child in . Let be a marked child of a boundary vertex : all the vertices that are descendants of in are contracted into .


All vertices in that are not descendants of are contracted into ( if any such vertex exists).
Figures 3 and 4 illustrate the canonical decomposition of a dominator tree and the corresponding auxiliary graphs.
During those contractions, parallel edges are eliminated. We call an edge in shortcut edge. Such an edge has an auxiliary vertex as an endpoint. We associate each shortcut edge with a corresponding original edge , i.e., was contracted into or was contracted into (or both). If has bridges then all the auxiliary graphs have at most vertices and edges in total and can be computed in time. As shown in [8], two ordinary vertices of an auxiliary graph are edgeconnected in if and only if they are edgeconnected in . Thus the edgeconnected blocks of are a refinement of the vertex sets in the trees of the canonical decomposition. The sparse certificate of [8] is constructed in three phases. We maintain a list (multiset) of the edges to be added in ; initially . The same edge may be inserted into multiple times, but the total number of insertions will be . So the edges of can be obtained from after we remove duplicates, e.g. by using radix sort. Also, during the construction, the algorithm may choose a shortcut edge or a reverse edge to be inserted into . In this case we insert the associated original edge instead.
 Phase 1.

We insert into the edges of two independent spanning trees, and of .
 Phase 2.

For each auxiliary graph of , that we refer to as the firstlevel auxiliary graphs, we compute two independent spanning trees and for the corresponding reverse flow graph with start vertex . We insert into the edges of these two spanning trees. We note that induces a strongly connected spanning subgraph of at the end of this phase.
 Phase 3.

Finally, in the third phase we process the secondlevel auxiliary graphs, which are the auxiliary graphs of for all firstlevel auxiliary graphs . Let be a bridge of , and let be the corresponding secondlevel auxiliary graph. For every strongly connected component of , we choose an arbitrary vertex and compute a spanning tree of and a spanning tree of , and insert their edges into ; see Figure 4.
The above construction inserts edges into , and therefore achieves a constant approximation ratio for 2ECB. It is not straightforward, however, to give a good bound for this constant, since the spanning trees that are used in this construction contain auxiliary vertices that are created by applying two levels of the canonical decomposition. In the next section we analyze a modified version of the sparse certificate construction, and show that it achieves a approximation for 2ECB. Then we show that we also achieve a approximation for 2ECBC by applying this sparse certificate on the condensed graph .
3.3.1 The new algorithm IstB
The main idea behind ISTB is to limit the number of edges added to the sparse certificate because of auxiliary vertices. In particular, we show that in Phase 2 of the construction it suffices to add at most one new edge for each firstlevel auxiliary vertex, while in Phase 3 at most additional edges are necessary for all secondlevel auxiliary vertices, where is the number of bridges in .
We will use the following lemma about the strong bridges in auxiliary graphs, which implies that for any secondlevel auxiliary vertex that was not an auxiliary vertex in the first level, subgraph contains the unique edge leaving in .
Lemma 3.4.
Let be a strong bridge of a firstlevel auxiliary graph that is not a bridge in . Then is a bridge in the flow graph .
Proof.
Consider the dominator tree of the flow graph . Let be the tree that results from after the deletion of the auxiliary vertices. Then we have . Moreover, for each auxiliary vertex , is the unique edge entering in , which is a bridge in . Also, is the unique edge leaving in which too is a bridge in . By [13] we have that a strong bridge of must appear as a bridge of or as the reverse of a bridge in , so the lemma follows. ∎
First we will describe our modified construction and apply a charging scheme for the edges added to that are adjacent to auxiliary vertices. Then, we use this scheme to prove that the modified algorithm achieves the desired approximation. Phase 1 remains the same and we explain the necessary modifications for Phases 2 and 3.
 Modified Phase 2.

Let be a firstlevel auxiliary graph. In the sparse certificate we include two independent spanning trees, and , of the reverse flow graph with start vertex . In our new construction, each auxiliary vertex in will contribute at most one new edge in . Suppose first that , which exists if . The only edge entering in is which is the reverse edge of the bridge of . So does not add a new edge in , since all the bridges of were added in the first phase of the construction. Next we consider an auxiliary vertex . In there is a unique edge leaving , where . This edge is the reverse of the bridge of . Suppose that has no children in and . Deleting and its two entering edges in both spanning trees does not affect the existence of two edgedisjoint paths from to in , for any ordinary vertex . However, the resulting graph at the end may not be strongly connected. To fix this, it suffices to include in the reverse of an edge entering from only one spanning tree. Finally, suppose that has children, say in . Then is the unique child of in , and the reverse of the edge of is already included in by Phase 1. Therefore, in all cases, we can charge to at most one new edge.
 Modified Phase 3.

Let be a secondlevel auxiliary graph of . Let be the strong bridge entering in , and let be a strongly connected component in . In our sparse certificate we include the edges of a strongly connected subgraph of , so we have spanning trees and of and , respectively, rooted at an arbitrary ordinary vertex . Let be an auxiliary vertex of . We distinguish two cases:

If is a firstlevel auxiliary vertex in then it has a unique entering edge which is a bridge in already included in .

If is ordinary in but a secondlevel auxiliary vertex in then it has a unique leaving edge , which, by Lemma 3.4, is a bridge in and already contains a corresponding original edge.
Consider the first case. If is a leaf in then we can delete the edge entering in . Otherwise, is the unique child of in , and the corresponding edge entering in has already been inserted in . The symmetric arguments hold if is ordinary in .
This analysis implies that we can associate each secondlevel auxiliary vertex with one edge in each of and that is either not needed in or has already been inserted. If all such auxiliary vertices are associated with distinct edges then they do not contribute any new edges in . Suppose now that there are two secondlevel auxiliary vertices and that are associated with a common edge . This can happen only if one of these vertices, say , is a firstlevel auxiliary vertex, and is ordinary in . Then has a unique entering edge in , which means that is a strong bridge, and thus already in . Also and . In this case, we can treat and as a single auxiliary vertex that results from the contraction of , which contributes at most two new edges in . Since is a firstlevel auxiliary vertex, this can happen at most times in all secondlevel auxiliary graphs, so a bound of such edges follows.

Using the above construction we can now prove that our modified version of the sparse certificate achieves an approximation ratio of .
Theorem 3.5.
There is a lineartime approximation algorithm for the 2ECB problem that achieves an approximation ratio of . Moreover, if the edgeconnected components of the input digraph are known in advance, we can compute a approximation for the 2ECBC problem in linear time.
Proof.
Let denote (as above) the number of bridges in the flow graph . Note that . We consider the three phases of the construction of separately and account for the new edges that are added in each phase. Consider the two independent spanning trees and of that are computed in the first phase. If an edge is a bridge in then it is the unique edge entering in . Thus these two independent spanning trees add into exactly edges.
Now we consider the Modified Phase 2. Let be a firstlevel auxiliary graph. Let and be, respectively, the number of ordinary and auxiliary vertices in . In the sparse certificate we include two independent spanning trees, and , of the reverse flow graph with start vertex . As already explained in the analysis of this phase, each auxiliary vertex in may contribute at most one new edge in . Since and do not contribute any new edges, the total number of edges added for is at most . Hence, the total number of edges added during the second phase is at most , where the sum is taken over all marked vertices . Observe that and , so we have . We note that, as in the original construction, is strongly connected at the end of this phase. Moreover, in this phase we include in the strong bridges of that are not bridges in .
It remains to account for the edges added during the third phase. Here we consider the strongly connected components for each auxiliary graph of after removing the strong bridge entering in . By the argument in the description of the Modified Phase 3, the secondlevel auxiliary vertices contribute at most new edges in total.
We note that the edgeconnected blocks of are formed by the ordinary vertices in each strongly connected component computed for the secondlevel auxiliary graphs. Consider such a strongly connected component . Let be the number of ordinary vertices in . If then we do not include any edges for . So suppose that . Excluding the at most additional edges, the auxiliary vertices in do not contribute any new edges. So the number of edges added by is bounded by . Then, the third phase adds edges in total, where and the sum is taken over all strongly connected components with .
Overall, the number of edges added in is at most . Next, we observe that these vertices must have indegree and outdegree at least equal to in any solution to the 2ECB problem. The remaining vertices must have indegree and outdegree at least equal to one, since the spanning subgraph must be strongly connected. Therefore, the smallest 2ECB has at least edges. The approximation ratio of follows.
Now consider the 2ECBC problem, where we apply our new sparse certificate on the condensed graph . Let be the number of edges computed by our algorithm for all edgeconnected components, where we apply the edgedisjoint spanning trees construction. Let be the total number of edges in an optimal solution. Then . Suppose that the condensed graph has vertices. By the previous analysis, we have that the sparse certificate of has less than edges, where is the number of vertices in nontrivial blocks in the condensed graph. So, our algorithm computes a sparse certificate for with less than edges. The smallest 2ECBC has at least , so the approximation ratio of follows. ∎
Next we note that the above proof implies that the Test2ECB algorithms also achieve a approximation even when they are run on the original digraphs instead of the sparse certificates.
Corollary 3.6.
Algorithm Test2ECBB (resp., Test2ECBBC) applied on the original input (resp., condensed) graph gives a approximate solution for 2ECB (resp., 2ECBC).
Proof.
We consider first algorithm Test2ECBB for the 2ECB problem. Let be a strongly connected digraph with vertices, and let be the number of vertices in nontrivial blocks (i.e., edgeconnected blocks of size at least ). Let be the spanning subgraph of produced by running Test2ECBB on . It suffices to argue that contains less than edges. Suppose that we run ISTB on . Let be the resulting subgraph of . Then, is also a solution to 2ECB for , and by the proof of Theorem 3.5 it has at most edges. But since is a minimal solution to 2ECB for , we must have .
For the 2ECBC problem, assume that the edgedisjoint spanning trees construction produces edges. Then , where is number of edges in an optimal solution. Let be the condensed graph of , and let be the number of its vertices. Let be the spanning subgraph of produced by running Test2ECBBC on . By the proof of Theorem 3.5 and the same argument as for the 2ECB problem, we have that contains at most edges, where is the total number of vertices in nontrivial blocks of . So the corresponding expanded graph has at most edges. Since the smallest 2ECBC solution has at least edges, the 4approximation follows. ∎
3.4 Implementation details
Here we provide some implementation details for our algorithms. In order to obtain a more efficient implementation of the IST algorithms that achieve better quality ratio in practice, we try to reuse as many edges as possible when we build the spanning trees in the three phases of the algorithm. In the third phase of the construction we need to solve the smallest SCSS problem for each subgraph induced by a strongly connected component in the secondlevel auxiliary graphs after the deletion of a strong bridge. To that end, we apply a modified version of the lineartime approximation algorithm of Zhao et al. [21]. This algorithm computes a SCSS of a strongly connected digraph by performing a depthfirst search (DFS) traversal. During the DFS traversal, any cycle that is detected is contracted into a single vertex. We modify this approach so that we can avoid inserting new edges into the sparse certificate as follows. Since we only care about the ordinary vertices in , we can construct a subgraph of that contains edges already added in . We compute the strongly connected components of this subgraph and contract them. Then we apply the algorithm of Zhao et al. on the contracted graph of . Furthermore, during the DFS traversal we give priority to edges already added in .
We can apply a similar idea in the second phase of the construction as well. The algorithm of [10] for computing two independent spanning trees of a flow graph uses the edges of a DFS spanning tree, together with at most other edges. Hence, we can modify the DFS traversal so that we give priority to edges already added in .
3.5 Heuristics applied on auxiliary graphs
To speed up algorithms from the Test2EDP and Hybrid families, we applied them to the firstlevel and secondlevel auxiliary graphs. Since auxiliary graphs are supposed to be smaller than the original graph, one could expect to obtain some performance gain at the price of a slightly worse approximation. However, this performance gain cannot be taken completely for granted, as auxiliary vertices and shortcut edges may be repeated in several auxiliary graphs. Our experiments indicated that applying this heuristic to secondlevel auxiliary graphs yields better results than the ones obtained on firstlevel auxiliary graphs. We refer to those variants as

Test2EDPBAux and HybridBAux,

Test2EDPBCAux and HybridBCAux,
depending on the algorithm (Test2EDP or Hybrid) and problem (2ECB or 2ECBC) considered.
3.6 Trivial edges
For the algorithms of the Test2EDP and Hybrid families we use an additional speedup heuristic in order to avoid testing edges that trivially belong to the computed solution. We say that is a trivial edge of the current graph if it satisfies one of the following conditions:

belongs to a edgeconnected block of size at least two (nontrivial block) and has outdegree at most two, or belongs to a edgeconnected block of size at least two (nontrivial block) and has indegree at most two;

belongs to a edgeconnected block of size one (trivial block) and has outdegree one, or belongs to a edgeconnected block of size one (trivial block) and has indegree one.
Clearly, the removal of a trivial edge will result in a digraph that either has different edgeconnected blocks or is not strongly connected. Therefore these edges should remain in . As we show later in our experiments, such a simple test can yield significant performance gains.
4 Experimental analysis
We implemented the algorithms previously described: for 2ECB, for 2ECBC, and one for 2ECC, as summarized in Table 1. All implementations were written in C++ and compiled with g++ v.4.4.7 with flag O3. We performed our experiments on a GNU/Linux machine, with Red Hat Enterprise Server v6.6: a PowerEdge T420 server 64bit NUMA with two Intel Xeon E52430 v2 processors and 16GB of RAM RDIMM memory. Each processor has 6 cores sharing a 15MB L3 cache, and each core has a 2MB private L2 cache and 2.50GHz speed. In our experiments we did not use any parallelization, and each algorithm ran on a single core. We report CPU times measured with the getrusage function. All our running times were averaged over ten different runs.
For the experimental evaluation we use the datasets shown in Table 2. We measure the quality of the solution computed by algorithm on problem by a quality ratio defined as , where is the average vertex indegree of the spanning subgraph computed by and is a lower bound on the average vertex indegree of the optimal solution for . Specifically, for 2ECB and 2ECBC we define , where is the total number of vertices of the input digraph and is the number of vertices that belong in nontrivial edgeconnected blocks ^{2}^{2}2This follows from the fact that in the sparse subgraph the vertices in nontrivial blocks must have indegree at least two, while the remaining vertices must have indegree at least one, since we seek for a strongly connected spanning subgraph.. We set a similar lower bound for 2ECC, with the only difference that is the number of vertices that belong in nontrivial edgeconnected components. Note that the quality ratio is an upper bound of the actual approximation ratio of the specific input. The smaller the values of (i.e., the closer to 1), the better is the approximation obtained by algorithm for problem .
4.1 Experimental results
We now report the results of our experiments with all the algorithms considered for problems 2ECB, 2ECBC and 2ECC. As previously mentioned, for the sake of efficiency, all variants of Test2EDP, Test2ECB and Hybrid were run on the sparse certificate computed by either ISTB or ISTBC (depending on the problem at hand) instead of the original digraph.
We group the experimental results into two categories: results on the 2ECB problem and results on both 2ECC and 2ECBC problems. In all cases we are interested in the quality ratio of the computed solutions and the corresponding running times. Moreover, in order to better highlight the different behaviour of our algorithms, we present for each algorithm both the quality ratio for each individual input and also give an overall view in terms of boxandwhisker diagrams. Specifically, we report the following experimental results:

For the 2ECC and 2ECBC problems:

their running times are given in Table 6, while the corresponding plotted values are shown in Figure 7 (bottom). We note that the running times include the time to compute the edgeconnected components of the input digraph. To that end, we use the algorithm from [17], which is fast in practice despite the fact that its worstcase running time is .
4.2 Evaluation of the experimental results
There are two peculiarities related to road networks that emerge immediately from the analysis of our experimental data. First, all algorithms achieve consistently better approximations for road networks than for most of the other graphs in our data set. Second, for the 2ECB problem the Hybrid algorithms (HybridB and HybridBAux) seem to achieve substantial speedups on road networks; for the 2ECBC problem, this is even true for Test2ECBBC. The first phenomenon can be explained by taking into account the macroscopic structure of road networks, which is rather different from other networks. Indeed, road networks are very close to be “undirected”: i.e., whenever there is an edge , there is also the reverse edge (expect for oneway roads). Roughly speaking, road networks mainly consist of the union of edgeconnected components, joined together by strong bridges, and their edgeconnected blocks coincide with their edgeconnected components. In this setting, a sparse strongly connected subgraph of the condensed graph will preserve both blocks and components. The second phenomenon is mainly due to the trivial edge heuristic described in Section 3.6.
Apart from the peculiarities of road networks, ZNIC behaves as expected for 2ECC through its lineartime approximation algorithm. Note that for both problems 2ECB and 2ECBC, all algorithms achieve quality ratio significantly smaller than our theoretical bound of . Regarding running times, we observe that the 2ECBC algorithms are faster than the 2ECB algorithms, sometimes significantly, as they take advantage of the condensed graph that seems to admit small size in realworld applications. In addition, our experiments highlight interesting tradeoffs between practical performance and quality of the obtained solutions. Indeed, the fastest (ISTB and ISTB original for problem 2ECB; ISTBC for 2ECBC) and the slowest algorithms (Test2ECBB and HybridB for 2ECB; Test2ECBBC and HybridBC for 2ECBC) tend to produce respectively the worst and the best approximations. Note that ISTB improves the quality of the solution of ISTB original at the price of slightly higher running times, while HybridB (resp., HybridBC) produces the same solutions as Test2ECBB (resp., Test2ECBBC) with rather impressive speedups. Running an algorithm on the secondlevel auxiliary graphs seems to produce substantial performance benefits at the price of a slightly worse approximation (Test2EDPBAux, HybridBAux, Test2EDPBCAux and HybridBCAux versus Test2EDPB, HybridB, Test2EDPBC and HybridBC). Overall, in our experiments Test2EDPBAux and Test2EDPBCAux seem to provide good quality solutions for the problems considered without being penalized too much by a substantial performance degradation.
5 Concluding remarks
We do not know if the approximation ratio of that we provided for the algorithms of the IST and Hybrid families are tight. Figure 8(a) shows a digraph such that a sparse certificate constructible by algorithm ISTB has edges. This digraph has a single nontrivial edgeconnected block consisting of the vertices , which also form a edgeconnected component. An optimal solution for 2ECB on this instance, shown in Figure 8(b), has edges, where each vertex has indegree and outdegree equal to two, while the other four vertices have indegree and oudegree equal to one. Figure 8(c) shows a minimal solution with edges, where again each vertex has indegree and outdegree equal to two but vertex has indegree equal to and vertex has outdegree equal to ; removing any edge of this minimal solution either destroys the strong connectivity of the subgraph or partitions the nontrivial block. So, for this instance ISTB achieves a approximation, while HybridB achieves a approximation. The three phases of the sparse certificate construction by ISTB are given in Figures 9, 10 and 11.
We also note that the example of Figure 8 is not a worstcase instance for HybridB. If the input digraph is edgeconnected then we seek for a smallest edgeconnected spanning subgraph, and Lemma 3.1 implies that HybridB produces the same output as Test2EDPB. So, in this case HybridB achieves an approximation ratio of , which is known to be tight [3]. In light of our experimental results, it seems possible that the Hybrid algorithms always achieve a approximation, but we have no proof.
We close with a couple of few more open questions and possible directions for future work. First, we can consider the case of vertexconnectivity, where we can define the corresponding problems of computing the smallest strongly connected spanning subgraph that maintains the vertexconnected blocks, or the vertexconnected components, or both. A sparse certificate for the vertexconnected blocks is given in [9], so it would interesting to study if based on this construction we can achieve a similar approximation ratio for the vertexconnectivity case. Furthermore, the concept of edgeconnected blocks may well be generalized to edge disjoint paths, for . Keeping in mind that the underlying graph should remain strongly connected, it is natural to ask if computing smallest such spanning subgraph achieves a better approximation ratio for . Such a phenomenon occurs in approximating the smallest spanning edge connected subgraph [3, 5].
References
 [1] S. Alstrup, D. Harel, P. W. Lauridsen, and M. Thorup. Dominators in linear time. SIAM Journal on Computing, 28(6):2117–32, 1999.
 [2] A. L. Buchsbaum, L. Georgiadis, H. Kaplan, A. Rogers, R. E. Tarjan, and J. R. Westbrook. Lineartime algorithms for dominators and other pathevaluation problems. SIAM Journal on Computing, 38(4):1533–1573, 2008.
 [3] J. Cheriyan and R. Thurimella. Approximating minimumsize connected spanning subgraphs via matching. SIAM J. Comput., 30(2):528–560, 2000.
 [4] J. Edmonds. Edgedisjoint branchings. Combinat. Algorithms, pages 91–96, 1972.
 [5] H. N. Gabow, M. X. Goemans, E. Tardos, and D. P. Williamson. Approximating the smallest edge connected spanning subgraph by LProunding. Networks, 53(4):345–357, 2009.
 [6] H. N. Gabow and R. E. Tarjan. A lineartime algorithm for a special case of disjoint set union. Journal of Computer and System Sciences, 30(2):209–21, 1985.
 [7] M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the Theory of NPCompleteness. W. H. Freeman & Co., New York, NY, USA, 1979.
 [8] L. Georgiadis, G. F. Italiano, L. Laura, and N. Parotsidis. 2edge connectivity in directed graphs. In SODA 2015, pages 1988–2005, 2015.
 [9] L. Georgiadis, G. F. Italiano, L. Laura, and N. Parotsidis. 2vertex connectivity in directed graphs. In ICALP 2015, pages 605–616, 2015.
 [10] L. Georgiadis and R. E. Tarjan. Dominator tree verification and vertexdisjoint paths. In SODA 2005, pages 433–442, 2005.
 [11] L. Georgiadis and R. E. Tarjan. Dominator tree certification and independent spanning trees. CoRR, abs/1210.8303, 2012.
 [12] M. Henzinger, S. Krinninger, and V. Loitzenbauer. Finding 2edge and 2vertex strongly connected components in quadratic time. In ICALP 2015, pages 713–724, 2015.
 [13] G. F. Italiano, L. Laura, and F. Santaroni. Finding strong bridges and strong articulation points in linear time. Theor. Comput. Sci., 447(0):74–84, 2012.
 [14] R. Jaberi. Computing the blocks of directed graphs. RAIROTheor. Inf. Appl., 49(2):93–119, 2015.
 [15] G. Kortsarz and Z. Nutov. Approximating minimum cost connectivity problems. Approximation Algorithms and Metaheuristics, 2007.
 [16] B. Laekhanukit, S. O. Gharan, and M. Singh. A rounding by sampling approach to the minimum size karc connected subgraph problem. In ICALP 2012, pages 606–616, 2012.
 [17] W. Di Luigi, L. Georgiadis, G. F. Italiano, L. Laura, and N. Parotsidis. 2connectivity in directed graphs: An experimental study. In ALENEX 2015, pages 173–187, 2015.
 [18] H. Nagamochi and T. Ibaraki. Algorithmic Aspects of Graph Connectivity. Cambridge University Press, 2008. 1st edition.
 [19] R. E. Tarjan. Edgedisjoint spanning trees and depthfirst search. Acta Informatica, 6(2):171–85, 1976.
 [20] A. Vetta. Approximating the minimum strongly connected subgraph via a matching lower bound. In SODA 2001, pages 417–426, 2001.
 [21] L. Zhao, H. Nagamochi, and T. Ibaraki. A linear time 5/3approximation for the minimum stronglyconnected spanning subgraph problem. Information Processing Letters, 86(2):63–70, 2003.