A

. Decomposing a directed graph to its strongly connected components (SCCs) is a fundamental task in model checking. To deal with the state-space explosion problem, graphs are often represented symbolically using binary decision diagrams (BDDs), which have exponential compression capabilities. The theoretically-best symbolic algorithm for SCC decomposition is Gentilini et al’s Skeleton algorithm, that uses O ( n ) symbolic steps on a graph of n nodes. However, Skeleton uses (cid:2) ( n ) symbolic objects, as opposed to (poly-)logarithmically many, which is the norm for symbolic algorithms, thereby relinquishing its symbolic nature. Here we present Chain , a new symbolic algorithm for SCC decomposition that also makes O ( n ) symbolic steps, but further uses log-arithmic space , and is thus truly symbolic . We then extend Chain to ColoredChain , an algorithm for SCC decomposition on edge-colored graphs , which arise naturally in model-checking a family of systems. Finally, we perform an experimental evaluation of Chain among other standard symbolic SCC algorithms in the literature. The results show that Chain is competitive on almost all benchmarks, and often faster, while it clearly outperforms all other algorithms on challenging inputs.


Introduction
Strongly connected components (SCCs) are one of the most elegant and widely applicable concepts of graph theory. They play a fundamental role in model checking for LTL and ω-regular properties, as most model-checking tasks reduce to locating cycles that traverse certain vertices in a graph [26], while strong fairness assumptions typically require an SCC decomposition at hand [21,31]. SCCs are also a key step to characterizing the attractor properties of systems, such as bottom SCCs in Markov Chains [2] and maximal end components in Markov Decision Processes [12]. From an algorithmic point of view, the simplest approach to SCC decomposition is by running a forward-backward reachability analysis from each vertex, which results in O(n 2 ) time on a graph of n vertices. The celebrated Tarjan's algorithm [28], and subsequently Dijkstra's algorithm [15] and Kosaraju-Sharir's algorithm [27] have reduced the complexity down to O(n).
In the everyday practice of model checking, systems are represented as symbolic, rather than explicit graphs. One predominant symbolic representation is via (reduced/ordered) Binary Decision Diagrams (BDDs) [9], which are found at the core of many classic and modern model checkers [13,23,19,24,3]. BDDs can offer exponential compactness of the huge state space typically involved in the model-checking task, by succinctly encoding symmetries abundant in the represented system. On the other hand, this symbolic representation gives only coarse-grained efficient access to the graph. In particular, one can query for the image and preimage of a set of vertices with respect to the edge relation, which accounts for one symbolic step. Although the time for performing a symbolic step may vary, it is typically significantly larger than the time taken to perform elementary operations (e.g., incrementing a counter). As such, symbolic steps serve as the complexity measure of symbolic algorithms [8,18,11].
The simplest symbolic algorithm for SCC decomposition is the FwdBwd algorithm, which computes the SCC of a vertex u as the intersection of its forward and backward sets (as in the explicit setting). As this results in O(n 2 ) time complexity, the algorithm is often too slow in practice. The key challenge towards efficient symbolic SCC algorithms is the seeming difficulty to traverse the input graph G in a depth-first fashion, which is the technical underpinning of the O(n)-time explicit SCC algorithms. Nevertheless, a series of improvements have been made in this direction: (i) a variant of FwdBwd was shown in [30] to run in time O(δn), where δ is the diameter of G, and only becomes quadratic when δ = Θ(n), (ii) the LockStep algorithm [7] has complexity O(n log n), while (iii) the Skeleton algorithm with complexity O(n) is provably optimal [11]. Practical improvements based on heuristics have also been proposed [29,16,31].
One characteristic requirement for symbolic algorithms is that they operate in logarithmic symbolic space, i.e., they use logarithmically many objects, with the size of a single symbolic data structure (e.g., a BDD) counting as O(1) [11]. Indeed, without this restriction, an algorithm could extract, and later analyze, an explicit representation of its input graph, thereby relinquishing its symbolic nature. Unfortunately, the theoretically optimal Skeleton algorithm uses Θ(n) space, thereby violating the logarithmic-space requirement. As such, we find that Skeleton is not truly symbolic, which also has a measurable effect: perhaps paradoxically, Skeleton is often the slowest algorithm in practice.

Our Contributions
The Chain algorithm. We present a new algorithm, Chain, for symbolically computing SCC decompositions. On input graph G with n vertices, Chain takes time O( S∈SCCs(G) (δ(S) + 1)) = O(n), where SCCs(G) denotes the SCCs of G and δ(S) is the diameter of S. It is known that Ω( S∈SCCs(G) (δ(S) + 1)) is also a lower bound for the problem [11], thus Chain is optimal. Moreover, Chain uses O(log n) symbolic data structures, thus being truly symbolic.
It is worth highlighting that Chain offers optimality while also being arguably the simplest among all symbolic SCC decomposition algorithms beyond FwdBwd. Indeed, Chain simply extends FwdBwd to accept as an argument a set of vertices K, among which to choose a pivot in the current recursive call. It is perhaps surprising that such a simple mechanism has been elusive for decades, as all previous efforts [30,7,17] relied on more elaborate procedures to either reduce or refine the O(n 2 ) time bound. That being said, our new mechanism is somewhat insightful and with a non-trivial complexity analysis.
The ColoredChain algorithm. We extend Chain to ColoredChain for computing SCCs on edge-colored graphs, in which edges have colors, and SCCs are formed by restricting to monochromatic paths. Although a graph of p colors can be handled in O(pn) time by breaking it to its monochromatic components and executing Chain on each of them, ColoredChain handles all colors simultaneously, thus benefiting from the symbolic compression of the edge relation across multiple colors. A similar approach was followed recently [6], by extending the standard LockStep algorithm [7] to colored graphs. However, the corresponding colored LockStep algorithm runs in time O(pn log n), as it inherits the log n factor from the basic LockStep algorithm.
Experimental evaluation. We implement and evaluate Chain in controlled, synthetic, and previously-used experimental settings. We find that Chain is never notably slower than other, standard algorithms, except when compared to LockStep on a few benchmarks. On the other hand, Chain is measurably faster than all other algorithms on demanding inputs. We further evaluate ColoredChain on colored Boolean Networks, used recently for the colored LockStep algorithm [6]. Our results indicate that ColoredChain is considerably faster than LockStep, making it a promising alternative for the analysis of Boolean networks.

Preliminaries
Here we set up our main notation on graphs, SCCs, and symbolic algorithms.
Graphs. We consider (directed) graphs G = (V, E), where V is a set of n vertices and E ⊆ V × V is a set of edges. Given a set X ⊆ V , the restriction of G on X is the graph G[X] = (X, E ∩ (X × X)). For a vertex v, we let Pre(v) = {u : (u, v) ∈ E} and Post(v) = {u : (v, u) ∈ E} denote the set of preimage and image of v under E, respectively. We lift this notation to sets of vertices X, by letting Pre(X) = v∈X Pre(v) and Post(X) = v∈X Post(v). A path from v to u in G is a sequence of vertices P : v = w 1 , w 2 , . . . , w = u such that, for each i ∈ [ − 1], we have (w i , w i+1 ) ∈ E. The length of P is |P | = − 1, while a single vertex v serves as a path of length 0. We denote by v u the existence of a path from v to u, and call u reachable from v if there is such a path in G. For a vertex v ∈ V , we let Fwd(v) and Bwd(v) denote the reflexive transitive closure of Post(v) and Pre(v), respectively. In other words, Fwd(v) (resp., Bwd(v)) contains the vertices that are reachable from v (resp., can reach v). Given an additional set X ⊆ V , we let Fwd(v, X) and Bwd(v, X) denote the forward and backward, respectively, set of v in the graph G[X]. The distance from v to u is the length of the shortest path v u, i.e., d(v, u) = min P : v u |P |, where we take the minimum of an empty set to be ∞. The diameter of a set X ⊆ V is δ(X) = max v,u∈X,v u d(v, u), i.e., it is the maximum distance between any pair of vertices in X, provided that they are connected by a path.
Strongly connected components (SCCs). A set X ⊆ V is strongly connected if, for every two vertices v, u ∈ X, we have v u. A strongly connected component (SCC) of G is a maximal strongly connected set S ⊆ V . Given a vertex v ∈ V , we let SCC(v) denote its SCC. We let SCCs(G) denote the set of SCCs of G; note that SCCs(G) induces a partitioning on V . A set X ⊆ V is called SCC-closed if for every S ∈ SCCs(G), we have either S ⊆ X or S ∩ X = ∅. In other words, for every v ∈ X, we have SCC(v) ⊆ X. We sometimes call G[X] SCC-closed, to indicate that X is SCC-closed (in G).
Symbolic operations and complexity measures. We consider that graphs are represented symbolically using Binary Decision Diagrams (BDDs) [9]. The symbolic representation suggests that efficient access to the graph can only be carried out in a coarse-grained way. In particular, given a symbolicallyrepresented set of vertices X, a symbolic operation on X is either Pre(X) or Post(X), and serves as the unit of time in measuring the time complexity of symbolic algorithms. As per standard, we also perform common set operations such as union, intersection, and difference, and use a specialized function Pick(X) that returns an arbitrary vertex u ∈ X. This operation is natural in symbolic SCC algorithms, as typically one needs to identify a specific vertex u in order to output SCC(u). In alignment with the symbolic time complexity, the symbolic space complexity of an algorithm is measured in number of (symbolic, or not) objects it uses. As symbolic representations usually allow (in the context they are designed for) large (and sometimes, even exponential) compression, we require symbolic algorithms to operate in logarithmic symbolic space [11].

The Chain Algorithm
In this section we present the main result of this paper: a new algorithm, called Chain, that runs in linear time and is truly symbolic (i.e., it uses O(log n) symbolic memory). In particular, we establish the following theorem. Note that O( S∈SCCs(G) (δ(S) + 1)) = O(n), as SCCs(G) partition G, while for each S ∈ SCCs(G) we have δ(S) ≤ |S|. It is worth observing that O( S∈SCCs(G) (δ(S) + 1)) can, however, be much smaller than n: e.g., over cliques G, this bound becomes O(1). On the other hand, it is known that Ω( S∈SCCs(G) (δ(S) + 1)) is also a lower bound for the problem [11], hence Theorem 1 is tight. As was shown in [11], a more refined analysis of the Skeleton algorithm also achieves the time bound of Theorem 1. However, Skeleton suffers a linear space bound, and thus is not truly symbolic.
In the following, we first present Chain in detail in Section 3.1. It's correctness is relatively straightforward, and stated in Section 3.2. On the other hand, its complexity analysis is more involved, and is presented in Section 3.3.

Algorithm
Here we present Chain in detail, develop some intuition behind its time complexity, and illustrate its execution on a small example.

Algorithm 1: Chain
Input: The Chain algorithm. Algorithm 1 presents Chain in pseudocode. The principle of operation of the algorithm is, perhaps, surprisingly simple. Given a G = (V, E) and a pivot vertex v of G, the algorithm computes SCC(v) in two phases, similarly to the standard FwdBwd algorithm. In particular: However, in order to avoid the high complexity, Chain passes along each recursive call the K argument (initially K = ∅). This argument restricts the recursive call to pick its next pivot v such that v ∈ K; choosing the right set to pass as K makes the algorithm achieve its tight time complexity.
Conceptually, after Fwd(v, V ) has been computed, the first recursive call (Line 14) chooses K to be the set of vertices that are of maximum distance from v (and not in SCC(v), as those are output in Line 13). On the other hand, the second recursive call (Line 15) chooses K to be the predecessors of SCC(v). Although the formal complexity analysis is somewhat involved (see Section 3.3), the key, high-level idea is as follows. When computing Fwd(v, V ), the algorithm has taken a number of symbolic steps that is proportional to the maximum distance of a vertex from v. The chain of recursive calls starting in Line 14 and followed by all recursive calls in Line 15 until Pre(S) ∩ F = ∅, ensures that the algorithm will output all SCCs, in reverse order, along a maximal path from v to a vertex in Fwd(v, V ) \ SCC(v). This amortizes the high cost of computing Fwd(v, V ) in the current call to the cost of outputting these SCCs in future calls, leading to only a constant factor increase in the overall complexity.
Besides viewing Chain as an augmentation of the FwdBwd algorithm with a restriction on pivots, the algorithm can also be seen as a simplification of the Skeleton algorithm [17]. Indeed, the computation of skeletons in the latter serves the exact purpose to force the recursion to output SCCs in the same order as in our chain argument above. As we show here, computing skeletons is redundant: dropping them makes the algorithm simpler, truly symbolic, while not sacrificing any of its time-complexity guarantees.
Example. Fig. 1 illustrates Chain on a graph G = (V, E) (left). The tree T (right) represents the recursion of Chain as it outputs SCCs(G). We identify every vertex of T by a vertex v ∈ V for which SCC(v) is computed in the corresponding step. We subscript variables of the algorithm with v to denote their value at that step. E.g., V v denotes the vertex set in the recursive call that computed SCC(v), and F v denotes the forward set computed after the loop of Line 7 has completed. The edges of T are labeled with the line that performed the respective recursive call.
The key observation for understanding the complexity of Chain is as follows. In the first step, the algorithm has paid the high cost of 5 symbolic steps to compute F 1 , while its output is a small SCC of 2 vertices. However, the path 1 in T forms a chain from vertex 6, which is of maximum distance from 1, back to vertex 3 that is adjacent to SCC(1). The cost of computing F 1 can thus be amortized to outputting the SCCs along this chain (i.e., SCC(3), SCC(4), SCC(6)), yielding only a linear overhead. As we prove in Section 3.3, this behavior is not accidental, but guaranteed in every recursive call.

Correctness
We start with the soundness of Chain, i.e., it only outputs SCCs of G.  Proof. Consider any call to Chain on input G = (V , E ), K , with K ⊆ V . The algorithm first picks a vertex v from either V or K , with v ∈ S, where S is the set outputted in Line 13. It is straightforward to see that, after the loop in Line 7 has executed, we have F = Fwd(u, V ), while after the loop in Line 11 has executed, we have S = Fwd(u, V ) ∩ Bwd(u, V ). It suffices to argue that G is an SCC-closed subgraph of G, which implies that S = SCC(v).
The statement is true initially, as G = G. Now, assuming that the statement holds on some input in Line 14 and Line 15, respectively, is SCC-closed. Indeed, F is closed under Post operations and thus SCC-closed. As S is an SCC of X, we have that F \S is also SCC closed. Since F \ S, S, and V \ F partition V , we have that G [V \ F ] is also SCC-closed. The desired result follows.
Lemma 2. Chain outputs every SCC in SCCs(G) exactly once.
Proof. The statement follows from the fact that, in every recursive call on input G = (V , E ), the sets F \ S, S, and V \ F partition V .

Complexity Analysis
We now present the (symbolic) time and space complexity analysis of Chain. For measuring time, we only count the number of Pre(·) and Post(·) operations.
Consider any input G = (V, E), and let T be the recursion tree produced by the execution of Chain on G, as in Fig. 1. We will use lowercase (resp., uppercase) letters to refer to the vertices of G (resp., T ), and we will subscript the variables of the algorithm with vertices of T (e.g., V A ) to refer to variables in the recursive call associated with the recursive step (at A). T has labeled directed edges A For every i iterating in i∈[k] (δ(SCC(v Bi )) + 1), the vertex v Bi will not appear in such a sum in any other vertex A of T . Indeed assume towards contradiction that for some vertex B i there are two vertices A = A and paths   with B i = B i . Due to the edge labels, none can be a sub-path of the other, which, in turn, contradicts the tree structure of T . Given such a vertex B i , let A(B i ) denote its unique ancestor in T that appears as vertex A in the path P above.
The total running time of Chain on G is ≤ B∈T (3δ(SCC(v B ))+4), obtained by counting for each vertex B of T (i) the 2δ(SCC(v B ))+3 symbolic operations from its own recursive call, plus (ii) δ(SCC(v B )) + 1 symbolic operations from the call at A(B). Hence the total number of symbolic steps is O( S∈SCCs(G) (δ(S) + 1)).
Proof of Lemma 3. We now turn our attention to the proof of Lemma 3. Consider again the path A We start with two simple lemmas.
Proof. The statement holds for i = 1, since otherwise Last A \S A = ∅, implying that F A \ S A = V B1 = ∅, and thus B 1 would not be a vertex of T . The statement also holds for all i > 1, by construction of the path to B k .
Proof. The lemma follows from the more general statement that v i ∈ Fwd(v i+1 ). Indeed, by Lemma 4, we have that v i+1 ∈ Pre(S Bi ), while S Bi = SCC(v i ).
We call a vertex u critical if it is the first vertex w in a path from v A to v k in V A , such that w ∈ SCC(v A ). We further call a path u v k critical if u is a critical vertex. In the example of Fig. 1, for the first call to Chain, where v A = 1, vertex 3 is a critical vertex and the path 3 → 4 → 5 → 6 is a critical path. The following lemma captures the fact that every recursive call B i is performed on a vertex set V Bi that is adjacent to SCC(v A ).
thus the statement holds for i = 1. Now assume that the statement holds for some i ≥ 1, and we argue that it holds for i + 1. Take any critical path P : u v k in V Bi , and assume towards contradiction that P is not a path in V Bi+1 (i.e., at least one vertex of P is outside V Bi+1 ). Since V Bi+1 = V Bi \ Fwd(v i , V Bi ), we obtain that P has a vertex w with w ∈ Fwd(v i , V Bi ), and hence v k ∈ Fwd(v i ). By Lemma 5, we also have v i ∈ Fwd(v k ), thus SCC(v i ) = SCC(v k ), violating the choices of v i . Thus V Bi+1 has a critical path.
Specifically for the case i = k, the following is a strengthening of Lemma 6, showing that SCC(v k ) (only a subset of V B k ) is also adjacent to SCC(v A ). Proof. By Lemma 6, we have a critical path u v k in V B k . By construction, Let v k+1 be a critical vertex in SCC(v k ), whose existence is guaranteed by Lemma 7. Given a vertex u ∈ V A , we write (u) for the distance of u from v A in V A . Note that Levels(A) = (v 1 ). Observe that for all u, v ∈ V A , if u ∈ SCC(v) then (u) − (v) ≤ δ(SCC(v)). The following two lemmas relate the distances (v i ) with the diameters of SCCs, and lead to the proof of Lemma 3.

Proof (of Lemma 3).
(δ(SCC(v i )) + 1) + δ(SCC(v A )) + 1 [Lemma 9] Space complexity. Finally, we address the O(log n) symbolic-space complexity of Theorem 1. Chain uses O(1) symbolic sets in each recursive call. To achieve the O(log n) bound, it suffices to first follow the recursive call between Line 14 and Line 15 with the smaller graph input. This results in O(log n) pending recursive calls at any step of the execution, leading to storing O(log n) symbolic sets overall. Note that this requires a function Count(X) that returns the size of a symbolically represented set X. This is not a problem: BDDs are equipped with such operations, and their complexity is only linear in the size of the representation of X, even though X might be exponentially large.

Extension to Colored Graphs
In this section we turn our attention to colored graphs, where the edge relation is parameterized by colors, and SCCs are formed with respect to monochromatic components of the graph. Each edge color stands for a different binary relation, and all colors together allow to superpose several graphs on top of each other. Although each monochromatic graph could be represented in isolation, this superpositioning allows for an efficient symbolic representation, especially when the edge relations are highly similar. In turn, this asks for efficient symbolic algorithms that are able to exploit similarities between colors. Our study of this setting is inspired by the recent extension of LockStep to colored graphs [6].

Edge-Colored Graphs
Here we lift some of our graph notation from Section 2 to the colored setting.  Colored SCCs. Given a colored graph G = (V, C, E), a c-colored SCC of G is a pair S = (R, c) ⊆ V × {c} such that R is an SCC of G c . Given a vertex v ∈ V and a color c ∈ C, we write SCC(v, c) for the SCC of v in G c . We let SCCs(G) denote the set of SCCs of G, and observe that SCCs(G) partitions Given an SCC-closed set X, we will also call G[X] SCC-closed. Given a degenerate set V, we write SCC(V) for the set of Symbolic operations. Similarly to the non-colored setting, we use symbolic operations Pre(X) and Post(X) on sets X ⊆ V ×C, which incur a unit time cost. We further perform unions, intersections and differences on subsets of V ×C, and use a specialized operation Pick(X) that returns an arbitrary pair (v, c) ∈ X. Finally, we consider at our disposal a function Pivots(X), that acts on sets X ⊆ V × C and returns a maximal degenerate subset of X containing one pair (v, c) per color c appearing in X. This operation can be performed by combining Pick with basic set operations, and has also appeared in other works [6].

The ColoredChain Algorithm
Here we present our extension of Chain for handling edge colored graphs.

Algorithm 2: ColoredChain
Input: A graph G = (V, C, E), two colored vertex sets X, K ⊆ V × C, The ColoredChain algorithm. Algorithm 2 presents ColoredChain in pseudocode. The algorithm takes as input an edge-colored graph G = (V, C, E), as well as two colored vertex sets X and K (initially X = V ×Colors and K = ∅).
In words, the current and future recursive steps will compute the colored SCCs of G that are subsets of X. The set K serves the same purpose as in the basic Chain algorithm, i.e., to restrict the set of vertices over which we select pivots in the current recursive call, towards the linear-time properties of the algorithm. The algorithm starts by selecting a degenerate set of pivots V in Line 2, with the goal to output each SCC(v, c), for (v, c) ∈ V in the current recursive step. The pivot set is constructed to contain one pair (v, c) for every color c present in X. If c is also present in K, then the algorithm selects a pivot (v, c) ∈ K, otherwise, it chooses an arbitrary pivot from X. The algorithm then computes SCC(V) as Fwd(V, X) ∩ Bwd(V, X), similarly to the non-colored case (where V is simply a non-colored vertex). In the i-th iteration of the loop of Line 4, the variable Last contains the vertices (u, c) that have maximum distance ≤ i from (v, c) ∈ V. As these maximal distances might converge at different lengths for different colors, extra care is taken in Line 6 to maintain the converged colors in the next iteration. Finally, the algorithm outputs SCC(V) (Line 10), and proceeds recursively on the disjoint subsets F \ S and X \ F (Line 11 and Line 12). The K argument is passed on each recursive call in the same way as in the Chain algorithm, so that, in effect, the time taken to compute F is amortized by the time to output colored SCCs in subsequent recursive calls (where now the amortization also takes place among colors). Observe that, in the special case of p = 1 color, ColoredChain operates identically to Chain.
Correctness and complexity. Due to the similarity of ColoredChain to Chain, we will only sketch the main arguments for its correctness and complexity. The key observation for correctness is that each recursive call processes an SCC-closed subgraph of G. Indeed, given an SCC-closed colored vertex set X, for any vertex (v, c) ∈ X, we have SCC(v, c) = Fwd({(v, c)}, X) ∩ Bwd({(v, c)}, X). Hence S = SCC(V) in Line 10. As F ∪ S is closed under Post operations and S is an SCC of X, we have F \ S (and thus also X \ F ) is SCC closed.
The complexity of ColoredChain is O( S∈SCCs(G) (δ(S) + 1)) = O(pn), as every vertex v belongs to exactly one SCC(v, c) for each color c ∈ C. This bound follows from amortizing the number of iterations of the loop in Line 4 to the diameter of a color that converges last in the loop. Observe that the computation on the remaining colors comes "for free". This is the benefit of treating all colors symbolically (as opposed to each monochromatic graph G c separately). The same observation holds for the while loop in Line 8.

Experiments
In this section we report our experimental evaluation of the new algorithms Chain and ColoredChain on three classes of benchmarks. We compared their performance to the standard algorithms FwdBwd [30], LockStep [7] (and its recent colored variant [6]) and Skeleton [17]. Our experiments were run on a Linux machine with 2.4GHz CPU speed and 60GB of memory (using 1 core).

Experiments on Synthetic Benchmarks
To better illustrate the behavior of the various algorithms, we start with a controlled setting of synthetic benchmarks.
Setup. We performed a controlled experiment on product graphs G i k = L k−i ×C i , where L j (resp, C j ) denotes a line graph (resp., cycle graph) of size 2 j . This setup follows [4]. Observe that G i k has 2 k−i SCCs, of size (and diameter) 2 i each. Our implementation is in C++ and based on the Sylvan BDD library [14]. Recall that the behavior of each algorithm depends on the non-determinism involved in the Pick operation, that returns an arbitrary vertex of a given vertex set. Sylvan returns the vertex with the smallest (binary encoded) ID. We generated two variants of this setting: one in which vertex IDs follow an incremental order in each graph component, and one in which they are uniformly random.
Results. Fig. 2 shows the number of symbolic steps per algorithm, for graphs G i 10 , i ∈ {0} ∪ [10]. When the vertex encoding follows sequential IDs (left), FwdBwd exhibits its worst-case Θ(n 2 ) performance on graphs with many SCCs (i.e., small i) as it repeatedly Pick's pivots with large forward sets. As i increases, the number of SCCs decreases, and FwdBwd eventually terminates in the first call (for i = 10). On the other hand, the other algorithms exhibit almost identical, O(n) performance. In particular, every recursive call of LockStep Pick's a vertex v whose backward set equals SCC(v); thus the algorithm convergences in a number of steps that is proportional to δ(SCC(v)), leading to Θ(n) performance. Finally, after the first call, Skeleton and Chain output SCCs in the When the vertex encoding follows random IDs (right), every recursive call of FwdBwd and LockStep Pick's a pivot whose first component is roughly in the middle of the line segment that is processed in that call. Hence the two algorithms have similar performance, which follows Θ(n log n) behavior for large lines (i.e., when i is small). On the other hand, Skeleton and Chain spend O( S∈SCCs(G) (δ(S) + 1)) symbolic steps. Naturally, for larger lines, the two algorithms spend more steps for computing the forward sets of their pivots, a cost that is amortized in later recursive calls by a constant factor. Observe, however, that Skeleton pays a larger constant factor, as the construction of skeletons requires the forward sets to also be traversed backwards. This results in Skeleton having the worst performance relative to the other algorithms when the number of SCCs decreases (i.e., as i gets larger), as there are fewer recursive calls to amortize the high cost of skeleton computation. Finally, we remark that for small and large i, Skeleton constructs (in expectation) Θ(n) BDDs, hence this is a family of graphs exposing the non-symbolic nature of the algorithm.

Experiments on Uncolored Graphs
To better understand the performance of the various algorithms in the wild, we continue with their evaluation on standard model-checking benchmarks.
Setup. We considered benchmarks from the following categories: -1-safe Petri Net models from MCC, the Model Checking Contest [22].
-DiVinE models from BEEM, the Benchmark of Explicit Models [25].
In order to create equal experimental circumstances for all models, we used the language-independent model checker LTSmin [19] to generate the disjunctively partitioned symbolic transition relations for all these models. As symbolic representation, we chose the multi-core BDD package Sylvan [14]. We implemented all four algorithms of the previous section inside LTSmin. We disregarded graphs of size < 10 4 , as such graphs are handled more efficiently by explicit algorithms. This led to a pool of 101 benchmarks. We measured the average time (across three runs) each algorithm took on each benchmark, while discarding the overhead due to state-space generation.
Results. Fig. 3 shows the running times of Chain against Skeleton, LockStep and FwdBwd. Compared to the only other theoretically optimal algorithm Skeleton, Chain is almost always somewhat faster, with the exception of one benchmark on which Chain is an order of magnitude faster. When compared to LockStep, we find the two algorithms to be incomparable, with Chain being slower on some benchmarks but faster on others. Indeed, we expect that LockStep behaves adequately in most practical scenarios, while its log n slowdown (as demonstrated in Section 5.1) is witnessed only rarely. Finally, we find that Chain is measurably and consistently equally-or-better performing than FwdBwd.

Experiments on Colored Graphs
Finally, we turn our attention to colored graphs. We used models of discrete control systems representing Biological Genetic Networks [20]. In high level, a Boolean Network (BN) is defined by a set of Boolean variables X = {x 1 , . . . , x k } and update functions of the form x i := ϕ i , where each ϕ i is a Boolean combination over variables X. State updates are performed by nondeterministic applications of the functions ϕ i . In Colored Boolean Networks (CBNs), uninterpreted function symbols are used to represent uncertainty. For instance, x 1 := x 2 ∧ f (x 3 , x 4 ) represents that x 1 has a positive dependence on x 2 and an unknown dependence on x 3 and x 4 . A single color corresponds to an assignment of Boolean functions to the uninterpreted function symbols. The set of colors is further restricted by constraints representing biological knowledge. This setting is inspired by its use to evaluate the recently introduced colored LockStep [6].
Setup. We implemented our new ColoredChain-algorithm in Scala, using JavaBDD (wrapping the classical BDD package BuDDy) with recommended settings. We also reimplemented colored LockStep from [6] (without preprocessing) and FwdBwd in Scala/JavaBDD. We used the CBNs coming from the GINsim Boolean network database [10], represented in the AEON format that supported the experiments in [6], accessed at [1]. We focused on benchmarks with np ≥ 10 4 , as the rest were run in < 0.2s by all algorithms. We remark that most of these CBNs generate huge graphs; for the purposes of our evaluation, we timed our experiments within 1h, which yielded a pool of 9 benchmarks.
Results. Fig. 4 shows the running time of each of the three algorithms. Perhaps surprisingly, LockStep is consistently the slowest and by a large margin. On the other hand, ColoredChain was always considerably faster than LockStep, and consistently the fastest algorithm overall. The two exceptions are on the CBNs 5_param_g2a and 27_068, where FwdBwd finished first in 2s and 1032s (as opposed to 4s and 1114s for ColoredChain). On the other hand, FwdBwd was considerably slower than ColoredChain in some CBNs (e.g., 20_049). Although a wider experimental setting is required for conclusive results, our evaluation indicates that ColoredChain is very effective in handling CBNs.

Conclusion
We have introduced Chain, a new, truly symbolic, and time-optimal algorithm for SCC decomposition. The simplicity of Chain makes it theoretically elegant, while our experimental evaluation demonstrates a potential for practical impact. Some opportunities for future research include introducing saturation techniques [31] to Chain, as well as specializing it to the computation of bottom SCCs, which have received special attention [5].
Acknowledgements. This work was supported in part by Villum Fonden (Project VIL42117).
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.