원시데이터 수집 시스템
선정목록으로

A near-optimal approach to edge connectivity-based hierarchical graph decomposition

관련 수소연료전지 · (7) MEA(막전극접합체)

기본 정보

저자
  1. Lijun Chang — School of Computer Science, The University of Sydney, Sydney, NSW, Australia|||School of Computer Science, The University of Sydney, Sydney, Australia
  2. Zhiyi Wang — School of Computer Science, The University of Sydney, Sydney, NSW, Australia|||School of Computer Science, The University of Sydney, Sydney, Australia
DOI
10.1007/s00778-023-00797-x
저널
The VLDB Journal
발행년도
2023
발행기관
Springer Science+Business Media
피인용수
1
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
http://dx.doi.org/10.1007/s00778-023-00797-x
토픽
Graphene research and applications
OpenAlex ID
W4381542548

평가 내용

관련도
관련
사업분야
수소연료전지 · (7) MEA(막전극접합체)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '수소연료전지 > MEA(막전극접합체)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Abstract The problem of efficiently computing all $$k$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>k</mml:mi> </mml:math> -edge-connected components ( $$k$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>k</mml:mi> </mml:math> -ECCs) of a graph G for a user-given k has been extensively studied recently in view of its importance in many applications. The $$k$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>k</mml:mi> </mml:math> -ECCs of G for all possible values of k form a hierarchical structure; that is, any two different $$k$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>k</mml:mi> </mml:math> -ECCs for the same k value are disjoint and any $$k$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>k</mml:mi> </mml:math> -ECC is contained in a unique $$(k\text {-}1)$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mo>(</mml:mo> <mml:mi>k</mml:mi> <mml:mtext>-</mml:mtext> <mml:mn>1</mml:mn> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> -ECC. In this paper, we study the problem of efficiently constructing the hierarchy tree of the $$k$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>k</mml:mi> </mml:math> -ECCs for all possible k values, for a graph G . The existing approaches $$\textsf{TD}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>TD</mml:mi> </mml:math> and $$\textsf{BU}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>BU</mml:mi> </mml:math> construct the hierarchy tree in either a top-down manner or a bottom-up manner, with both having the time complexity of $${{\mathcal {O}}}\big (\delta (G)\times {\mathsf {T_{KECC}}} (G)\big )$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>O</mml:mi> <mml:mrow> <mml:mo>(</mml:mo> </mml:mrow> <mml:mi>δ</mml:mi> <mml:mrow> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> <mml:mo>×</mml:mo> <mml:msub> <mml:mi>T</mml:mi> <mml:mi>KECC</mml:mi> </mml:msub> <mml:mrow> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> <mml:mrow> <mml:mo>)</mml:mo> </mml:mrow> </mml:mrow> </mml:math> , where $$\delta (G)$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>δ</mml:mi> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> is the degeneracy of G and $${\mathsf {T_{KECC}}} (G)$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:msub> <mml:mi>T</mml:mi> <mml:mi>KECC</mml:mi> </mml:msub> <mml:mrow> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> </mml:mrow> </mml:math> is the time complexity of computing all $$k$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>k</mml:mi> </mml:math> -ECCs of G for a specific k value. Here, the degeneracy of G is defined as the maximum value among the minimum vertex degrees of all subgraphs of G and is at most $$\sqrt{m}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:msqrt> <mml:mi>m</mml:mi> </mml:msqrt> </mml:math> where m is the number of edges in G . To improve the time complexity, we propose a divide-and-conquer approach $$\textsf{DC}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>DC</mml:mi> </mml:math> running in $${{\mathcal {O}}}\big ( (\log \delta (G))\times {\mathsf {T_{KECC}}} (G)\big )$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>O</mml:mi> <mml:mrow> <mml:mo>(</mml:mo> </mml:mrow> <mml:mrow> <mml:mo>(</mml:mo> <mml:mo>log</mml:mo> <mml:mi>δ</mml:mi> <mml:mrow> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> <mml:mo>)</mml:mo> </mml:mrow> <mml:mo>×</mml:mo> <mml:msub> <mml:mi>T</mml:mi> <mml:mi>KECC</mml:mi> </mml:msub> <mml:mrow> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> <mml:mrow> <mml:mo>)</mml:mo> </mml:mrow> </mml:mrow> </mml:math> time; this time complexity is optimal up to a logarithmic factor. However, a straightforward implementation of $$\textsf{DC}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mi>DC</mml:mi> </mml:math> would take $${{\mathcal {O}}}( (m + n) \log \delta (G))$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>O</mml:mi> <mml:mo>(</mml:mo> <mml:mo>(</mml:mo> <mml:mi>m</mml:mi> <mml:mo>+</mml:mo> <mml:mi>n</mml:mi> <mml:mo>)</mml:mo> <mml:mo>log</mml:mo> <mml:mi>δ</mml:mi> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> main-memory space, which could easily run out-of-memory when processing large graphs; here, n is the number of vertices in G . To reduce the main-memory footprint of our algorithm, we propose adjacency array-based techniques to optimize the space complexity to $$2m+{{\mathcal {O}}}(n\log \delta (G))$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML">

본문 87,176자

본문 펼치기
The problem of efficiently computing all k-edge-connected components (k-ECCs) of a graph G for a user-given k has been extensively studied recently in view of its importance in many applications.The k-ECCs of G for all possible values of k form a hierarchical structure; that is, any two different k-ECCs for the same k value are disjoint and any k-ECC is contained in a unique (k-1)-ECC.In this paper, we study the problem of efficiently constructing the hierarchy tree of the k-ECCs for all possible k values, for a graph G.The existing approaches TD and BU construct the hierarchy tree in either a top-down manner or a bottom-up manner, with both having the time complexity of O δ(G) × T KECC (G) , where δ(G) is the degeneracy of G and T KECC (G) is the time complexity of computing all k-ECCs of G for a specific k value.Here, the degeneracy of G is defined as the maximum value among the minimum vertex degrees of all subgraphs of G and is at most √ m where m is the number of edges in G.To improve the time complexity, we propose a divide-and-conquer approach DC running in O (log δ(G)) × T KECC (G) time; this time complexity is optimal up to a logarithmic factor.However, a straightforward implementation of DC would take O((m + n) log δ(G)) main-memory space, which could easily run out-of-memory when processing large graphs; here, n is the number of vertices in G.To reduce the main-memory footprint of our algorithm, we propose adjacency array-based techniques to optimize the space complexity to 2m + O(n log δ(G)) and denote our resulting algorithm by DC-AA.As a by-product of DC-AA, we also improve the space complexity of the state-of-the-art algorithm for computing all k-ECCs for a specific k to 2m + O(n), by using the same technique as used in DC-AA.Finally, we propose optimization techniques to improve the practical efficiency of the existing approach BU and denote the space-optimized version of it as BU * -AA which runs in O δ(G) × T KECC (G) time and 2m + O(n) space.Extensive experiments on large real graphs and synthetic graphs demonstrate that our algorithms DC-AA and BU * -AA outperform the state-of-the-art approaches by up to 28 times in terms of running time and by up to 8 times in terms of main memory usage.In particular, our approach BU * -AA processes the Twitter graph, which has more than 1 billion undirected edges, in 29 min with 13.5 GB memory, while the state-of-the-art approaches take more than 13 h after our space optimization; note that the state-of-the-art approaches run out-of-memory if without our space optimization.Our empirical study also shows that BU * -AA, despite having a higher time complexity, performs better than DC-AA in practice.We also remark that BU * -AA is much simpler and easier to implement than DC-AA.KeywordsEdge connectivity • Hierarchical graph decomposition • Near optimal • Divide-and-conquer B Lijun Chang Introduction The relationships among entities in real-world applications can be naturally modeled by the graph model.As a result, real graph data are abundant.With the proliferation of graph data, one of the fundamental graph problems is to compute the set of all maximal k-edge-connected subgraphs, called k-edge-connected components and abbreviated as k-ECCs, for a user-given k [3,11,40,43].A graph is k-edge connected, if it remains connected after removing any set of Fig. 1 A toy graph and its ECo-decomposition k − 1 edges.For the graph in Fig. 1a, the subgraphs induced by vertices {v 1 , . . ., v 5 } and {v 6 , . . ., v 9 } are two 3-ECCs, with the former also being a 4-ECC.Computing k-ECCs has many applications, such as identifying closely related entities for social behavior mining [2], discovering cohesive blocks (communities) in social networks (e.g., Facebook) [39], matrix completability analysis [14], and measuring robustness of communication networks [11]. Introduction Specifying the appropriate k value for an application is, however, non-trivial and usually needs several iterations of the trial-and-error process.In addition, different applications may need different k values.Hence, it is critical to precompute a data structure, such that all k-ECCs for any given k can be efficiently retrieved from the data structure which then as a result can facilitate downstream tasks.It is known that the k-ECCs for all possible k values form a hierarchical structure [42], as the different k-ECCs for the same k value are disjoint and each k-ECC is entirely contained in a unique (k − 1)-ECC [7].As an example, the hierarchy tree T for the k-ECCs of the graph G in Fig. 1a is shown in Fig. 1b.Here, the leaf nodes are vertices of G and non-leaf nodes correspond to k-ECCs of G; to distinguish vertices of T from that of G, we refer to vertices of T as nodes.From the constructed tree T , the set of k-ECCs for any k can be easily extracted in time linear to the size of the k-ECCs.Thus, the problem becomes efficiently constructing the hierarchy tree for k-ECCs of all possible k values.We called this problem Edge Connectivity-based hierarchical graph decomposition and abbreviate it as ECo-decomposition. Introduction Besides all the applications above, computing ECodecomposition (i.e., the hierarchy tree) also has its own applications.Some example applications are as follows. Introduction • Hierarchical Organization and Visualization of Graphs. Introduction ECo-decomposition constructs a hierarchical organization of a graph.This hierarchical organization can facilitate graph topology analysis [6] and assist users to visualize a graph in a multi-granularity manner [29], for example, zoom in and out based on the edge connectivities of subgraphs.• Graph Sparsification.ECo-decomposition efficiently computes the Steiner connectivity for all edges (see Sect. 4.1).It is shown in [5,20] that independently sam-pling edges according to their Steiner connectivities preserves the values of all cuts with a small multiplicative error.Note that this reduces the number of edges and thus sparsifies the graph.• Steiner Component Search.ECo-decomposition is also an inherent preprocessing step for the problem of online Steiner component search [7,25], which aims to compute the subgraph that contains a set of user-given query vertices and has the maximum edge connectivity [7]. Introduction The state-of-the-art approaches TD and BU compute the ECo-decomposition (i.e., construct the hierarchy tree T ) either in a top-down fashion [7] or in a bottom-up fashion [42].TD computes k-ECCs of G for all possible k values in increasing order and thus constructs the hierarchy tree in a top-down fashion [7].BU computes k-ECCs of G for all possible k values in decreasing order and thus constructs the hierarchy tree in a bottom-up fashion [42].Computation sharing techniques are exploited in TD and BU based on the observation that the working graph in an iteration for computing k-ECCs could be smaller than the input graph G, e.g., the working graph in TD for computing k-ECCs is not G but the set of (k − 1)-ECCs of G which are the results of the previous iteration [7].The worst-case time complexities of TD and BU are both O δ(G) × T KECC (G) , where T KECC (G) is the time complexity of computing all k-ECCs of G for a specific k and δ(G) is the degeneracy of G.The degeneracy of G is defined as the maximum value among the minimum vertex degrees of all subgraphs of G [28].Note that the time complexity of O δ(G) × T KECC (G) is the same as the straightforward approach that independently computes k-ECCs of G for all possible k values, as the largest k will be no larger than δ(G). Introduction Our Near-Optimal Approach.To improve the time complexity, we separate the computation into two parts, by first computing the Steiner connectivity for all edges of G and then constructing the hierarchy tree T based on the computed Steiner connectivities.Here, the Steiner connectivity of an edge (u, v), denoted sc(u, v), is the largest k such that a k-ECC of G contains the edge.We in this paper show that the hierarchy tree of the ECo-decomposition can be constructed in O(m) time given the Steiner connectivities of all edges of G, where m is the number of edges of G. Consequently, the main problem of ECo-decomposition is to efficiently compute the Steiner connectivity for all edges of G. Introduction We propose a divide-and-conquer approach DC to compute the Steiner connectivities of all edges.The general idea is that given the set E H L of edges of G whose Steiner connectivities are in the range [L, H ], i.e., E H L = {(u, v) ∈ E(G) | L ≤ sc(u, v) ≤ H }, we compute the exact Steiner connectivity for all edges of E H L as follows.If L = H , then sc(u, v) = L for every edge (u, v) ∈ E H L and the problem is solved.Otherwise, let M = L+H 2 , we divide the problem into two subproblems, E and E , to be solved recursively; here, Introduction The critical step is efficiently dividing a search problem E H L into two subproblems: E and E .We show that E is exactly the set of edges of E H L that are not in M-ECCs of the subgraph of G induced by E H L and all edges of G whose Steiner connectivities are larger than H , and E is equal to E H L \E .In addition, we propose computation sharing techniques and prove that DC runs in O (log δ(G)) × T KECC (G) time. Introduction The time complexity of DC is optimal up to a logarithmic factor, since the time complexity of any ECo-decomposition algorithm is clearly lower bounded by T KECC (G).However, a naive implementation of DC would take O (n +m) log δ(G) main-memory space which makes it infeasible to process large graphs.We show that the space complexity can be improved to O(m + n log δ(G)).However, this is still too high to be applied to billion-scale graphs as it will run out-ofmemory.Note that the constant hidden by the big-O notation is large.In view of this, we further propose techniques, based on adjacency array, to reduce the space complexity to 2m + O(n log δ(G)) by explicitly bounding the constant on m by 2, while not increasing the time complexity.We denote our space-optimized approach as DC-AA, where AA stands for adjacency array. Introduction In addition, we also propose a practically efficient algorithm BU * -AA, which follows the general paradigm of BU.That is, BU * -AA also computes k-ECCs of G for all possible values of k in decreasing order.However, instead of processing all vertices when computing the k-ECCs for each k, we show that we only need to process a subset of the vertices; we propose techniques to efficiently extract this subset of vertices as well as the subgraph induced by them.Although the time complexity of BU * -AA remains the same as that of BU, i.e., O(δ(G) × T KECC (G)), BU * -AA runs much faster than BU and performs even better than DC-AA in practice.Note that BU * -AA is much simpler and easier to implement than DC-AA.Furthermore, BU * -AA has a space complexity of 2m + O(n). Introduction We conduct extensive empirical studies on large graphs to evaluate our algorithms.The results show that our approach DC-AA outperforms the state-of-the-art approaches TD and BU by up to 28 times in terms of running time and by up to 8 times in terms of memory usage.Take the Twitter graph that has 1.2 billion undirected edges as an example, DC-AA finishes in 78 min by consuming 15 GB memory, while TD and BU (as well as DC) run out-of-memory on a machine with 128 GB memory; on the other hand, our space-optimized versions of TD and BU finish in 13.9 and 36.8 h, respectively.Furthermore, our practical approach BU * -AA runs faster and consumes less memory than DC-AA, e.g., BU * -AA finishes in 29 min with 13.5 GB memory for the Twitter graph. Contributions. Our main contributions are summarized as follows: Contributions. 1. We propose a near-optimal approach to ECodecomposition, which improves the time complexity from O(δ(G) × T KECC (G)) of existing approaches to O((log δ(G)) × T KECC (G)) of our approaches.2. We propose techniques to implement our algorithm such that it takes 2m + O(n log δ(G)) main-memory space and thus can process billion-scale graphs in the main memory of a commodity machine.3. We also propose a simpler and practically efficient algorithm that has space complexity of 2m + O(n). 4. As a by-product of our space optimization techniques, we significantly reduce the memory usage of the state-ofthe-art k-ECC computation algorithm proposed in [11].Moreover, we anticipate that our space optimization techniques can also be generally applied to other graph algorithms. 5. We conduct extensive empirical studies on large real and synthetic graphs to evaluate the efficiency of our approaches. Contributions. A preliminary version of this work has been published in [10].Compared with [10], we have proposed a new algorithm BU * -AA, added proofs for all lemmas and theorems, and conducted new experimental studies on SSCA synthetic graphs as well as the new algorithm BU * -AA in this paper. Contributions. Organization.The rest of the paper is organized as follows.Section 2 gives preliminaries of the studied problem, and Sect. 3 presents the existing algorithms.We propose a near-optimal approach in Sect. 4 and develop techniques to reduce the memory usage of our algorithms in Sect. 5. We further propose a simpler and practically efficient algorithm in Sect.6. Section 7 reports the results of our experimental studies, and Sect.8 provides an overview of related works.Finally, Sect.9 concludes the paper. Preliminaries In this paper, we consider a large unweighted and undirected graph G = (V , E), with vertex set V and edge set E. The number of vertices and the number of undirected edges in G are denoted by n = |V | and m = |E|, respectively.Given a vertex subset Preliminaries For an arbitrary graph g, we use V (g) and E(g) to, respectively, denote its set of vertices and its set of edges. Fig. 2 An example graph A graph is k-edge connected if the remaining graph is still connected after the removal of any k − 1 edges from it.Note that, by definition, a graph with less than k edges (e.g., consisting of a singleton vertex) is not considered to be k-edge connected.Then, k-edge-connected component is defined as follows. Fig. 2 An example graph (ii) g is maximal (i.e., any super-graph of g is not k-edge connected). Fig. 2 An example graph Consider the graph in Fig. 2, the entire graph is a 2-ECC but not a 3-ECC (since the graph will be disconnected after removing edges (v 5 , v 12 ) and (v 9 , v 11 )).The subgraph g 1 is a 4-ECC, and g 3 is a 3-ECC.Note that g 2 , although is 3-edge connected, is not a 3-ECC since its super-graph g 1 ⊕ g 2 is also 3-edge connected (i.e., g 2 is not maximal).Here, g 1 ⊕ g 2 denotes the union of g 1 and g 2 , which also includes the cross edges between vertices of g 1 and vertices of g 2 . Fig. 2 An example graph Hierarchy Tree of k-ECCs.It is shown in [7] that the k-ECCs of a graph satisfy the following properties. Fig. 2 An example graph 1.Each k-ECC is a vertex-induced subgraph.2. Any two distinct k-ECCs for the same k value are disjoint. Each k-ECC for Thus, the k-ECCs of a graph G for all possible k values can be compactly represented by a hierarchy tree T , where leaf nodes of T correspond to vertices of G and non-leaf nodes of T correspond to distinct k-ECCs of G.Note that, to distinguish vertices of T from that of G, we refer to vertices of T as nodes.Figure 3 illustrates the hierarchy tree for k-ECCs of the graph in Fig. 2. We call non-leaf nodes of T as ECC nodes, and each ECC node is associated with a weight.An ECC node of weight k corresponds to a k-ECC which is the subgraph of G induced by all leaf nodes in the subtree of T rooted at the ECC node.For example, the left 3-ECC node in Fig. 3 corresponds to the 3-ECC g 1 ⊕ g 2 in Fig. 2, which is the subgraph induced Fig. 3 Hierarchy tree T by vertices v 1 , . . ., v 9 .Note that if a subgraph g is both a k-ECC and a (k + 1)-ECC, it is only represented once in the hierarchy tree by an ECC node of weight k + 1.For example, the entire graph G is both a 2-ECC and a 1-ECC and is represented by the ECC node of weight 2. Thus, each nonleaf node will have at least two children, and the size of the hierarchy tree T is linear to n. Each k-ECC for It is worth pointing out that for any given k, the set of all k-ECCs of G can be efficiently obtained from the hierarchy tree T in time linear to the size of the k-ECCs. Each k-ECC for Problem Statement.Given a large graph G, we study the problem of efficiently constructing the hierarchy tree for the set of all k-ECCs of G.We term this problem as Edge Connectivity-based hierarchical graph decomposition and abbreviate it as ECo-decomposition. Each k-ECC for In this paper, we will consider the algorithm for computing all k-ECCs of g for a given k as a black-box, denoted KECC(g, k).While any of the algorithms in [3,11,43] can be used to implement KECC(g, k), we implement the state-ofthe-art algorithm in [11] in our experiments.We use T KECC (G) to denote the time complexity of KECC(G, k) when G is taken as the input graph 1 and assume that T KECC (G) is at least linear to the number of edges of G. Existing solutions In this section, we briefly review the two state-of-the-art approaches, and discuss their time complexities.The existing approaches compute the ECo-decomposition (i.e., the hierarchy tree) either in a top-down manner [7] or in a bottom-up manner [42]. Existing solutions A Top-Down Approach: TD.The top-down approach constructs the hierarchy tree in a top-down manner, which is achieved by explicitly computing k-ECCs of G for all k values in increasing order [7].The pseudocode is shown in Algorithm 1, denoted by TD.Initially, the root ECC node r of weight 1, which corresponds to the entire input graph G, is created for T (Line 1); note that, without loss of generality here G is assumed to be connected.Then, it recursively adds the set of children to each ECC node in a top-down fashion by invoking Construct-TD (Line 2). Existing solutions Given an ECC node ecc of weight k whose corresponding graph is g (i.e., g is a k-ECC of G), Construct-TD constructs the set of children of ecc.To do so, it first computes the set of (k + 1)-ECCs of g (Line 4), denoted φ k+1 (g).If φ k+1 (g) is the same as g which means that g itself is (k + 1)edge connected (Line 5), then the weight of ecc is increased to k + 1 (Line 6) and the recursion continues for g (Line 7).Otherwise, the set of children of ecc is added as follows: (i) a leaf node is added for each vertex of g that is not in φ k+1 (g) (Lines 9-10) and (ii) an ECC node is added for each connected subgraph g of φ k+1 (g) (Lines 11-12).The recursion continues for each newly added ECC node (Line 13). Existing solutions Example 1 Consider the graph in Fig. 2. φ 2 (G) = {G}; thus, the weight of the root node r of T is 2. φ 3 (G) = {g 1 ⊕g 2 , g 3 }; thus, r has two children corresponding to g 1 ⊕ g 2 and g 3 , respectively.φ 4 (g 3 ) = ∅; thus, all vertices of g 3 are added to be the children of the ECC node corresponding to g 3 .The final hierarchy tree T is the same as shown in Fig. 3. Existing solutions A Bottom-Up Approach: BU.The bottom-up approach constructs the hierarchy tree in a bottom-up fashion, which is achieved by computing k-ECCs of G for all k values in decreasing order [42].The pseudocode is shown in Algorithm 2, denoted BU.Initially, one leaf node is created in T for each vertex of G (Line 1), and an upper bound k max (G) of the largest k such that G has a non-empty k-ECC is computed (Line 2).Then, the set of k-ECCs φ k (G) of G are computed, for k varying from k max (G) to 1 (Lines 3-4).Fig. 4 The graph in Fig. 2 after contracting g 1 into super-vertex s 1 Existing solutions For each connected subgraph g in φ k (G) (Line 5), an ECC node ecc is created in T (Line 6), its children are the nodes of T that correspond to vertices of G (Line 7), and g is then contracted into a super-vertex in G (Line 8); thus, ecc corresponds to the resulting super-vertex in G obtained by contracting g.Note that, when computing k-ECCs of G, each (k + 1)-ECC of G has already been contracted into a supervertex.As a result, if a subgraph is both a k-ECC and a (k − 1)-ECC, it will only be computed, once, as a k-ECC.The correctness of BU follows from the fact that for a k-edgeconnected subgraph g that is not (k + 1)-edge connected, if we contract each (k + 1)-ECC of g into a super-vertex, then the resulting graph is still k-edge connected. Existing solutions Example 2 Consider the graph in Fig. 2 and assume the upper bound is computed as k max (G) = 4.In the first iteration, we obtain φ 4 (G) = {g 1 }; thus, an ECC node of weight 4 is created in T with five children v 1 , v 2 , v 3 , v 4 , v 5 .We contract g 1 into a single super-vertex, denoted s 1 ; the resulting graph is shown in Fig. 4 with two parallel edges between s 1 and v 7 .In the second iteration, we obtain φ 3 (G) = {s 1 ⊕ g 2 , g 3 }; thus, two ECC nodes of weight 3 are created in T , corresponding to these two subgraphs, respectively.Then, s 1 ⊕g 2 is contracted into a super-vertex, denoted s 1,2 , and g 3 is contracted into a super-vertex, denoted s 3 .In the third iteration, we obtain φ 2 (G) = {s 1,2 ⊕ s 3 }; thus, the root node of T is obtained.The final result is shown in Fig. 3. Time Complexities of TD and BU.We first prove the following lemma. Existing solutions Lemma 1 Let k max (G) be the largest k such that G contains a non-empty k-ECC and δ(G) be the degeneracy of G which is equal to the maximum value among the minimum vertex degrees of all subgraphs of G [28].Then, we have k max (G) ≤ δ(G). Existing solutions Proof We prove the lemma by contradiction.Suppose k max (G) > δ(G), and let g be a (k max (G))-ECC of G.Then, the minimum vertex degree of g is at least k max (G), which is larger than δ(G).This contradicts the fact that δ(G) equals the maximum value among the minimum vertex degree of all subgraphs of G. Thus, the lemma holds. Existing solutions We actually observe that k max (G) = δ(G) for all real and synthetic graphs tested in our experiments.Thus, the largest k that is input to Construct-TD of Algorithm 1 is δ(G).As we assumed that T KECC (G) is at least linear to the number of edges of G, the time complexity of TD is O δ(G)×T KECC (G) . 2 2 Note that the time complexity analysis of TD is tight; for example, consider an input graph G that itself is δ(G)-edge connected. Existing solutions Following Lemma 1, the upper bound k max (G) can be set as δ(G) at Line 2 of Algorithm 2. Thus, the time complexity of BU is O δ(G)×T KECC (G) , 3 as the degeneracy of G can be computed in O(m) time [28].Note that the time complexity analysis of BU is also tight; for example, consider a graph that has no k-ECCs other than a δ(G)-ECC and G itself which is 2-edge connected. Existing solutions The degeneracy δ(G), although can be bounded by O( √ m) in the worst case [36], may still be large, especially for large graphs.For example, δ(G) is more than 2000 for the largest graphs tested in our experiments (see Table 1 in Sect.7).As a result, BU and TD are taking excessively long time for processing large graphs due to their high time complexity of O δ(G) × T KECC (G) , not to mention their high space complexity (see Sect. 5). Existing solutions Handling Dynamic Graphs.Techniques for handling dynamic graphs have also been proposed in [7].The general idea is based on the fact that deleting an edge from a graph or inserting a new edge into a graph will change the edge connectivity of the graph by at most 1, and moreover, most of the k-ECCs will remain unchanged.These techniques can be directly adopted to maintain the hierarchy tree for dynamic graphs.We omit the details, as we focus on speeding up the construction of the hierarchy tree in this paper. A near-optimal approach In this section, we propose an approach for ECodecomposition that runs in O (log δ(G)) × T KECC (G) time. A near-optimal approach To achieve this, we will need to avoid the explicit computation and enumeration of k-ECCs for all possible k values, since the k-ECCs for all possible k values could be of total size δ(G)×T KECC (G) in the worst case if T KECC (G) is roughly linear to m.Consequently, simply reporting k-ECCs for all possible k values would already take O δ(G) × T KECC (G) time.Instead, we use a two-step paradigm, which first computes the Steiner connectivity for all edges of G and then constructs the hierarchy tree based on the Steiner connectivities, as follows. A near-optimal approach We will show that given the Steiner connectivities of all edges, the hierarchy tree can be constructed in linear time, and thus, computing the Steiner connectivities of all edges dominates the time complexity.As there are only m edges and thus only m Steiner connectivities to compute, it is possible to compute them in time less than δ(G) × T KECC (G). A near-optimal approach In the following, we first in Sect.4.1 propose an algorithm to compute the Steiner connectivities of all edges in O (log δ(G)) × T KECC (G) time and then in Sect.4.2 present an algorithm to construct the hierarchy tree in O(m) time based on the computed Steiner connectivities. Computing Steiner connectivities The Steiner connectivity is defined as follows.[7]) Given a graph G, the Steiner connectivity of an edge (u, v), denoted sc(u, v), is the largest k such that a k-ECC of G contains both u and v. Definition 2 (Steiner Connectivity For example, in Fig. 5, the Steiner connectivity of each edge is computed as shown on the edge, e.g., sc(v 1 , v 4 ) = 4.In this subsection, we propose a divide-andconquer approach for computing the Steiner connectivities of all edges in a graph.Note that, although the concept of Steiner connectivity is borrowed from [7], all our techniques in the following are new.1) removing all vertices and edges that are not in k 1 -ECCs of G and (2) contracting each (k 2 + 1)-ECC of G into a super-vertex.Note that the resulting graph of GS k 2 k 1 (•) may have parallel edges.For example, GS 3 3 (G) for the graph G in Fig. 2 is shown in Fig. 6 which is obtained by (1) removing edges (v 5 , v 12 ) and (v 9 , v 11 ) and (2) contracting subgraph g 1 into a super-vertex s 1 .There are two parallel edges between s 1 and v 7 in Fig. 6. Definition 2 (Steiner Connectivity The graph shrink operator GS k 2 k 1 (•) has several properties which will be useful for computing Steiner connectivities.Firstly, applying the operator GS k 2 k 1 (•) preserves the Steiner connectivity for all edges in the resulting graph. Property 1 Given a graph G and two integers k It is easy to verify that the Steiner connectivity of (u, v) must be within the range Property 1 Given a graph G and two integers k , and let g be the k-ECC of G that contains (u, v).Then, by contracting each (k 2 + 1)-ECC of g into a super-vertex, the resulting graph is still k-edge connected and is a k-ECC of GS k 2 k 1 (G).Thus, the Steiner connectivity of (u, v) when computed in GS k 2 k 1 (G) is no smaller than that computed in G. Similarly, we can prove that the Steiner connectivity of (u, v) when computed in G is no smaller than that computed in GS k 2 k 1 (G).Therefore, the property holds. Property 1 Given a graph G and two integers k Secondly, the Steiner connectivity for all edges of GS k k (G) is k.For example, all edges in Fig. 6 have Steiner connectivity 3. Property 2 Given a graph G and an integer k, every edge of GS k k (G) has Steiner connectivity k. Proof This property directly follows from Property 1 and the definition of Steiner connectivity. Property 2 Given a graph G and an integer k, every edge of GS k k (G) has Steiner connectivity k. Thirdly, multiple operations of GS k 2 k 1 (•) can be chained together. Property 3 Given a graph G and four integers k Proof This property directly follows from properties 1 and 2 and the hierarchical structure of k-ECCs for different k values. Property 3 Given a graph G and four integers k Our Divide-and-Conquer Approach: DC.From Property 2, we know that the Steiner connectivities of all edges of GS k k (G) are k.Moreover, from the definitions of Steiner connectivity and the graph shrink operator, we know that all edges whose Steiner connectivities are k will be in Property 3 Given a graph G and four integers k propose a divide-and-conquer approach based on the fact that Property 3 Given a graph G and four integers k The pseudocode of our approach is shown in Algorithm 3, denoted DC.It first computes the degeneracy δ(G) of G (Line 1) and then invokes procedure Compute-DC with input (G, 1, δ(G)) to compute the Steiner connectivities of all edges (Line 2), while Line 3 constructs the hierarchy tree Property 3 Given a graph G and four integers k 10 Let g 1 be the graph obtained from g by contracting each connected subgraph of φ M (g) into a super-vertex, and g 2 be the union of subgraphs in φ M (g); Property 3 Given a graph G and four integers k and will be discussed in Sect.4.2.The input to Compute-DC consists of a graph g and an interval [L, H ]. If L = H , then the Steiner connectivities of all edges of g are set as L (Lines 5-6).Otherwise, an integer M is chosen such that Property 3 Given a graph G and four integers k ) and two graphs g 1 and g 2 are obtained from g based on φ M (g) (Line 10), and finally the algorithm continues on g 1 (Line 11) and on g 2 (Line 12).We prove by the following lemma that when initially invoking Compute-DC with graph G and interval [1, δ(G)], the graph g being processed for each recursion with interval Property 3 Given a graph G and four integers k , then the two graphs g 1 and g 2 obtained at Line 10 are exactly GS M−1 L (G) and GS H M (G), respectively.Proof According to the definition of the graph shrink operation Property 3 Given a graph G and four integers k where the last equality follows from Property 3. Similarly, we have Property 3 Given a graph G and four integers k Thus, the lemma holds. Property 3 Given a graph G and four integers k Based on Lemma 2, the recursion tree of invoking Compute-DC with input (G, 1, δ(G)) is shown in Fig. 7. Property 3 Given a graph G and four integers k The correctness and time complexity of Algorithm 3 are proven by the following two theorems. Theorem 1 Algorithm 3 correctly computes the Steiner connectivity for all edges of G. Proof The recursive invocation of Compute-DC stops when L = H (see Lines 5-6 of Algorithm 3).If L < H , (G) which is the same as G. Thus, the recursion tree of invoking Compute-DC with input (G, 1, δ(G)) is shown in Fig. 7. Property 2 states that the instance of GS with input g = GS k k (G), L = k and H = k correctly computes the Steiner connectivity for all edges whose Steiner connectivities are k.Thus, the theorem holds. Theorem 2 The time complexity of Algorithm 3 is O(h × T KECC (G)) , where h is the height of the recursion tree in Fig. 7. Theorem 2 The time complexity of Algorithm 3 is O(h × T KECC (G)) Proof We define the level of a node in the recursion tree as its distance to the root.Then, the subgraphs of G, corresponding to the nodes of the recursion tree that are at the same level, have disjoint sets of edges.Thus, the time complexity of the computation for each level of the recursion tree is O(T KECC (G)), by assuming that T KECC (G) is linear or superliner to the number of edges of G. Consequently, the total time complexity of Algorithm 3 is O(h × T KECC (G)) as the recursion tree has h levels. Theorem 2 The time complexity of Algorithm 3 is O(h × T KECC (G)) Near-Optimal Time Complexity.Algorithm 3 correctly computes the Steiner connectivities of all edges regardless of the choice of M at Line 8, as long as L < M ≤ H . Yet, the time complexity of Algorithm 3 would vary for different choices of M. For example, if M is always set as L + 1 or always set as H , then the height of the recursion tree would be δ(G) and thus the time complexity of Algorithm 3 would be O(δ(G) × T KECC (G)) on the basis of Theorem 2. To make the time complexity as low as possible, we will need to reduce the height of the recursion tree.Thus, we propose to set M as L+H Theorem 2 The time complexity of Algorithm 3 is O(h × T KECC (G)) , is optimal up to a logarithmic factor log δ(G).This is because the time complexity of ECo-decomposition cannot be lower than T KECC (G), as ECodecomposition also implicitly computes the k-ECCs of G; specifically, the k-ECCs of G can be obtained from the hierarchy tree in time linear to the sizes of the k-ECCs. Theorem 2 The time complexity of Algorithm 3 is O(h × T KECC (G)) Example 3 Here, we apply DC on the graph G in Fig. 2 as an example.Figure 8 Constructing the hierarchy tree Given the Steiner connectivities of all edges of a graph G, Algorithm 4 constructs the hierarchy tree of ECodecomposition of G in a bottom-up manner.The main idea is as follows.First, the hierarchy tree T is initialized as a forest of singleton nodes.Then, for each edge (u, v) ∈ E(G) in non-increasing order regarding sc(•, •), we identify the tree in T (specifically, the root r u of the tree) containing u and the tree (specifically, the root r v of the tree) containing v. If u and v are already in the same tree (i.e., r u = r v ), then we do nothing.Otherwise, we merge the two trees into one in T , with the root of this newly formed tree having weight sc(u, v). Constructing the hierarchy tree The pseudocode of constructing the hierarchy tree is illustrated in Algorithm 4, denoted by ConstructHierarchy.The input of the algorithm is a graph G with sc(u, v) precomputed for each edge (u, v).It first initializes an empty hierarchy tree (Line 1) and creates a single-node tree in T for each vertex of G (Line 2).Then, the trees in T will be merged with each other to form ECC nodes in the hierarchy tree.For each edge (u, v) ∈ E(G) sorted by sc(u, v) in non-increasing order (Line 3), the roots of the trees in T containing node u and node v are found, represented by r u and r v , respectively (Line 4).If r u = r v , it implies that vertices u and v have already been merged into the same tree so that the algorithm skips the current edge (Line 5); otherwise, the algorithm merges r u and r v into a single tree based on the following three cases. Constructing the hierarchy tree (1) If both r u and r v are ECC nodes with weight sc(u, v), it merges r u and r v into a single ECC node (Lines 6-7).( 2) If neither r u nor r v is an ECC node with weight sc(u, v), it creates a new ECC node in T with weight sc(u, v) whose children are r u and r v (Lines 8-9).( 3) The last situation is that one of r u or r v is an ECC node with weight sc(u, v) and the other is not; note that, if the other one is an ECC node, then its weight must be larger than sc(u, v).Assume that r u is the one with weight sc(u, v), r v would be added as a child of r u .Similar steps would be applied to the situation where r v is the one with weight sc(u, v) (Lines 10-11). Constructing the hierarchy tree The most time-consuming operation in Algorithm 4 is Line 4, which aims to find the root of the tree that contains a node u in a forest T .A naive implementation of this operation would take O(n) time by tracing the parent pointers starting from node u in the tree, and then the total time complexity of Algorithm 4 would be O(n × m).This can be improved to O(m) by resorting to the disjoint-set data structure.Recall that a disjoint-set data structure D partitions a universe of elements into a collection of sets, and each set is represented by one of its element (called representative) [17].There are two operations supported by the data structure D: Find the set that contains a specific element and merge two sets into one.In our case, the universe of the data structure D is the set of leaf nodes of the hierarchy tree T , and there is a one-to-one correspondence between sets in D and trees in T .Whenever we merge two trees in T , we also union the two corresponding sets in D.Moreover, we point each set (specifically, the representative element of the set) of D to the root of the tree in T to which the set corresponds.This pointer is used for efficiently identifying the root of the tree that contains a node (i.e., Line 4).As each of the two operations on D takes amortized constant time [17] 4 and sorting the edges at Line 3 can be achieved in linear time by counting sort [17], the time complexity of Algorithm 4 is O(m). 4 To be more precise, the amortized time complexity of each operation on D is the inverse of the Ackermann function of n [17].As this function grows very slowly and is bounded by 4 for all practical values of n, we consider it as a constant. Optimizing the space usage A straightforward implementation of Algorithm 3 would result in a space complexity of O((m + n) log δ(G)), i.e., each level of the recursion tree of Fig. 7 would require storing a separate copy of the input graph G.This space complexity is too high for large graphs.In this section, we focus on optimizing the space usage of DC.We first in Sect.5.1 discuss how to implement DC in O(m + n log δ(G)) space by using doubly linked list-based graph representation, where the constant hidden by the big-O notation is large.Then, in Sect.5.2 we further optimize the space usage of DC by using adjacency array-based graph representation and other non-trivial optimizations; this results in our space-efficient algorithm DC-AA that has space complexity 2 m + O(n log δ(G)).As a result, we can process billion-scale graphs with an ordinary PC.For example, experiments in Sect.7 show that our adjacency array-based algorithms can process twitter-2010 and comfriendster, which have 1.2 and 1.8 billion undirected edges, respectively, with at most 15 GB and 24 GB main memory.In contrast, the linked list-based algorithms run out-of-memory even with 128 GB memory. Doubly linked list-based implementation In this subsection, we discuss how to implement DC by using doubly linked list-based graph representation, which is also the representation used by the state-of-the-art KECC algorithm [11] and the two state-of-the-art ECodecomposition algorithms [7,42].The main reason for the existing approaches to choose this representation is that KECC iteratively modifies the graph-i.e., contract two (super-)vertices into one and remove (super-)vertices of degree less than k [11]-which can be easily implemented by using the linked list-based graph representation.We abstract these two graph modification operations as vertex contraction and vertex removal, respectively.Note that TD also uses the vertex removal operation (see Lines 11-13 of Algorithm 1) and BU uses the vertex contraction operation (see Line 8 of Algorithm 2). Doubly linked list-based implementation Recall that the linked list-based graph representation stores the adjacent edges of each vertex in a linked list [17].For example, Fig. 9 illustrates the linked lists for the adjacent edges of v i and v j .In addition, a cross pointer is constructed in the implementation for each edge (v i , v j ) which points to its reverse direction (v j , v i ), as each undirected edge will have two copies in the representation, one copy for each direction.Vertex removal can be implemented efficiently as follows.Suppose we are removing vertex v i from the graph; note that we also need to remove all edges ending at v i which scatter across the linked lists.To achieve this, we iterate through all the adjacent edges of v i , and for each edge (v i , v j ), we first locate its reverse edge (v j , v i ) via the cross pointer and then remove (v j , v i ) from the doubly linked list of v j which can be achieved in constant time.When it comes to vertex contraction, the process becomes slightly more complicated.Suppose we are contracting v i and v j .We use one of the vertices (e.g., v i ) to represent the resulting super-vertex, and the process is divided into two parts: the edges starting from v j should start from v i ; the edges end at v j ought to end at v i .For the first part, we could simply connect the head of the linked list of v j to the tail of the linked list of v i .For the second part, we iterate through all the adjacent edges of v j , and for each edge (v j , v k ), we first locate its reverse edge (v k , v j ) via the cross pointer and then update the edge to be (v k , v i ). Doubly linked list-based implementation Based on the linked list-based graph representation, DC (i.e., Algorithm 3) can be implemented fairly easily.Specifically, to construct g 1 = GS M−1 L (g) and g 2 = GS H M (g) = φ M (g) from g = GS H L (G) at Line 10 of Compute-DC, we first split each linked list (that corresponds to the adjacent edges of a vertex) into two, one to be used in g 1 and the other in g 2 , as g 1 and g 2 have disjoint sets of edges.We then apply the contraction operation for the edges in g 1 .In this way, we do not create any new edges in Compute-DC; note, however, that the number of vertices may double (i.e., one copy in g 1 and one in g 2 ).Overall, DC has a space complexity of O(m + n log δ(G)), by noting that it traverses the recursion tree of Fig. 7 in a depth-first manner. Adjacency array-based implementations Although the space complexity of DC has been reduced from O((m + n) log δ(G)) to O(m + n log δ(G)) in Sect.5.1, this is still too high to be applied to large graphs (see our experimental results in Sect.7) as the constant hidden by the big-O notation is large.Firstly, for each edge in the linked lists, three pointers and one number (where the number indicates the other end-point of the edge) need to be stored.Thus, the graph representation will consume at least 8m integers, by noting that each undirected edge is stored twice.Secondly, the graph may be stored three times (i.e., simultaneously have three copies in main memory) during the computation, i.e., once in Compute-DC and twice in KECC as KECC will modify the graph that is input to it [11].In this subsection, we propose an adjacency array-based implementation to explicitly bound the constant on m by 2 such that the space complexity becomes 2m + O(n log δ(G)), and at the same time keep the time complexity unchanged which is challenging.Note that we do not optimize the constant on n log δ(G), as real-world graphs usually have much more edges than vertices, i.e., m usually is the dominating factor. Adjacency array-based implementations The adjacency array-based graph representation is also known as the compressed sparse row (CSR) representation.It uses two arrays to represent a graph, and assumes that the vertices are taking ids from {0, . . ., n − 1}.We denote the two arrays by pstart and edges.The set of adjacent edges (specifically, neighbors) of each vertex is stored consecutively in an array, and then, all such arrays are concatenated into the large array edges.The start position of the set of adjacent edges of vertex i in edges is stored in pstart[i], and thus, the set of adjacent edges of vertex i is stored consecutively in the subarray edges[ pstart[i], . . ., pstart[i + 1] − 1]. Figure 10 demonstrates such a representation for the subgraph g 2 of Fig. 2; please ignore the part of " pend" for the current being.The array pstart is of size n + 1, while the array edges is of size 2m. Efficient Implementation of Vertex Removal and Contraction. To achieve the space complexity of 2m + O(n log δ (G)), we will not be allowed to create any new copies of edges, even if temporarily.This makes it challenging to efficiently implement vertex removal and vertex contraction which are the two primitive operations used by the algorithms.In the following, we discuss how to implement these two operations efficiently with the help of some additional data structures of size O(n). Efficient Implementation of Vertex Removal and Contraction. Vertex removal in the adjacency array-based graph representation can be implemented by marking the vertex as "removed".Recall that, when vertex i is "removed", the edge ( j, i) that ends at i should also be removed from the adjacent edges of j for each neighbor j of i.This cannot be implemented efficiently without cross pointers, but storing cross pointers is not affordable for achieving the space complexity of 2 m + O(n log δ(G)).To circumvent this, we propose to remove ( j, i) from the adjacent edges of j in a lazy way, i.e., delay it to the moment when we actually need to traverse all Fig. 11 After removing vertex v 7 adjacent edges of j.Thus, we introduce another array, named pend, of size n, where the entry pend[ j] explicitly stores the last position of the adjacent edges of vertex j in edges and is initialized with pstart[ j +1]−1; see Fig. 10.When we need to traverse all the adjacent edges of j, we loop through all the index values idx from pstart[ j] to pend[ j]: If the edge edges[idx] should have been removed (i.e., the other endpoint of this edge is "removed"), we first swap edges [idx] with edges[ pend [ j]] and then decrement pend[ j] by one.In this way, all the remaining (i.e., active) adjacent edges of vertex j would be consecutive in edges starting from position pstart[ j] and ending at pend[ j], while the edges in edges whose indices are between pend[ j]+1 and pstart[ j +1]−1 are "removed".Thus, the amortized time of removing an edge is constant.For example, the result of removing vertex v 7 from the graph of Fig. 10 is shown in Fig. 11; here, for illustration purpose, we assume that the graph has been traversed once such that edges is reorganized. Efficient Implementation of Vertex Removal and Contraction. When contracting vertex i and vertex j, following the same ideas as Sect.5.1 we also use v i to represent the resulting super-vertex and divide the process into two parts: the edges starting from v j should start from v i ; the edges ending at v j ought to end at v i .For the first part, instead of moving adjacent edges around which would create temporary copies of edges and furthermore increase the time complexity, we use two additional arrays, sv_next and sv_last, each of size n to represent the super-vertices.That is, sv_next chains together all vertices that belong to the same super-vertex, implicitly represented as a singly-linked list; specifically, sv_next[i] stores the id of the next vertex (i.e., after i) in the super-vertex.To efficiently merge two super-vertices (that are represented as singly-linked lists), we also store in sv_last[i] the id of the last vertex in the super-vertex i.For example, Fig. 12a shows the values of sv_next and sv_last for the graph of Fig. 10; note that the part in the dotted rectangle illustrates the linked lists that represent the super-vertices and is not physically stored.When contracting (super-)vertex i with (super-)vertex j, we first update sv_next[sv_last [i]] to j to connect the two linked lists into one, and then update sv_last [i] to sv_last [ j]; this can be conducted in constant time.Note that sv_last[i] is only useful and up-to-date if i is the first vertex in a linked list, i.e., sv_last [•] for all other vertices are not updated and will Fig.12 Example of contracting 6 and v 8 not be used.Figure 12b shows the result of contracting v 6 and v 8 ; notice that v 6 and v 8 are now linked together.To iterate over all edges adjacent to (super-)vertex i, we use a pointer p which is initialized as i and is then iteratively updated by sv_next[ p] until reaching the end of the linked list.These p values correspond to ids of the vertices that are contracted into (super-)vertex i.Thus, the edges adjacent to (super-)vertex i are edges[ pstart[ p], . . ., pend [ p]] for all p values along the iterations. Efficient Implementation of Vertex Removal and Contraction. For the second part of vertex contraction (i.e., edges ending at v j ought to end at v i ), explicitly modifying the edge end-points without maintaining cross pointers would be time-consuming.To tackle this issue, we propose to use an additional disjoint-set data structure of size O(n) to represent the super-vertices.The universe of the data structure is the vertex set V , and each super-vertex corresponds to a set in the data structure that consists of the vertices contained in the super-vertex.When we contract two super-vertices, we also union their corresponding sets in the data structure.In addition, we point the representative of a set in the data structure to the vertex that represents the corresponding super-vertex, in the same way as that in constructing the hierarchy tree in Sect.4.2.The last row of Fig. 12 illustrates the disjoint sets, where the representative of a set is shown in bold, e.g., v 6 and v 8 are in the same set in Fig. 12b with v 6 being the representative. Efficient Implementation of Vertex Removal and Contraction. Our Space-Optimized Algorithms.With the ideas presented above, we first optimize the space usage of KECC by using the adjacency array-based graph representation, as it is an essential procedure used in DC.We denote our spaceoptimized version of KECC as KECC-AA.Note that, with the above implementations of vertex removal and vertex contraction, the input graph to KECC-AA is always represented by pstart and edge which are not changed, although the order of the adjacent edges for each vertex may change.Thus, we do not need to store another copy of the input graph, and the space complexity of KECC-AA is 2m Efficient Implementation of Vertex Removal and Contraction. With KECC-AA, we are now ready to present our spaceoptimized version of It is worth pointing out that directly replacing KECC with KECC-AA in Algorithm 3 will not achieve our desired space complexity.The main idea is still based on the fact that g 1 and g 2 in Algorithm 3 have disjoint sets of edges.But now, we cannot afford to first construct g 1 and g 2 from g and then release the memory of g, as this will double the intermediate memory consumption.To tackle this issue, we always expand the right child of a node in the recursion tree (see Fig. 7) before expanding the left child.This is based on the observation that, for a non-leaf node in the recursion tree, the graph processed by its right child is always a subgraph of the current graph, while the graph processed by the left child is obtained by contracting each connected component (of the graph of the right child) into a super-vertex in the current graph.Thus, to process the right child, we can directly work on pstart and edges by rearranging the adjacent edges of each vertex and using a local array of size n to bookmark the number of adjacent edges of each vertex in the subgraph.After expanding the right child (and its descendants) and to process the left child, we further create a local copy of sv_next, sv_last and the disjoint-set data structure, which are all of size O(n), to implement the contraction operation. Efficient Implementation of Vertex Removal and Contraction. The pseudocode of the adjacency array-based implementation of DC is illustrated in Algorithm 5, denoted by DC-AA.It is generally similar to Algorithm 3, with three differences.Firstly, it invokes KECC-AA instead of KECC at Line 10.Secondly, it expands the right child first (Lines 11-13).Thirdly, it interleaves the execution of Algorithm 4 with Construct-DC-AA (Lines 2, 3, 7).The reason of interleaving is that explicitly storing the Steiner connectivities of all edges would increase the space consumption by at least 2m +O(n), and interleaving eliminates the requirement of storing the Steiner connectivities.This interleaving is correct because the right child is always expanded before the left child for each node in the recursion tree (Fig. 7), and thus, the Steiner connectivities are computed in non-increasing order.Note that we also exploit this interleaving to reduce the memory consumption for DC, TDand BUin our experiments. Efficient Implementation of Vertex Removal and Contraction. The correctness of DC-AA directly follows from the correctness of the discussions in the above two paragraphs, and the time complexity of DC-AA remains the same as DC since our adjacency array-based implementation does not increase the time complexity of vertex removal and contraction.The space complexity of DC-AA becomes 2m +O(n log δ(G)), as it conducts a depth-first traversal of the recursion tree (Fig. 7) and each level of the recursion tree only requires a local data structure of size O(n). Efficient Implementation of Vertex Removal and Contraction. With the same idea as DC-AA, we can also implement TD and BU by using the adjacency array-based graph representation such that their space complexities become 2m + O(n), while their time complexities remain unchanged.We denote our space-optimized versions of TD and BU by TD-AA and BU-AA, respectively. A practically efficient approach In this section, we propose a simpler and practically efficient approach for ECo-decomposition by optimizing BU-AA.Our empirical studies in Sect.7.1.1(specifically, Fig. 15) show that BU-AA can outperform DC-AA when the degeneracy δ(G) is small (e.g., less than 25 or so), but is outperformed by DC-AA when δ(G) becomes large.The main reason of BU-AA outperforming DC-AA for small δ(G) is that (1) the difference between δ(G) and log δ(G) is small when δ(G) is small and (2) BU-AA is simpler and thus has a smaller constant coefficient in the time complexity analysis.When δ(G) becomes larger, BU-AA is outperformed by DC-AA because BU-AA needs to invoke KECC on G (or more precisely, a contracted version of G) for a large number (i.e., δ(G)) of iterations (see Line 4 of Algorithm 2).We propose a simple optimization technique, called k-core reduction, to improve the efficiency of Line 4 of Algorithm 2 by significantly reducing the graph that is input to KECC when δ(G) is large.The definition of k-core is as follows. A practically efficient approach Definition 3 (k-core [34]) Given a graph G and an integer k, the k-core of G is the maximal subgraph g of G such that the minimum degree of g is at least k. A practically efficient approach Like k-ECC, k-core is also a vertex-induced subgraph.For example, for the graph in Fig. 2, the entire graph is a 3-core, and g 1 as induced by vertices A practically efficient approach A related concept is core number, denoted core(•), where core(u) is the largest k such that u is included in the kcore.For example, for the graph in Fig. 2, the core numbers for {v 1 , v 2 , v 3 , v 4 , v 5 } are 4, while the core numbers for all other vertices are 3.It is known that the k-core is simply A practically efficient approach i.e., the subgraph of G induced by the set of all vertices with core number at least k [9]. A practically efficient approach The following lemma claims the relationship between the k-core and k-ECCs of a graph. Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. For example, for the graph in Fig. 2, g 1 ∪ g 2 and g 3 are the two 3-ECCs of the graph and g 1 is the only 4-ECC. Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. Following Lemma 3, when computing k-ECCs, it is sufficient to restrict the computation to the k-core of the graph, which could be much smaller than the entire graph.We call this process the k-core reduction.It is worth pointing out that although the k-core reduction has already been utilized in the existing algorithms TD and BU, more specifically in KECC-AA, the full potential of k-core reduction has not been exploited.This is because KECC-AA applies the k-core reduction to reduce its input graph, and although the k-core can be computed in time linear to the number of edges [4,28], the input graph to KECC-AA could be much larger than the k-core.In view of this, we propose to optimize BU-AA by restricting the input of KECC-AA to be the k-core of the input graph, or more precisely a contracted version of the k-core. 5he pseudocode of our optimized BU-AA is shown in Algorithm 6; we denote the optimized version by BU * -AA.The approach is very similar to Algorithm 2, with the only differences at Lines 2-5 and 7-8.Specifically, KECC-AA is now invoked on a subgraph G of G instead of on the entire graph G at Line 8, where G is extracted at Line 7.Moreover, the subgraph G is extracted from G in time that is linear to the number of edges of G , rather than linear to the number of edges of G.This is achieved through Lines 2-4, details of which will be introduced shortly. Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. In accordance with Lemma 3, φ k (G ) computed in Algorithm 6 is exactly the same as φ k (G) computed in Algorithm 2 for all possible k values.Thus, the hierarchy tree constructed by invoking BU * -AA is the same as the one constructed by invoking BU-AA.Based on the definition of k-core, the k 1core of a graph must be a subgraph of the k 2 -core of the graph if k 1 ≥ k 2 .Therefore, when k = δ(G), G is the δ(G)core of G, which is typically only a small part of the entire graph.After decrementing k by 1, G is then expanded to the (δ(G) − 1)-core of G.So on so forth, G would finally be expanded to the whole graph when k gets to some smaller number.Nevertheless, along the expansion of G , k-ECCs are contracted into super-vertices, which reduces the size of G and thus the extracted G .Intuitively, KECC-AA would seldom be invoked on an extremely large graph based on the analysis.Hence, BU * -AA is expected to perform much more efficiently compared to BU-AA in practice.However, note that the worst-case time complexity of BU * -AA remains the same as that of BU-AA. Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. Example 4 Here, we apply BU * -AA on the graph G in Fig. 2 as an example.Core values for {v 1 , v 2 , v 3 , v 4 , v 5 } are computed as 4, and core values for the other vertices in G are computed as 3; thus, δ(G) is 4. Initially, 13 leaf nodes are created in the hierarchy tree T for the thirteen vertices of G.During the first iteration, G is the 4-core of G, which is equivalent to the subgraph g 1 .It could be found that φ 4 (g 1 ) = g 1 so that an ECC node of weight 4 with five children v 1 , v 2 , v 3 , v 4 , v 5 is added into T .g 1 is contracted into a single super-vertex denoted by s 1 .Then, in the second iteration, G is the entire graph where g 1 contracted into a single super-vertex s 1 ; it could be obtained that φ 3 (G ) = {s 1 ⊕ g 2 , g 3 }.As a result, two ECC nodes of weight 3 are added into T .Similarly, s 1 ⊕ g 2 are contracted into a super-vertex denoted by s 1,2 , and g 3 is contracted into a super-vertex denoted by s 3 .In the third iteration, we have φ 2 (G ) = {s 1,2 ⊕s 3 } given the 2-core of G is G itself.Finally, we obtain the same hierarchy tree as shown in Fig. 3. Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. Efficiently Extracting k-core.Recall that Line 8 of Algorithm 6 processes the k-core of a contracted version of G; note that subgraphs are contracted into super-vertices at Line 12. Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. To facilitate an efficient extraction of the k-core, we propose to compute the core number core(•) for each vertex of G (Line 2) and reorganize the edges and vertices in the graph representation based on the computed core numbers (Lines 3-4).As a result, the k-core can be extracted in time linear to the size of the k-core (Line 7). Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. Recall that the adjacent edges (or neighbors) of a vertex v are stored consecutively in the subarray edges Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. . Specifically, this subarray is reorganized in two steps as follows: Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. 1. Split the subarray into two parts.We first split the subarray into two parts by putting all its neighbors whose core numbers are at least core(v) at the front (referred to as Part1), followed by the other neighbors (referred to as Part2).Note that, in this step, the order within each part is arbitrary.This is achieved by using two pointers p 1 and p 2 which are initialized as pstart [v] and pstart[v + 1] − 1, respectively.Then, as long as core(edges[ p 1 ]) is no less than core(v), we increment p 1 by 1, and as long as core(edges[ p 2 ]) is smaller than core(v), we decrement p 2 by 1. Otherwise, core(edges With vertices and adjacent edges in order, we can extract the k-core in time linear to the size of the k-core regardless of the size of the graph, as follows.The k-core contains all vertices with core number larger than or equal to k, which can be extracted by scanning vertices in non-increasing core number order until a vertex with core number lower than k is encountered.Then, edges of the k-core can be recovered by looking into the neighbors of each extracted vertex.That is, for each extracted vertex u, we scan its neighbors from the beginning until meeting a neighbor with core number lower than k.As all neighbors in Part1 of the neighbors of u are guaranteed to be included in the k-core whenever u is in the k-core, we did not enforce any order for the Part1 neighbors of each vertex when reorganizing the edges. Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. Example 5 Figure 13 comes up with a detailed example indicating the intuition of extracting the k-core for different k values with our adjacency array-based graph representation.Two arrays, pstart and edges in Fig. 13b, represent the example graph in Fig. 13a.The array core stores the core number of all vertices as computed by core decomposition on the example graph.The peel array sorts vertices in non-increasing order regarding their core numbers; note that this peel array actually can be directly obtain from the core decomposition, which peels vertices in the reverse order. Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G. Neighbors in edges are ordered in the correct order according to their core numbers.It is worth pointing out that v 2 can be ahead of v 3 in the edges array within v 1 's neighbors despite that the core number of v 3 is larger than the core number of v 2 , since the core numbers of both vertices are larger than or equal to the core number of v 1 .On the other hand, v 1 , v 2 , and v 7 have to be arranged in descending order according to their core numbers in v 3 's neighbors because their core numbers are smaller than the core number of v 3 .In this case, the 3-core of the graph is composed by vertices and edges marked red.Then, the 2-core of the graph is made up of vertices and edges marked blue, together with the 3-core.Finally, the 1-core is the graph itself, which is green part in addition to the 2-core. Complexity Analysis.Here, we analyze the time complexity of Lines 2-4 and 7 of Algorithm 6, which are the lines added in addition to Algorithm 2. Firstly, Line 2 takes O(m) time by the peeling algorithm [4,28], which iteratively removes the vertex with the minimum degree from the graph.Secondly, Line 3 can be conducted in O(m) time as discussed above.Thirdly, Line 4 can be conducted in O(n) time by bin sort.Lastly, Line 7 can be conducted in time that is linear to the size of the extracted graph G by noting that for each vertex u in G we access at most one of its adjacent edges that is not in G .Thus, the time complexity of Algorithm 6 is the same as that of Algorithm 2, i.e., O(δ(G) × T KECC (G)).Compared with Algorithm 2, the additional computations of Algorithm 6 can be conducted very efficiently, and the input to KECC-AA in Algorithm 6 can be much smaller than that in Algorithm 2; hence, the optimization of Algorithm 6 can bring an enormous improvement in practice.Regarding the space complexity, we note that Algorithm 6 can be implemented to take space 2m +O(n).To achieve this, we do not actually explicitly extract and store the subgraph G at Line 7. Instead, whenever we need to access the neighbors of a vertex u in G , we access the longest prefix of the adjacent edges in edges[ pstart[u], . . ., pstart[u + 1] − 1] such that the core numbers of the end-points are at least k. Experiments In this section, we conduct extensive performance studies to evaluate the efficiency and effectiveness of our techniques.Specifically, we evaluate the following ECo-decomposition algorithms: Experiments • TD (Algorithm 1): the existing top-down approach proposed in [7] that uses the doubly linked list-based graph representation.• BU (Algorithm 2): an adaptation of the existing bottomup approach proposed in [42] that uses the doubly linked list-based graph representation.• DC (Algorithm 3): our near-optimal approach (Algorithm 3) that uses the doubly linked list-based graph representation and has a space complexity of O(m + n log δ(G)).• TD-AA, BU-AA, and DC-AA: space-optimized versions of TD, BU and DC by using the adjacency array-based graph representation (Sect.5.2).• BU * -AA (Algorithm 6): our core optimized version of BU-AA. Experiments In addition, we also evaluate two k-ECC computation algorithms: Experiments • KECC: the state-of-the-art algorithm proposed in [11] that uses the doubly linked list-based graph representation.• KECC-AA: our space-optimized version of KECC that uses the adjacency array-based graph representation (Sect.5.2). Experiments The source code of our algorithms is available at https:// lijunchang.github.io/ECo-Decompose/.All algorithms are implemented in C++ and compiled with GNU GCC with the -O3 optimization.All experiments are conducted on a machine with Intel(R) Xeon(R) 3.6GHz CPU and 128 GB memory running Ubuntu.We evaluate the performance of all algorithms on both real and synthetic graphs as follows. Experiments Real Graphs.We evaluate the algorithms on fourteen real graphs from different domains, which are downloaded from the Stanford Network Analysis Platform6 and the Laboratory of Web Algorithmics . 7Statistics of the graphs are shown in Table 1, where the second last column and the last column, respectively, show the average degree and the degeneracy.The graphs are ranked regarding their numbers of edges.We denote the graphs by D1, . .., D14.Synthetic Graphs.We also evaluate the algorithms on two kinds of synthetic graphs that are generated by the graph generator GTGraph . 8 Power-law graphs: A power-law graph is a random graph in which edges are randomly added such that the degree distribution follows a power-law distribution.• SSCA graphs: An SSCA graph contains a collection of randomly sized cliques and also random inter-clique edges. Experiments Firstly, we generate 14 power-law graphs, PL1, . .., PL14, where the number of vertices varies from 16 thousand to 133 million with an increasing factor of 2. The average degree of the power-law graphs is around 24.5; as a result, the number of undirected edges of the power-law graphs varies from 198 thousand to 1.6 billion.The degeneracy of these graphs varies from 18 to 25. Experiments Secondly, we further generate six power-law graphs fixing the number of vertices to be the same as PL7 (i.e., around one million), PL7_1, . .., PL7_6, where the number of edges Thirdly, we generate 12 SSCA graphs, SSCA1, . .., SSCA12, where the number of vertices varies from 4 thousand to 8 million with an increasing factor of 2. The average degree of the SSCA graphs varies from 12 to 135, and the number of undirected edges varies from 24 thousand to 567 million.The degeneracy of the SSCA graphs varies from 15 to 202. Experiments Evaluation Metrics.For all the evaluations, we record both the processing time and the peak main-memory usage.Each testing is run three times, and the average results are reported.All algorithms are run in main memory and use a single thread.For the reported processing time, we exclude the I/O time that is used for loading a graph from disk to main memory.The peak memory usage of a program is recorded by /usr/bin/time . 9 Results for ECo-decomposition We first compare DC-AA with the existing algorithms in Sect.7.1.1 and then compare BU * -AA with DC-AA in Sect.7.1.2. Comparing DC-AA with existing algorithms In this subsection, we evaluate the six ECo-decomposition algorithms, TD, BU, DC, TD-AA, BU-AA, and DC-AA, regarding their processing time and main-memory usage. 9https://man7.org/linux/man-pages/man1/time.1.html. Comparing DC-AA with existing algorithms Results on Real Graphs.We first evaluate the algorithms on real graphs.The results are illustrated in Fig. 14.For better comparison, we separate the algorithms into two groups: linked list-based algorithms (i.e., TD, BU, and DC), and spaceoptimized algorithms (i.e., TD-AA, BU-AA, and DC-AA).The processing time of the three linked list-based algorithms is illustrated in Fig. 14a.We can see that our near-optimal approach DC consistently runs faster than the two stateof-the-art approaches TD and BU, which is inline with our theoretical analysis that the former has a lower time complexity than the latter two.However, all the three algorithms fail to process the two billion-scale graphs D13 and D14, due to running out-of-memory.On the other hand, our space-optimized algorithms are able to process these billion-scale graphs as shown in Fig. 14b, due to their reduced main-memory usage.The overall trend is similar to their counterparts in Fig. 14a, i.e., DC-AA consistently performs the best.When comparing the top-down approach TD-AA with the bottomup approach BU-AA, there is no clear winner despite of having the same time complexity, as their practical performance is sensitive to the graph topology.For example, the processing time of TD-AA, BU-AA, and DC-AA on D13 is, respectively, 13.9hrs, 36.8hrs, and 1.3hrs, while that on D14 is, respectively, 29.4hrs, 13.3hrs, and 3.3hrs. Comparing DC-AA with existing algorithms The main-memory usage of the six algorithms is demonstrated in Fig. 14c.It is evident that our space-optimized algorithms (TD-AA, BU-AA, DC-AA) consume much less memory than the linked list-based algorithms (TD, BU, DC), where TD and BU are the two state-of-the-art approaches.For example, the peak memory usage of our space-optimized algorithms is at most 15 GB for D13 and is at most 24 GB for D14, while the linked list-based algorithms run out-ofmemory even with 128 GB memory.There are three things worth mentioning for Fig. 14c.Firstly, it appears that TD consumes more memory than DC.This is due to implementation differences, i.e., we used the original implementation of TD from [7] while our implementations of BU and DC slightly optimized the constant on m in the space complexity.We do not optimize the code of TD, as linked list-based implementations, which are outperformed by their space-optimized counterparts, are not our main focus.Secondly, the linked list-based algorithm consume more memory on D13 than on D12, while for our space-optimized algorithms, the situation is the opposite.This is because (1) D13 has more edges but less vertices than D12, (2) the memory usage of linked listbased algorithms is mainly dominated by the part on m in the space complexity, while the memory usage of our spaceoptimized algorithms is also affected by the part on n.This is also observed for k-ECC computation algorithms in Fig. 19b.Thirdly, DC-AA always consumes a little bit more memory than TD-AA and BU-AA, which is due to the log δ(G) factor on n in the space complexity of DC-AA.Nevertheless, the gap is minor given that m dominates O(n log δ(G)) for typical graphs. Comparing DC-AA with existing algorithms Results on Synthetic Graphs.The processing time and memory usage of the six algorithms on synthetic graphs are shown in Fig. 15.The overall trend is similar to that on real graphs in Fig. 14.That is, our divide-and-conquer algorithms DC and DC-AA run the fastest, and our space-optimized algorithms consume much less memory than the linked list-based algorithms, e.g., the latter run out-of-memory on PL14 which has 1.6 billion undirected edges.It is interesting to observe that our space-optimized bottom-up approach BU-AA also perform quite well on power-law graphs that have small degeneracy (i.e., at most 25), see Fig. 15a.The results on power-law graphs by varying m and fixing n are shown in Fig. 15b, e; note that the degeneracy of these graphs also Fig. 16 Comparing BU * -AA with DC-AA on real graphs increases with m.We can see that BU-AA now runs slower than DC-AA when the degeneracy becomes large, e.g., the degeneracy of PL7_5 and PL7_6 are 705 and 1, 380, respectively.The processing time and usage of the six ECo-decomposition algorithms on SSCA graphs are, respectively, in Fig. 15c, f, which have similar trends as on the graphs that vary m while fixing n.This is because SSCA graphs as as these power-law graphs have large degeneracy, e.g., the degeneracy of SSCA12 is 202.From Fig. 15, we can also observe that DC-AA scales almost linearly to large graphs for both the processing time and the memory usage. Comparing BU * -AA with DC-AA In this subsection, we compare the efficiency of our simpler approach BU * -AA with the near-optimal approach DC-AA.The results on real graphs are illustrated in Fig. 16a.We can see that BU * -AA consistently runs faster than DC-AA.For example, the processing time of BU * -AA on D13 and D14 is, respectively, 29 min and 1.5hrs, while the processing time of DC-AA on D13 and D14 is, respectively, 78 min and 3.3hrs.Recall that BU * -AA is optimized upon BU-AA by k-core reduction, and BU-AA runs much slower than DC-AA (e.g., on D13) as shown in Fig. 14.This demonstrates that our k-core reduction significantly improves the efficiency of BU-AA.To get more insights, we also show the size of the graph that is input to KECC by BU * -AA and BU-AA, for different k values.The results on ca-CondMat and soc-Epinions1 are reported in Fig. 17.We can see that the input graph to KECC by BU * -AA is significantly smaller than that by BU-AA, especially for large k values; note that, for k = 1, they are the same, as one would expect.This demonstrates the effectiveness of our k-core reduction in BU * -AA. Comparing BU * -AA with DC-AA The memory usage of BU * -AA and DC-AA on real graphs is shown in Fig. 16b.We can see that BU * -AA uses slightly less memory than DC-AA, though the improvement is not significant; this conforms with out theoretical analysis that the space complexity of BU * -AA is 2m + O(n), while the space complexity of DC-AA is 2m + O(n log n).The processing time and memory usage of BU * -AA and DC-AA on synthetic graphs are reported in Fig. 18.The results are similar to that in Fig. 16 for real graphs.That is, BU * -AA runs faster and uses less memory than DC-AA. Results for k-ECC computation In this subsection, we evaluate our space-optimized algorithm KECC-AA for k-ECC computation.We first compare KECC-AA with the linked list-based counterpart KECC that is proposed in [11].The results on real graphs for k = 8 are shown in Fig. 19.We can observe that KECC-AA significantly reduces the memory usage compared with KECC.For example, KECC consumes 78 GB and 119 GB memory, respectively, for processing D13 and D14, while KECC-AA only consumes 11 GB and 17 GB memory for these two graphs.It is also interesting to see that KECC-AA is slightly We also compare KECC-AA with the k-ECC computation algorithm in NetworkX, a popular Python module for graph analytics.The results on the two smallest real graphs D1 and D2 for k = 8 are shown in Table 2; we do not test Net-workX on larger graphs as it is too slow.We can see that KECC-AA significantly outperforms NetworkX for k-ECC computation, e.g., on D2, KECC-AA is more than 60, 000 times faster and consumes 32 times less memory than Net-workX.Although there are factors of programming language difference (i.e., C++ vs. Python), it is clear that KECC-AA has significant advantages over the implementation in Net-workX.It will be an interesting future work to implement KECC-AA in NetworkX. Applications In this subsection, we illustrate applying our ECodecomposition algorithms in applications.Firstly, our algorithms directly speed up the index construction for steiner component search studied in [7,25], which use the hierarchy tree as an index structure for efficiently processing online queries.Secondly, our algorithms can facilitate matrix completability analysis, where matrix completion is typically used for recommendation [14].Specifically, a matrix can be represented as a bipartite graph G = (U ∪ L, E) with U ∩ L = ∅ and E ⊆ U × L. Each row of the matrix corresponds to a vertex of U , each column corresponds to a vertex of L, and each non-zero entry at position (i, j) corresponds to an undirected edge between i ∈ U and j ∈ L. The problem of matrix completion is to predicate values for the entries of the matrix that currently have value 0 (i.e., with value missing).It has been shown in [14] that the higher the edge connectivity of the corresponding bipartite graph, the more accurate the low-rank matrix completion.Thus, the higher the value of k such that i and j are contained in the same k-ECC, the more accurate the predicated value of the (i, j)th entry of the matrix.The hierarchy tree constructed by our algorithms can be used to efficiently obtain the largest k such that i and j are contained in the same k-ECC and thus to estimate the accuracy of the matrix completion for the (i, j)th entry.Also, the hierarchy tree can be used to efficiently retrieve the submatrices, whose corresponding bipartite graphs are k-edge connected, to run the matrix completion algorithm and can be used to provide a guide on choosing the appropriate k.For example, Fig. 20a, b shows the total size of the submatrices whose corresponding bipartite graphs are k-edge connected, for datasets Netflix and Amazon_reviews; here, the size of a submatrix is #rows × #columns.We can see that Netflix is much denser than Amazon_reviews and can be completed more accurately than Amazon_reviews.In particular, the total size of the submatrices whose corresponding bipartite graphs are 200-edge connected is more than 10% of the entire matrix size for Netflix, while there is no such submatrix for Amazon_reviews. Applications 10 https://www.kaggle.com/netflix-inc/netflix-prize-data. Applications 11 http://snap.stanford.edu/data/web-Amazon-links.html. Related work Besides the existing works on ECo-decomposition as discussed in Sects. 1 and 3, we categorize other related works as follows.k-ECC Computation.In the literature, there are three approaches for computing all k-ECCs of a graph for a given k: cutbased approach [31,40,43], decomposition-based approach [11], and randomized approach [3].In this paper, we adopted the decomposition-based approach [11] for k-ECC computation-which is the state of the art-and further optimized its memory usage. Edge Connectivity Computation. Computing the edge connectivity between two vertices has been studied in graph theory [21], which is achieved by maximum flow techniques [17].The state-of-the-art algorithms compute the maximum flow exactly in O(n × m) time [30] and approximately in almost linear time [26,35].Index structures have also been developed to efficiently process vertex-to-vertex edge connectivity queries [1,23].However, steiner connectivity as computed in this paper, which measures the connectivity in a subgraph, is different from edge connectivity as computed in [1,23], which measures the connectivity in the input graph.Thus, these techniques cannot be applied.Moreover, it is worth mentioning that none of our algorithms involve maximum flow computation. Edge Connectivity Computation. Cohesive Subgraph Computation.Extracting cohesive subgraphs from a large graph has also been extensively studied in the literature (see [9] for a recent survey).Here, the cohesiveness of a subgraph usually is measured by the minimum degree (aka, k-core) [34], the average degree (aka, edge density) [8,12,22], the minimum number of triangles each edge participates in (aka, k-truss) [16,32], and the vertex connectivity [38].For some of the measures, the cohesive subgraphs for different cohesiveness values also form hierarchical structures and efficient algorithms have been proposed to construct these hierarchical structures, e.g., core decomposition [15], truss decomposition and its higher-order variants [33], and density-friendly graph decomposition [18,37].However, due to inherently different problem natures, these techniques are inapplicable to computing ECo-decomposition of a graph. Edge Connectivity Computation. Community Search.The problem of community search, which aims to find a densely connected subgraph containing user-given query vertices, has received a lot of attention recently.Edge connectivity is used as one of the density measures [7,24,25]; the techniques proposed in this paper can be used to speed up their index construction.Other density measures include minimum degree, average degree, minimum number of triangles each edge participates in, etc.A comprehensive survey of community search with respect to the different density measures can be found in [19].Modularity, the classic density measure that was originally designed for partitioning a graph into communities (referred to as the community detection problem in the literature) was recently extended to the community search problem [27].Efficient techniques have been proposed in [41] for finding a good community whose number of vertices falls in a user-given range.With the success of deep learning in many domains, graph neural networks have also been recently used for solving the community search problem [13]. Conclusion In this paper, we proposed a near-optimal algorithm DC-AA for constructing the hierarchy tree of k-ECCs for all possible k values.DC-AA has both a lower time complexity and a lower space complexity compared with the state-of-the-art approaches TD and BU.Extensive experimental results on large graphs demonstrate that DC-AA outperforms TD and BU by up to 28 times in terms of running time and by up to 8 times regarding memory usage.As a result, DC-AA makes it possible to process billion-scale graphs in the main memory of a commodity machine.As a by-product, we also significantly reduced the memory usage of the state-of-the-art k-ECC computation algorithm.Moreover, we also proposed a simpler algorithm BU * -AA that is much easier to implement and runs faster than DC-AA in practice. Algorithm 1 : TD(G) Algorithm 2 : BU(G) Fig. 5 Fig. 6 Fig. 5 Steiner connectivities Fig. 7 Fig. 7 Recursion tree 2 and prove in the following theorem that the time complexity of Algorithm 3 then becomes O (log δ(G)) × T KECC (G) .Theorem 3 By setting M = L+H 2 , the time complexity of Algorithm 3 is O (log δ(G)) × T KECC (G) . Fig. 8 Fig. 8 Running example of DC Fig. 8 indicates the whole running process of DC on G, where the top-most part is G itself.The degeneracy is δ(G) = 4.Then, we compute the Steiner connectivities of all edges of G by invoking Compute-DC with input G and [L, H ] = [1, 4].Here, GS 4 1 (G) is the same as G.As L = H and L+H 2 = 3, we compute the 3-ECCs of G and obtain the subgraphs induced by S 1 = {v Fig. 9 Fig. 9 Doubly linked list-based graph representation Fig. 10 Fig. 10 Adjacency array-based graph representation Algorithm 5 :1 7 Execute 10 φ DC-AA(G) Compute the degeneracy δ(G) of G; 2 Execute Lines 1-2 of Algorithm 4; 3 Construct-DC-AA(G, 1, δ(G)); 4 return T ; Procedure Construct-DC-AA(g, L, H ) 5 if L = H then 6 foreach edge (u, v) ∈ E(g) do Lines 4-11 of Algorithm 4 with sc(u, v) equal to L; M (g) ← KECC-AA(g, M); 11 foreach connected subgraph g ∈ φ M (g) do 12 Construct-DC-AA(g , M, H ); 13 Contract g into a super-vertex in g; 14 Construct-DC-AA(g, L, M − 1); 2 . and core(edges[ p 2 ]) ≥ core(v); we swap edges[ p 1 ] with edges[ p 2 ].This process terminates when the two pointers meet each other.In this case, edges[ pstart[v], . . ., p 1 − 1] is Part1 and edges[ p 1 , . . ., pstart[v+1]−1] is Part2.Sort the neighbors in Part2 into non-increasing order regarding their core numbers.We achieve this by using bin sort.Let deg(v) be the degree of v in G.It is easy to see that the time complexity of Step 1 is O(deg(v)) and the time complexity of Step 2 is O(deg(v)+core(v)) = O(deg(v)); note that for the bucket sort in Step 2, the maximum key value is core(v).Thus, the overall time complexity of organizing the adjacent edges of all vertices is O( v∈V deg(v)) = O(m). Fig. 13 k Fig. 13 k-core extraction on an example graph Fig.Fig. 15 Fig. Comparing DC-AA with existing algorithms on real graphs (best viewed in color) Fig. 17 Fig.17 The size of the input graph to KECC by BU * -AA and BU-AA Fig. 18 Fig.18 Comparing BU * -AA with DC-AA on synthetic graphs Fig. 18 Netflix 10 has |U | = 480,189, |L| = 17,770, |E| = 100,480,507, k max = 1, 076, and Amazon_reviews 11 has |U | = 6,643,669, |L| = 2,441,053, |E| = 29,928,296, k max = 140. 1 Create the root ECC node r of T with weight 1; 1 Create one leaf node in T for each vertex of G; 2 Compute an upper bound k max (G) of the largest k such that G has a non-empty k-ECC; 1 Create a new ECC node in T with weight sc(u, v), and add r u and r v as its children;Without loss of generality, assume r u is an ECC node with weight sc(u, v), and add r v as a child of r u in T ; as shown in right part of the middle layer of Fig.8.We compute the 4-ECCs of GS43 (G) and obtain the subgraph induced by vertices {v 1 , v 2 , ..., v 5 }.Thus, all edges among vertices {v 1 , v 2 , ..., v 5 } have Steiner connectivities 4 as indicated in is obtained by contracting each of S 1 and S 2 into a super-vertex as shown in the left part of the middle layer of Fig.8.In GS 2 1 (G), there are two parallel edges between s 1 and s 2 , corresponding to edges (v 9 , v 11 ) and (v 5 , v 12 ).As GS 2 1 (G) is 2-edge connected, the Steinerconnectivities of (v 9 , v 11 ) and (v 5 , v 12 ) are 2. 1 1 , v 2 , . . ., v 9 } and S 2 = {v 10 , . . ., v 13 }, respectively.Thus, we obtain the two graphs GS 2 1 (G) and GS 4 3 (G) as shown in the middle layer of Algorithm 4: ConstructHierarchy Input: A graph G with sc(u, v) for each edge (u, v) Output: The hierarchy tree of ECo-decomposition of G 1 Initialize an empty hierarchy tree T ; 2 foreach vertex u ∈ V (G) do Insert a singleton node u into T ; 3 foreach edge (u, v) ∈ E(G) in non-increasing sc(u, v) order do 4 Let r u (resp r v ) be the root of the tree in T containing u (resp v); 5 if r u = r v then continue; 6 else if both r u and r v are ECC nodes with weight sc(u, v) then 7 Merge r u and r v into a single ECC node; 8 else if none of r u or r v is an ECC node with weight sc(u, v) then 9 Fig. 8.The computation continues on these two graphs with intervals [1, 2] and [3, 4], respectively.The graph GS 4 3 (G) is composed of the two 3-ECCs of G Table 2 Compare KECC-AA with NetworkX (k = 8)

섹션 본문 154문단 · 81,943자

(제목 없음)

1The problem of efficiently computing all k-edge-connected components (k-ECCs) of a graph G for a user-given k has been extensively studied recently in view of its importance in many applications.The k-ECCs of G for all possible values of k form a hierarchical structure; that is, any two different k-ECCs for the same k value are disjoint and any k-ECC is contained in a unique (k-1)-ECC.In this paper, we study the problem of efficiently constructing the hierarchy tree of the k-ECCs for all possible k values, for a graph G.The existing approaches TD and BU construct the hierarchy tree in either a top-down manner or a bottom-up manner, with both having the time complexity of O δ(G) × T KECC (G) , where δ(G) is the degeneracy of G and T KECC (G) is the time complexity of computing all k-ECCs of G for a specific k value.Here, the degeneracy of G is defined as the maximum value among the minimum vertex degrees of all subgraphs of G and is at most √ m where m is the number of edges in G.To improve the time complexity, we propose a divide-and-conquer approach DC running in O (log δ(G)) × T KECC (G) time; this time complexity is optimal up to a logarithmic factor.However, a straightforward implementation of DC would take O((m + n) log δ(G)) main-memory space, which could easily run out-of-memory when processing large graphs; here, n is the number of vertices in G.To reduce the main-memory footprint of our algorithm, we propose adjacency array-based techniques to optimize the space complexity to 2m + O(n log δ(G)) and denote our resulting algorithm by DC-AA.As a by-product of DC-AA, we also improve the space complexity of the state-of-the-art algorithm for computing all k-ECCs for a specific k to 2m + O(n), by using the same technique as used in DC-AA.Finally, we propose optimization techniques to improve the practical efficiency of the existing approach BU and denote the space-optimized version of it as BU * -AA which runs in O δ(G) × T KECC (G) time and 2m + O(n) space.Extensive experiments on large real graphs and synthetic graphs demonstrate that our algorithms DC-AA and BU * -AA outperform the state-of-the-art approaches by up to 28 times in terms of running time and by up to 8 times in terms of main memory usage.In particular, our approach BU * -AA processes the Twitter graph, which has more than 1 billion undirected edges, in 29 min with 13.5 GB memory, while the state-of-the-art approaches take more than 13 h after our space optimization; note that the state-of-the-art approaches run out-of-memory if without our space optimization.Our empirical study also shows that BU * -AA, despite having a higher time complexity, performs better than DC-AA in practice.We also remark that BU * -AA is much simpler and easier to implement than DC-AA.KeywordsEdge connectivity • Hierarchical graph decomposition • Near optimal • Divide-and-conquer B Lijun Chang

Introduction

2The relationships among entities in real-world applications can be naturally modeled by the graph model.As a result, real graph data are abundant.With the proliferation of graph data, one of the fundamental graph problems is to compute the set of all maximal k-edge-connected subgraphs, called k-edge-connected components and abbreviated as k-ECCs, for a user-given k [3,11,40,43].A graph is k-edge connected, if it remains connected after removing any set of Fig. 1 A toy graph and its ECo-decomposition k − 1 edges.For the graph in Fig. 1a, the subgraphs induced by vertices {v 1 , . . ., v 5 } and {v 6 , . . ., v 9 } are two 3-ECCs, with the former also being a 4-ECC.Computing k-ECCs has many applications, such as identifying closely related entities for social behavior mining [2], discovering cohesive blocks (communities) in social networks (e.g., Facebook) [39], matrix completability analysis [14], and measuring robustness of communication networks [11].

3Specifying the appropriate k value for an application is, however, non-trivial and usually needs several iterations of the trial-and-error process.In addition, different applications may need different k values.Hence, it is critical to precompute a data structure, such that all k-ECCs for any given k can be efficiently retrieved from the data structure which then as a result can facilitate downstream tasks.It is known that the k-ECCs for all possible k values form a hierarchical structure [42], as the different k-ECCs for the same k value are disjoint and each k-ECC is entirely contained in a unique (k − 1)-ECC [7].As an example, the hierarchy tree T for the k-ECCs of the graph G in Fig. 1a is shown in Fig. 1b.Here, the leaf nodes are vertices of G and non-leaf nodes correspond to k-ECCs of G; to distinguish vertices of T from that of G, we refer to vertices of T as nodes.From the constructed tree T , the set of k-ECCs for any k can be easily extracted in time linear to the size of the k-ECCs.Thus, the problem becomes efficiently constructing the hierarchy tree for k-ECCs of all possible k values.We called this problem Edge Connectivity-based hierarchical graph decomposition and abbreviate it as ECo-decomposition.

4Besides all the applications above, computing ECodecomposition (i.e., the hierarchy tree) also has its own applications.Some example applications are as follows.

5• Hierarchical Organization and Visualization of Graphs.

6ECo-decomposition constructs a hierarchical organization of a graph.This hierarchical organization can facilitate graph topology analysis [6] and assist users to visualize a graph in a multi-granularity manner [29], for example, zoom in and out based on the edge connectivities of subgraphs.• Graph Sparsification.ECo-decomposition efficiently computes the Steiner connectivity for all edges (see Sect. 4.1).It is shown in [5,20] that independently sam-pling edges according to their Steiner connectivities preserves the values of all cuts with a small multiplicative error.Note that this reduces the number of edges and thus sparsifies the graph.• Steiner Component Search.ECo-decomposition is also an inherent preprocessing step for the problem of online Steiner component search [7,25], which aims to compute the subgraph that contains a set of user-given query vertices and has the maximum edge connectivity [7].

7The state-of-the-art approaches TD and BU compute the ECo-decomposition (i.e., construct the hierarchy tree T ) either in a top-down fashion [7] or in a bottom-up fashion [42].TD computes k-ECCs of G for all possible k values in increasing order and thus constructs the hierarchy tree in a top-down fashion [7].BU computes k-ECCs of G for all possible k values in decreasing order and thus constructs the hierarchy tree in a bottom-up fashion [42].Computation sharing techniques are exploited in TD and BU based on the observation that the working graph in an iteration for computing k-ECCs could be smaller than the input graph G, e.g., the working graph in TD for computing k-ECCs is not G but the set of (k − 1)-ECCs of G which are the results of the previous iteration [7].The worst-case time complexities of TD and BU are both O δ(G) × T KECC (G) , where T KECC (G) is the time complexity of computing all k-ECCs of G for a specific k and δ(G) is the degeneracy of G.The degeneracy of G is defined as the maximum value among the minimum vertex degrees of all subgraphs of G [28].Note that the time complexity of O δ(G) × T KECC (G) is the same as the straightforward approach that independently computes k-ECCs of G for all possible k values, as the largest k will be no larger than δ(G).

8Our Near-Optimal Approach.To improve the time complexity, we separate the computation into two parts, by first computing the Steiner connectivity for all edges of G and then constructing the hierarchy tree T based on the computed Steiner connectivities.Here, the Steiner connectivity of an edge (u, v), denoted sc(u, v), is the largest k such that a k-ECC of G contains the edge.We in this paper show that the hierarchy tree of the ECo-decomposition can be constructed in O(m) time given the Steiner connectivities of all edges of G, where m is the number of edges of G. Consequently, the main problem of ECo-decomposition is to efficiently compute the Steiner connectivity for all edges of G.

9We propose a divide-and-conquer approach DC to compute the Steiner connectivities of all edges.The general idea is that given the set E H L of edges of G whose Steiner connectivities are in the range [L, H ], i.e., E H L = {(u, v) ∈ E(G) | L ≤ sc(u, v) ≤ H }, we compute the exact Steiner connectivity for all edges of E H L as follows.If L = H , then sc(u, v) = L for every edge (u, v) ∈ E H L and the problem is solved.Otherwise, let M = L+H 2 , we divide the problem into two subproblems, E and E , to be solved recursively; here,

10The critical step is efficiently dividing a search problem E H L into two subproblems: E and E .We show that E is exactly the set of edges of E H L that are not in M-ECCs of the subgraph of G induced by E H L and all edges of G whose Steiner connectivities are larger than H , and E is equal to E H L \E .In addition, we propose computation sharing techniques and prove that DC runs in O (log δ(G)) × T KECC (G) time.

11The time complexity of DC is optimal up to a logarithmic factor, since the time complexity of any ECo-decomposition algorithm is clearly lower bounded by T KECC (G).However, a naive implementation of DC would take O (n +m) log δ(G) main-memory space which makes it infeasible to process large graphs.We show that the space complexity can be improved to O(m + n log δ(G)).However, this is still too high to be applied to billion-scale graphs as it will run out-ofmemory.Note that the constant hidden by the big-O notation is large.In view of this, we further propose techniques, based on adjacency array, to reduce the space complexity to 2m + O(n log δ(G)) by explicitly bounding the constant on m by 2, while not increasing the time complexity.We denote our space-optimized approach as DC-AA, where AA stands for adjacency array.

12In addition, we also propose a practically efficient algorithm BU * -AA, which follows the general paradigm of BU.That is, BU * -AA also computes k-ECCs of G for all possible values of k in decreasing order.However, instead of processing all vertices when computing the k-ECCs for each k, we show that we only need to process a subset of the vertices; we propose techniques to efficiently extract this subset of vertices as well as the subgraph induced by them.Although the time complexity of BU * -AA remains the same as that of BU, i.e., O(δ(G) × T KECC (G)), BU * -AA runs much faster than BU and performs even better than DC-AA in practice.Note that BU * -AA is much simpler and easier to implement than DC-AA.Furthermore, BU * -AA has a space complexity of 2m + O(n).

13We conduct extensive empirical studies on large graphs to evaluate our algorithms.The results show that our approach DC-AA outperforms the state-of-the-art approaches TD and BU by up to 28 times in terms of running time and by up to 8 times in terms of memory usage.Take the Twitter graph that has 1.2 billion undirected edges as an example, DC-AA finishes in 78 min by consuming 15 GB memory, while TD and BU (as well as DC) run out-of-memory on a machine with 128 GB memory; on the other hand, our space-optimized versions of TD and BU finish in 13.9 and 36.8 h, respectively.Furthermore, our practical approach BU * -AA runs faster and consumes less memory than DC-AA, e.g., BU * -AA finishes in 29 min with 13.5 GB memory for the Twitter graph.

Contributions.

14Our main contributions are summarized as follows:

151. We propose a near-optimal approach to ECodecomposition, which improves the time complexity from O(δ(G) × T KECC (G)) of existing approaches to O((log δ(G)) × T KECC (G)) of our approaches.2. We propose techniques to implement our algorithm such that it takes 2m + O(n log δ(G)) main-memory space and thus can process billion-scale graphs in the main memory of a commodity machine.3. We also propose a simpler and practically efficient algorithm that has space complexity of 2m + O(n). 4. As a by-product of our space optimization techniques, we significantly reduce the memory usage of the state-ofthe-art k-ECC computation algorithm proposed in [11].Moreover, we anticipate that our space optimization techniques can also be generally applied to other graph algorithms. 5. We conduct extensive empirical studies on large real and synthetic graphs to evaluate the efficiency of our approaches.

16A preliminary version of this work has been published in [10].Compared with [10], we have proposed a new algorithm BU * -AA, added proofs for all lemmas and theorems, and conducted new experimental studies on SSCA synthetic graphs as well as the new algorithm BU * -AA in this paper.

17Organization.The rest of the paper is organized as follows.Section 2 gives preliminaries of the studied problem, and Sect. 3 presents the existing algorithms.We propose a near-optimal approach in Sect. 4 and develop techniques to reduce the memory usage of our algorithms in Sect. 5. We further propose a simpler and practically efficient algorithm in Sect.6. Section 7 reports the results of our experimental studies, and Sect.8 provides an overview of related works.Finally, Sect.9 concludes the paper.

Preliminaries

18In this paper, we consider a large unweighted and undirected graph G = (V , E), with vertex set V and edge set E. The number of vertices and the number of undirected edges in G are denoted by n = |V | and m = |E|, respectively.Given a vertex subset

19For an arbitrary graph g, we use V (g) and E(g) to, respectively, denote its set of vertices and its set of edges.

Fig. 2 An example graph

20A graph is k-edge connected if the remaining graph is still connected after the removal of any k − 1 edges from it.Note that, by definition, a graph with less than k edges (e.g., consisting of a singleton vertex) is not considered to be k-edge connected.Then, k-edge-connected component is defined as follows.

21(ii) g is maximal (i.e., any super-graph of g is not k-edge connected).

22Consider the graph in Fig. 2, the entire graph is a 2-ECC but not a 3-ECC (since the graph will be disconnected after removing edges (v 5 , v 12 ) and (v 9 , v 11 )).The subgraph g 1 is a 4-ECC, and g 3 is a 3-ECC.Note that g 2 , although is 3-edge connected, is not a 3-ECC since its super-graph g 1 ⊕ g 2 is also 3-edge connected (i.e., g 2 is not maximal).Here, g 1 ⊕ g 2 denotes the union of g 1 and g 2 , which also includes the cross edges between vertices of g 1 and vertices of g 2 .

23Hierarchy Tree of k-ECCs.It is shown in [7] that the k-ECCs of a graph satisfy the following properties.

241.Each k-ECC is a vertex-induced subgraph.2. Any two distinct k-ECCs for the same k value are disjoint.

Each k-ECC for

25Thus, the k-ECCs of a graph G for all possible k values can be compactly represented by a hierarchy tree T , where leaf nodes of T correspond to vertices of G and non-leaf nodes of T correspond to distinct k-ECCs of G.Note that, to distinguish vertices of T from that of G, we refer to vertices of T as nodes.Figure 3 illustrates the hierarchy tree for k-ECCs of the graph in Fig. 2. We call non-leaf nodes of T as ECC nodes, and each ECC node is associated with a weight.An ECC node of weight k corresponds to a k-ECC which is the subgraph of G induced by all leaf nodes in the subtree of T rooted at the ECC node.For example, the left 3-ECC node in Fig. 3 corresponds to the 3-ECC g 1 ⊕ g 2 in Fig. 2, which is the subgraph induced Fig. 3 Hierarchy tree T by vertices v 1 , . . ., v 9 .Note that if a subgraph g is both a k-ECC and a (k + 1)-ECC, it is only represented once in the hierarchy tree by an ECC node of weight k + 1.For example, the entire graph G is both a 2-ECC and a 1-ECC and is represented by the ECC node of weight 2. Thus, each nonleaf node will have at least two children, and the size of the hierarchy tree T is linear to n.

26It is worth pointing out that for any given k, the set of all k-ECCs of G can be efficiently obtained from the hierarchy tree T in time linear to the size of the k-ECCs.

27Problem Statement.Given a large graph G, we study the problem of efficiently constructing the hierarchy tree for the set of all k-ECCs of G.We term this problem as Edge Connectivity-based hierarchical graph decomposition and abbreviate it as ECo-decomposition.

28In this paper, we will consider the algorithm for computing all k-ECCs of g for a given k as a black-box, denoted KECC(g, k).While any of the algorithms in [3,11,43] can be used to implement KECC(g, k), we implement the state-ofthe-art algorithm in [11] in our experiments.We use T KECC (G) to denote the time complexity of KECC(G, k) when G is taken as the input graph 1 and assume that T KECC (G) is at least linear to the number of edges of G.

Existing solutions

29In this section, we briefly review the two state-of-the-art approaches, and discuss their time complexities.The existing approaches compute the ECo-decomposition (i.e., the hierarchy tree) either in a top-down manner [7] or in a bottom-up manner [42].

30A Top-Down Approach: TD.The top-down approach constructs the hierarchy tree in a top-down manner, which is achieved by explicitly computing k-ECCs of G for all k values in increasing order [7].The pseudocode is shown in Algorithm 1, denoted by TD.Initially, the root ECC node r of weight 1, which corresponds to the entire input graph G, is created for T (Line 1); note that, without loss of generality here G is assumed to be connected.Then, it recursively adds the set of children to each ECC node in a top-down fashion by invoking Construct-TD (Line 2).

31Given an ECC node ecc of weight k whose corresponding graph is g (i.e., g is a k-ECC of G), Construct-TD constructs the set of children of ecc.To do so, it first computes the set of (k + 1)-ECCs of g (Line 4), denoted φ k+1 (g).If φ k+1 (g) is the same as g which means that g itself is (k + 1)edge connected (Line 5), then the weight of ecc is increased to k + 1 (Line 6) and the recursion continues for g (Line 7).Otherwise, the set of children of ecc is added as follows: (i) a leaf node is added for each vertex of g that is not in φ k+1 (g) (Lines 9-10) and (ii) an ECC node is added for each connected subgraph g of φ k+1 (g) (Lines 11-12).The recursion continues for each newly added ECC node (Line 13).

32Example 1 Consider the graph in Fig. 2. φ 2 (G) = {G}; thus, the weight of the root node r of T is 2. φ 3 (G) = {g 1 ⊕g 2 , g 3 }; thus, r has two children corresponding to g 1 ⊕ g 2 and g 3 , respectively.φ 4 (g 3 ) = ∅; thus, all vertices of g 3 are added to be the children of the ECC node corresponding to g 3 .The final hierarchy tree T is the same as shown in Fig. 3.

33A Bottom-Up Approach: BU.The bottom-up approach constructs the hierarchy tree in a bottom-up fashion, which is achieved by computing k-ECCs of G for all k values in decreasing order [42].The pseudocode is shown in Algorithm 2, denoted BU.Initially, one leaf node is created in T for each vertex of G (Line 1), and an upper bound k max (G) of the largest k such that G has a non-empty k-ECC is computed (Line 2).Then, the set of k-ECCs φ k (G) of G are computed, for k varying from k max (G) to 1 (Lines 3-4).Fig. 4 The graph in Fig. 2 after contracting g 1 into super-vertex s 1

34For each connected subgraph g in φ k (G) (Line 5), an ECC node ecc is created in T (Line 6), its children are the nodes of T that correspond to vertices of G (Line 7), and g is then contracted into a super-vertex in G (Line 8); thus, ecc corresponds to the resulting super-vertex in G obtained by contracting g.Note that, when computing k-ECCs of G, each (k + 1)-ECC of G has already been contracted into a supervertex.As a result, if a subgraph is both a k-ECC and a (k − 1)-ECC, it will only be computed, once, as a k-ECC.The correctness of BU follows from the fact that for a k-edgeconnected subgraph g that is not (k + 1)-edge connected, if we contract each (k + 1)-ECC of g into a super-vertex, then the resulting graph is still k-edge connected.

35Example 2 Consider the graph in Fig. 2 and assume the upper bound is computed as k max (G) = 4.In the first iteration, we obtain φ 4 (G) = {g 1 }; thus, an ECC node of weight 4 is created in T with five children v 1 , v 2 , v 3 , v 4 , v 5 .We contract g 1 into a single super-vertex, denoted s 1 ; the resulting graph is shown in Fig. 4 with two parallel edges between s 1 and v 7 .In the second iteration, we obtain φ 3 (G) = {s 1 ⊕ g 2 , g 3 }; thus, two ECC nodes of weight 3 are created in T , corresponding to these two subgraphs, respectively.Then, s 1 ⊕g 2 is contracted into a super-vertex, denoted s 1,2 , and g 3 is contracted into a super-vertex, denoted s 3 .In the third iteration, we obtain φ 2 (G) = {s 1,2 ⊕ s 3 }; thus, the root node of T is obtained.The final result is shown in Fig. 3. Time Complexities of TD and BU.We first prove the following lemma.

36Lemma 1 Let k max (G) be the largest k such that G contains a non-empty k-ECC and δ(G) be the degeneracy of G which is equal to the maximum value among the minimum vertex degrees of all subgraphs of G [28].Then, we have k max (G) ≤ δ(G).

37Proof We prove the lemma by contradiction.Suppose k max (G) > δ(G), and let g be a (k max (G))-ECC of G.Then, the minimum vertex degree of g is at least k max (G), which is larger than δ(G).This contradicts the fact that δ(G) equals the maximum value among the minimum vertex degree of all subgraphs of G. Thus, the lemma holds.

38We actually observe that k max (G) = δ(G) for all real and synthetic graphs tested in our experiments.Thus, the largest k that is input to Construct-TD of Algorithm 1 is δ(G).As we assumed that T KECC (G) is at least linear to the number of edges of G, the time complexity of TD is O δ(G)×T KECC (G) . 2 2 Note that the time complexity analysis of TD is tight; for example, consider an input graph G that itself is δ(G)-edge connected.

39Following Lemma 1, the upper bound k max (G) can be set as δ(G) at Line 2 of Algorithm 2. Thus, the time complexity of BU is O δ(G)×T KECC (G) , 3 as the degeneracy of G can be computed in O(m) time [28].Note that the time complexity analysis of BU is also tight; for example, consider a graph that has no k-ECCs other than a δ(G)-ECC and G itself which is 2-edge connected.

40The degeneracy δ(G), although can be bounded by O( √ m) in the worst case [36], may still be large, especially for large graphs.For example, δ(G) is more than 2000 for the largest graphs tested in our experiments (see Table 1 in Sect.7).As a result, BU and TD are taking excessively long time for processing large graphs due to their high time complexity of O δ(G) × T KECC (G) , not to mention their high space complexity (see Sect. 5).

41Handling Dynamic Graphs.Techniques for handling dynamic graphs have also been proposed in [7].The general idea is based on the fact that deleting an edge from a graph or inserting a new edge into a graph will change the edge connectivity of the graph by at most 1, and moreover, most of the k-ECCs will remain unchanged.These techniques can be directly adopted to maintain the hierarchy tree for dynamic graphs.We omit the details, as we focus on speeding up the construction of the hierarchy tree in this paper.

A near-optimal approach

42In this section, we propose an approach for ECodecomposition that runs in O (log δ(G)) × T KECC (G) time.

43To achieve this, we will need to avoid the explicit computation and enumeration of k-ECCs for all possible k values, since the k-ECCs for all possible k values could be of total size δ(G)×T KECC (G) in the worst case if T KECC (G) is roughly linear to m.Consequently, simply reporting k-ECCs for all possible k values would already take O δ(G) × T KECC (G) time.Instead, we use a two-step paradigm, which first computes the Steiner connectivity for all edges of G and then constructs the hierarchy tree based on the Steiner connectivities, as follows.

44We will show that given the Steiner connectivities of all edges, the hierarchy tree can be constructed in linear time, and thus, computing the Steiner connectivities of all edges dominates the time complexity.As there are only m edges and thus only m Steiner connectivities to compute, it is possible to compute them in time less than δ(G) × T KECC (G).

45In the following, we first in Sect.4.1 propose an algorithm to compute the Steiner connectivities of all edges in O (log δ(G)) × T KECC (G) time and then in Sect.4.2 present an algorithm to construct the hierarchy tree in O(m) time based on the computed Steiner connectivities.

Computing Steiner connectivities

46The Steiner connectivity is defined as follows.[7]) Given a graph G, the Steiner connectivity of an edge (u, v), denoted sc(u, v), is the largest k such that a k-ECC of G contains both u and v.

Definition 2 (Steiner Connectivity

47For example, in Fig. 5, the Steiner connectivity of each edge is computed as shown on the edge, e.g., sc(v 1 , v 4 ) = 4.In this subsection, we propose a divide-andconquer approach for computing the Steiner connectivities of all edges in a graph.Note that, although the concept of Steiner connectivity is borrowed from [7], all our techniques in the following are new.1) removing all vertices and edges that are not in k 1 -ECCs of G and (2) contracting each (k 2 + 1)-ECC of G into a super-vertex.Note that the resulting graph of GS k 2 k 1 (•) may have parallel edges.For example, GS 3 3 (G) for the graph G in Fig. 2 is shown in Fig. 6 which is obtained by (1) removing edges (v 5 , v 12 ) and (v 9 , v 11 ) and (2) contracting subgraph g 1 into a super-vertex s 1 .There are two parallel edges between s 1 and v 7 in Fig. 6.

48The graph shrink operator GS k 2 k 1 (•) has several properties which will be useful for computing Steiner connectivities.Firstly, applying the operator GS k 2 k 1 (•) preserves the Steiner connectivity for all edges in the resulting graph.

Property 1 Given a graph G and two integers k

49It is easy to verify that the Steiner connectivity of (u, v) must be within the range

50, and let g be the k-ECC of G that contains (u, v).Then, by contracting each (k 2 + 1)-ECC of g into a super-vertex, the resulting graph is still k-edge connected and is a k-ECC of GS k 2 k 1 (G).Thus, the Steiner connectivity of (u, v) when computed in GS k 2 k 1 (G) is no smaller than that computed in G. Similarly, we can prove that the Steiner connectivity of (u, v) when computed in G is no smaller than that computed in GS k 2 k 1 (G).Therefore, the property holds.

51Secondly, the Steiner connectivity for all edges of GS k k (G) is k.For example, all edges in Fig. 6 have Steiner connectivity 3.

Property 2 Given a graph G and an integer k, every edge of GS k k (G) has Steiner connectivity k.

52Proof This property directly follows from Property 1 and the definition of Steiner connectivity.

53Thirdly, multiple operations of GS k 2 k 1 (•) can be chained together.

Property 3 Given a graph G and four integers k

54Proof This property directly follows from properties 1 and 2 and the hierarchical structure of k-ECCs for different k values.

55Our Divide-and-Conquer Approach: DC.From Property 2, we know that the Steiner connectivities of all edges of GS k k (G) are k.Moreover, from the definitions of Steiner connectivity and the graph shrink operator, we know that all edges whose Steiner connectivities are k will be in

56propose a divide-and-conquer approach based on the fact that

57The pseudocode of our approach is shown in Algorithm 3, denoted DC.It first computes the degeneracy δ(G) of G (Line 1) and then invokes procedure Compute-DC with input (G, 1, δ(G)) to compute the Steiner connectivities of all edges (Line 2), while Line 3 constructs the hierarchy tree

5810 Let g 1 be the graph obtained from g by contracting each connected subgraph of φ M (g) into a super-vertex, and g 2 be the union of subgraphs in φ M (g);

59and will be discussed in Sect.4.2.The input to Compute-DC consists of a graph g and an interval [L, H ]. If L = H , then the Steiner connectivities of all edges of g are set as L (Lines 5-6).Otherwise, an integer M is chosen such that

60) and two graphs g 1 and g 2 are obtained from g based on φ M (g) (Line 10), and finally the algorithm continues on g 1 (Line 11) and on g 2 (Line 12).We prove by the following lemma that when initially invoking Compute-DC with graph G and interval [1, δ(G)], the graph g being processed for each recursion with interval

61, then the two graphs g 1 and g 2 obtained at Line 10 are exactly GS M−1 L (G) and GS H M (G), respectively.Proof According to the definition of the graph shrink operation

62where the last equality follows from Property 3. Similarly, we have

63Thus, the lemma holds.

64Based on Lemma 2, the recursion tree of invoking Compute-DC with input (G, 1, δ(G)) is shown in Fig. 7.

65The correctness and time complexity of Algorithm 3 are proven by the following two theorems.

Theorem 1 Algorithm 3 correctly computes the Steiner connectivity for all edges of G.

66Proof The recursive invocation of Compute-DC stops when L = H (see Lines 5-6 of Algorithm 3).If L < H , (G) which is the same as G. Thus, the recursion tree of invoking Compute-DC with input (G, 1, δ(G)) is shown in Fig. 7. Property 2 states that the instance of GS with input g = GS k k (G), L = k and H = k correctly computes the Steiner connectivity for all edges whose Steiner connectivities are k.Thus, the theorem holds.

Theorem 2 The time complexity of Algorithm 3 is O(h × T KECC (G))

67, where h is the height of the recursion tree in Fig. 7.

68Proof We define the level of a node in the recursion tree as its distance to the root.Then, the subgraphs of G, corresponding to the nodes of the recursion tree that are at the same level, have disjoint sets of edges.Thus, the time complexity of the computation for each level of the recursion tree is O(T KECC (G)), by assuming that T KECC (G) is linear or superliner to the number of edges of G. Consequently, the total time complexity of Algorithm 3 is O(h × T KECC (G)) as the recursion tree has h levels.

69Near-Optimal Time Complexity.Algorithm 3 correctly computes the Steiner connectivities of all edges regardless of the choice of M at Line 8, as long as L < M ≤ H . Yet, the time complexity of Algorithm 3 would vary for different choices of M. For example, if M is always set as L + 1 or always set as H , then the height of the recursion tree would be δ(G) and thus the time complexity of Algorithm 3 would be O(δ(G) × T KECC (G)) on the basis of Theorem 2. To make the time complexity as low as possible, we will need to reduce the height of the recursion tree.Thus, we propose to set M as L+H

70, is optimal up to a logarithmic factor log δ(G).This is because the time complexity of ECo-decomposition cannot be lower than T KECC (G), as ECodecomposition also implicitly computes the k-ECCs of G; specifically, the k-ECCs of G can be obtained from the hierarchy tree in time linear to the sizes of the k-ECCs.

71Example 3 Here, we apply DC on the graph G in Fig. 2 as an example.Figure 8

Constructing the hierarchy tree

72Given the Steiner connectivities of all edges of a graph G, Algorithm 4 constructs the hierarchy tree of ECodecomposition of G in a bottom-up manner.The main idea is as follows.First, the hierarchy tree T is initialized as a forest of singleton nodes.Then, for each edge (u, v) ∈ E(G) in non-increasing order regarding sc(•, •), we identify the tree in T (specifically, the root r u of the tree) containing u and the tree (specifically, the root r v of the tree) containing v. If u and v are already in the same tree (i.e., r u = r v ), then we do nothing.Otherwise, we merge the two trees into one in T , with the root of this newly formed tree having weight sc(u, v).

73The pseudocode of constructing the hierarchy tree is illustrated in Algorithm 4, denoted by ConstructHierarchy.The input of the algorithm is a graph G with sc(u, v) precomputed for each edge (u, v).It first initializes an empty hierarchy tree (Line 1) and creates a single-node tree in T for each vertex of G (Line 2).Then, the trees in T will be merged with each other to form ECC nodes in the hierarchy tree.For each edge (u, v) ∈ E(G) sorted by sc(u, v) in non-increasing order (Line 3), the roots of the trees in T containing node u and node v are found, represented by r u and r v , respectively (Line 4).If r u = r v , it implies that vertices u and v have already been merged into the same tree so that the algorithm skips the current edge (Line 5); otherwise, the algorithm merges r u and r v into a single tree based on the following three cases.

74(1) If both r u and r v are ECC nodes with weight sc(u, v), it merges r u and r v into a single ECC node (Lines 6-7).( 2) If neither r u nor r v is an ECC node with weight sc(u, v), it creates a new ECC node in T with weight sc(u, v) whose children are r u and r v (Lines 8-9).( 3) The last situation is that one of r u or r v is an ECC node with weight sc(u, v) and the other is not; note that, if the other one is an ECC node, then its weight must be larger than sc(u, v).Assume that r u is the one with weight sc(u, v), r v would be added as a child of r u .Similar steps would be applied to the situation where r v is the one with weight sc(u, v) (Lines 10-11).

75The most time-consuming operation in Algorithm 4 is Line 4, which aims to find the root of the tree that contains a node u in a forest T .A naive implementation of this operation would take O(n) time by tracing the parent pointers starting from node u in the tree, and then the total time complexity of Algorithm 4 would be O(n × m).This can be improved to O(m) by resorting to the disjoint-set data structure.Recall that a disjoint-set data structure D partitions a universe of elements into a collection of sets, and each set is represented by one of its element (called representative) [17].There are two operations supported by the data structure D: Find the set that contains a specific element and merge two sets into one.In our case, the universe of the data structure D is the set of leaf nodes of the hierarchy tree T , and there is a one-to-one correspondence between sets in D and trees in T .Whenever we merge two trees in T , we also union the two corresponding sets in D.Moreover, we point each set (specifically, the representative element of the set) of D to the root of the tree in T to which the set corresponds.This pointer is used for efficiently identifying the root of the tree that contains a node (i.e., Line 4).As each of the two operations on D takes amortized constant time [17] 4 and sorting the edges at Line 3 can be achieved in linear time by counting sort [17], the time complexity of Algorithm 4 is O(m). 4 To be more precise, the amortized time complexity of each operation on D is the inverse of the Ackermann function of n [17].As this function grows very slowly and is bounded by 4 for all practical values of n, we consider it as a constant.

Optimizing the space usage

76A straightforward implementation of Algorithm 3 would result in a space complexity of O((m + n) log δ(G)), i.e., each level of the recursion tree of Fig. 7 would require storing a separate copy of the input graph G.This space complexity is too high for large graphs.In this section, we focus on optimizing the space usage of DC.We first in Sect.5.1 discuss how to implement DC in O(m + n log δ(G)) space by using doubly linked list-based graph representation, where the constant hidden by the big-O notation is large.Then, in Sect.5.2 we further optimize the space usage of DC by using adjacency array-based graph representation and other non-trivial optimizations; this results in our space-efficient algorithm DC-AA that has space complexity 2 m + O(n log δ(G)).As a result, we can process billion-scale graphs with an ordinary PC.For example, experiments in Sect.7 show that our adjacency array-based algorithms can process twitter-2010 and comfriendster, which have 1.2 and 1.8 billion undirected edges, respectively, with at most 15 GB and 24 GB main memory.In contrast, the linked list-based algorithms run out-of-memory even with 128 GB memory.

Doubly linked list-based implementation

77In this subsection, we discuss how to implement DC by using doubly linked list-based graph representation, which is also the representation used by the state-of-the-art KECC algorithm [11] and the two state-of-the-art ECodecomposition algorithms [7,42].The main reason for the existing approaches to choose this representation is that KECC iteratively modifies the graph-i.e., contract two (super-)vertices into one and remove (super-)vertices of degree less than k [11]-which can be easily implemented by using the linked list-based graph representation.We abstract these two graph modification operations as vertex contraction and vertex removal, respectively.Note that TD also uses the vertex removal operation (see Lines 11-13 of Algorithm 1) and BU uses the vertex contraction operation (see Line 8 of Algorithm 2).

78Recall that the linked list-based graph representation stores the adjacent edges of each vertex in a linked list [17].For example, Fig. 9 illustrates the linked lists for the adjacent edges of v i and v j .In addition, a cross pointer is constructed in the implementation for each edge (v i , v j ) which points to its reverse direction (v j , v i ), as each undirected edge will have two copies in the representation, one copy for each direction.Vertex removal can be implemented efficiently as follows.Suppose we are removing vertex v i from the graph; note that we also need to remove all edges ending at v i which scatter across the linked lists.To achieve this, we iterate through all the adjacent edges of v i , and for each edge (v i , v j ), we first locate its reverse edge (v j , v i ) via the cross pointer and then remove (v j , v i ) from the doubly linked list of v j which can be achieved in constant time.When it comes to vertex contraction, the process becomes slightly more complicated.Suppose we are contracting v i and v j .We use one of the vertices (e.g., v i ) to represent the resulting super-vertex, and the process is divided into two parts: the edges starting from v j should start from v i ; the edges end at v j ought to end at v i .For the first part, we could simply connect the head of the linked list of v j to the tail of the linked list of v i .For the second part, we iterate through all the adjacent edges of v j , and for each edge (v j , v k ), we first locate its reverse edge (v k , v j ) via the cross pointer and then update the edge to be (v k , v i ).

79Based on the linked list-based graph representation, DC (i.e., Algorithm 3) can be implemented fairly easily.Specifically, to construct g 1 = GS M−1 L (g) and g 2 = GS H M (g) = φ M (g) from g = GS H L (G) at Line 10 of Compute-DC, we first split each linked list (that corresponds to the adjacent edges of a vertex) into two, one to be used in g 1 and the other in g 2 , as g 1 and g 2 have disjoint sets of edges.We then apply the contraction operation for the edges in g 1 .In this way, we do not create any new edges in Compute-DC; note, however, that the number of vertices may double (i.e., one copy in g 1 and one in g 2 ).Overall, DC has a space complexity of O(m + n log δ(G)), by noting that it traverses the recursion tree of Fig. 7 in a depth-first manner.

Adjacency array-based implementations

80Although the space complexity of DC has been reduced from O((m + n) log δ(G)) to O(m + n log δ(G)) in Sect.5.1, this is still too high to be applied to large graphs (see our experimental results in Sect.7) as the constant hidden by the big-O notation is large.Firstly, for each edge in the linked lists, three pointers and one number (where the number indicates the other end-point of the edge) need to be stored.Thus, the graph representation will consume at least 8m integers, by noting that each undirected edge is stored twice.Secondly, the graph may be stored three times (i.e., simultaneously have three copies in main memory) during the computation, i.e., once in Compute-DC and twice in KECC as KECC will modify the graph that is input to it [11].In this subsection, we propose an adjacency array-based implementation to explicitly bound the constant on m by 2 such that the space complexity becomes 2m + O(n log δ(G)), and at the same time keep the time complexity unchanged which is challenging.Note that we do not optimize the constant on n log δ(G), as real-world graphs usually have much more edges than vertices, i.e., m usually is the dominating factor.

81The adjacency array-based graph representation is also known as the compressed sparse row (CSR) representation.It uses two arrays to represent a graph, and assumes that the vertices are taking ids from {0, . . ., n − 1}.We denote the two arrays by pstart and edges.The set of adjacent edges (specifically, neighbors) of each vertex is stored consecutively in an array, and then, all such arrays are concatenated into the large array edges.The start position of the set of adjacent edges of vertex i in edges is stored in pstart[i], and thus, the set of adjacent edges of vertex i is stored consecutively in the subarray edges[ pstart[i], . . ., pstart[i + 1] − 1]. Figure 10 demonstrates such a representation for the subgraph g 2 of Fig. 2; please ignore the part of " pend" for the current being.The array pstart is of size n + 1, while the array edges is of size 2m.

Efficient Implementation of Vertex Removal and Contraction.

82To achieve the space complexity of 2m + O(n log δ (G)), we will not be allowed to create any new copies of edges, even if temporarily.This makes it challenging to efficiently implement vertex removal and vertex contraction which are the two primitive operations used by the algorithms.In the following, we discuss how to implement these two operations efficiently with the help of some additional data structures of size O(n).

83Vertex removal in the adjacency array-based graph representation can be implemented by marking the vertex as "removed".Recall that, when vertex i is "removed", the edge ( j, i) that ends at i should also be removed from the adjacent edges of j for each neighbor j of i.This cannot be implemented efficiently without cross pointers, but storing cross pointers is not affordable for achieving the space complexity of 2 m + O(n log δ(G)).To circumvent this, we propose to remove ( j, i) from the adjacent edges of j in a lazy way, i.e., delay it to the moment when we actually need to traverse all Fig. 11 After removing vertex v 7 adjacent edges of j.Thus, we introduce another array, named pend, of size n, where the entry pend[ j] explicitly stores the last position of the adjacent edges of vertex j in edges and is initialized with pstart[ j +1]−1; see Fig. 10.When we need to traverse all the adjacent edges of j, we loop through all the index values idx from pstart[ j] to pend[ j]: If the edge edges[idx] should have been removed (i.e., the other endpoint of this edge is "removed"), we first swap edges [idx] with edges[ pend [ j]] and then decrement pend[ j] by one.In this way, all the remaining (i.e., active) adjacent edges of vertex j would be consecutive in edges starting from position pstart[ j] and ending at pend[ j], while the edges in edges whose indices are between pend[ j]+1 and pstart[ j +1]−1 are "removed".Thus, the amortized time of removing an edge is constant.For example, the result of removing vertex v 7 from the graph of Fig. 10 is shown in Fig. 11; here, for illustration purpose, we assume that the graph has been traversed once such that edges is reorganized.

84When contracting vertex i and vertex j, following the same ideas as Sect.5.1 we also use v i to represent the resulting super-vertex and divide the process into two parts: the edges starting from v j should start from v i ; the edges ending at v j ought to end at v i .For the first part, instead of moving adjacent edges around which would create temporary copies of edges and furthermore increase the time complexity, we use two additional arrays, sv_next and sv_last, each of size n to represent the super-vertices.That is, sv_next chains together all vertices that belong to the same super-vertex, implicitly represented as a singly-linked list; specifically, sv_next[i] stores the id of the next vertex (i.e., after i) in the super-vertex.To efficiently merge two super-vertices (that are represented as singly-linked lists), we also store in sv_last[i] the id of the last vertex in the super-vertex i.For example, Fig. 12a shows the values of sv_next and sv_last for the graph of Fig. 10; note that the part in the dotted rectangle illustrates the linked lists that represent the super-vertices and is not physically stored.When contracting (super-)vertex i with (super-)vertex j, we first update sv_next[sv_last [i]] to j to connect the two linked lists into one, and then update sv_last [i] to sv_last [ j]; this can be conducted in constant time.Note that sv_last[i] is only useful and up-to-date if i is the first vertex in a linked list, i.e., sv_last [•] for all other vertices are not updated and will Fig.12 Example of contracting 6 and v 8 not be used.Figure 12b shows the result of contracting v 6 and v 8 ; notice that v 6 and v 8 are now linked together.To iterate over all edges adjacent to (super-)vertex i, we use a pointer p which is initialized as i and is then iteratively updated by sv_next[ p] until reaching the end of the linked list.These p values correspond to ids of the vertices that are contracted into (super-)vertex i.Thus, the edges adjacent to (super-)vertex i are edges[ pstart[ p], . . ., pend [ p]] for all p values along the iterations.

85For the second part of vertex contraction (i.e., edges ending at v j ought to end at v i ), explicitly modifying the edge end-points without maintaining cross pointers would be time-consuming.To tackle this issue, we propose to use an additional disjoint-set data structure of size O(n) to represent the super-vertices.The universe of the data structure is the vertex set V , and each super-vertex corresponds to a set in the data structure that consists of the vertices contained in the super-vertex.When we contract two super-vertices, we also union their corresponding sets in the data structure.In addition, we point the representative of a set in the data structure to the vertex that represents the corresponding super-vertex, in the same way as that in constructing the hierarchy tree in Sect.4.2.The last row of Fig. 12 illustrates the disjoint sets, where the representative of a set is shown in bold, e.g., v 6 and v 8 are in the same set in Fig. 12b with v 6 being the representative.

86Our Space-Optimized Algorithms.With the ideas presented above, we first optimize the space usage of KECC by using the adjacency array-based graph representation, as it is an essential procedure used in DC.We denote our spaceoptimized version of KECC as KECC-AA.Note that, with the above implementations of vertex removal and vertex contraction, the input graph to KECC-AA is always represented by pstart and edge which are not changed, although the order of the adjacent edges for each vertex may change.Thus, we do not need to store another copy of the input graph, and the space complexity of KECC-AA is 2m

87With KECC-AA, we are now ready to present our spaceoptimized version of It is worth pointing out that directly replacing KECC with KECC-AA in Algorithm 3 will not achieve our desired space complexity.The main idea is still based on the fact that g 1 and g 2 in Algorithm 3 have disjoint sets of edges.But now, we cannot afford to first construct g 1 and g 2 from g and then release the memory of g, as this will double the intermediate memory consumption.To tackle this issue, we always expand the right child of a node in the recursion tree (see Fig. 7) before expanding the left child.This is based on the observation that, for a non-leaf node in the recursion tree, the graph processed by its right child is always a subgraph of the current graph, while the graph processed by the left child is obtained by contracting each connected component (of the graph of the right child) into a super-vertex in the current graph.Thus, to process the right child, we can directly work on pstart and edges by rearranging the adjacent edges of each vertex and using a local array of size n to bookmark the number of adjacent edges of each vertex in the subgraph.After expanding the right child (and its descendants) and to process the left child, we further create a local copy of sv_next, sv_last and the disjoint-set data structure, which are all of size O(n), to implement the contraction operation.

88The pseudocode of the adjacency array-based implementation of DC is illustrated in Algorithm 5, denoted by DC-AA.It is generally similar to Algorithm 3, with three differences.Firstly, it invokes KECC-AA instead of KECC at Line 10.Secondly, it expands the right child first (Lines 11-13).Thirdly, it interleaves the execution of Algorithm 4 with Construct-DC-AA (Lines 2, 3, 7).The reason of interleaving is that explicitly storing the Steiner connectivities of all edges would increase the space consumption by at least 2m +O(n), and interleaving eliminates the requirement of storing the Steiner connectivities.This interleaving is correct because the right child is always expanded before the left child for each node in the recursion tree (Fig. 7), and thus, the Steiner connectivities are computed in non-increasing order.Note that we also exploit this interleaving to reduce the memory consumption for DC, TDand BUin our experiments.

89The correctness of DC-AA directly follows from the correctness of the discussions in the above two paragraphs, and the time complexity of DC-AA remains the same as DC since our adjacency array-based implementation does not increase the time complexity of vertex removal and contraction.The space complexity of DC-AA becomes 2m +O(n log δ(G)), as it conducts a depth-first traversal of the recursion tree (Fig. 7) and each level of the recursion tree only requires a local data structure of size O(n).

90With the same idea as DC-AA, we can also implement TD and BU by using the adjacency array-based graph representation such that their space complexities become 2m + O(n), while their time complexities remain unchanged.We denote our space-optimized versions of TD and BU by TD-AA and BU-AA, respectively.

A practically efficient approach

91In this section, we propose a simpler and practically efficient approach for ECo-decomposition by optimizing BU-AA.Our empirical studies in Sect.7.1.1(specifically, Fig. 15) show that BU-AA can outperform DC-AA when the degeneracy δ(G) is small (e.g., less than 25 or so), but is outperformed by DC-AA when δ(G) becomes large.The main reason of BU-AA outperforming DC-AA for small δ(G) is that (1) the difference between δ(G) and log δ(G) is small when δ(G) is small and (2) BU-AA is simpler and thus has a smaller constant coefficient in the time complexity analysis.When δ(G) becomes larger, BU-AA is outperformed by DC-AA because BU-AA needs to invoke KECC on G (or more precisely, a contracted version of G) for a large number (i.e., δ(G)) of iterations (see Line 4 of Algorithm 2).We propose a simple optimization technique, called k-core reduction, to improve the efficiency of Line 4 of Algorithm 2 by significantly reducing the graph that is input to KECC when δ(G) is large.The definition of k-core is as follows.

92Definition 3 (k-core [34]) Given a graph G and an integer k, the k-core of G is the maximal subgraph g of G such that the minimum degree of g is at least k.

93Like k-ECC, k-core is also a vertex-induced subgraph.For example, for the graph in Fig. 2, the entire graph is a 3-core, and g 1 as induced by vertices

94A related concept is core number, denoted core(•), where core(u) is the largest k such that u is included in the kcore.For example, for the graph in Fig. 2, the core numbers for {v 1 , v 2 , v 3 , v 4 , v 5 } are 4, while the core numbers for all other vertices are 3.It is known that the k-core is simply

95i.e., the subgraph of G induced by the set of all vertices with core number at least k [9].

96The following lemma claims the relationship between the k-core and k-ECCs of a graph.

Lemma 3 [11] Given a graph G and an integer k, all k-ECCs of G are subgraphs of the k-core of G.

97For example, for the graph in Fig. 2, g 1 ∪ g 2 and g 3 are the two 3-ECCs of the graph and g 1 is the only 4-ECC.

98Following Lemma 3, when computing k-ECCs, it is sufficient to restrict the computation to the k-core of the graph, which could be much smaller than the entire graph.We call this process the k-core reduction.It is worth pointing out that although the k-core reduction has already been utilized in the existing algorithms TD and BU, more specifically in KECC-AA, the full potential of k-core reduction has not been exploited.This is because KECC-AA applies the k-core reduction to reduce its input graph, and although the k-core can be computed in time linear to the number of edges [4,28], the input graph to KECC-AA could be much larger than the k-core.In view of this, we propose to optimize BU-AA by restricting the input of KECC-AA to be the k-core of the input graph, or more precisely a contracted version of the k-core. 5he pseudocode of our optimized BU-AA is shown in Algorithm 6; we denote the optimized version by BU * -AA.The approach is very similar to Algorithm 2, with the only differences at Lines 2-5 and 7-8.Specifically, KECC-AA is now invoked on a subgraph G of G instead of on the entire graph G at Line 8, where G is extracted at Line 7.Moreover, the subgraph G is extracted from G in time that is linear to the number of edges of G , rather than linear to the number of edges of G.This is achieved through Lines 2-4, details of which will be introduced shortly.

99In accordance with Lemma 3, φ k (G ) computed in Algorithm 6 is exactly the same as φ k (G) computed in Algorithm 2 for all possible k values.Thus, the hierarchy tree constructed by invoking BU * -AA is the same as the one constructed by invoking BU-AA.Based on the definition of k-core, the k 1core of a graph must be a subgraph of the k 2 -core of the graph if k 1 ≥ k 2 .Therefore, when k = δ(G), G is the δ(G)core of G, which is typically only a small part of the entire graph.After decrementing k by 1, G is then expanded to the (δ(G) − 1)-core of G.So on so forth, G would finally be expanded to the whole graph when k gets to some smaller number.Nevertheless, along the expansion of G , k-ECCs are contracted into super-vertices, which reduces the size of G and thus the extracted G .Intuitively, KECC-AA would seldom be invoked on an extremely large graph based on the analysis.Hence, BU * -AA is expected to perform much more efficiently compared to BU-AA in practice.However, note that the worst-case time complexity of BU * -AA remains the same as that of BU-AA.

100Example 4 Here, we apply BU * -AA on the graph G in Fig. 2 as an example.Core values for {v 1 , v 2 , v 3 , v 4 , v 5 } are computed as 4, and core values for the other vertices in G are computed as 3; thus, δ(G) is 4. Initially, 13 leaf nodes are created in the hierarchy tree T for the thirteen vertices of G.During the first iteration, G is the 4-core of G, which is equivalent to the subgraph g 1 .It could be found that φ 4 (g 1 ) = g 1 so that an ECC node of weight 4 with five children v 1 , v 2 , v 3 , v 4 , v 5 is added into T .g 1 is contracted into a single super-vertex denoted by s 1 .Then, in the second iteration, G is the entire graph where g 1 contracted into a single super-vertex s 1 ; it could be obtained that φ 3 (G ) = {s 1 ⊕ g 2 , g 3 }.As a result, two ECC nodes of weight 3 are added into T .Similarly, s 1 ⊕ g 2 are contracted into a super-vertex denoted by s 1,2 , and g 3 is contracted into a super-vertex denoted by s 3 .In the third iteration, we have φ 2 (G ) = {s 1,2 ⊕s 3 } given the 2-core of G is G itself.Finally, we obtain the same hierarchy tree as shown in Fig. 3.

101Efficiently Extracting k-core.Recall that Line 8 of Algorithm 6 processes the k-core of a contracted version of G; note that subgraphs are contracted into super-vertices at Line 12.

102To facilitate an efficient extraction of the k-core, we propose to compute the core number core(•) for each vertex of G (Line 2) and reorganize the edges and vertices in the graph representation based on the computed core numbers (Lines 3-4).As a result, the k-core can be extracted in time linear to the size of the k-core (Line 7).

103Recall that the adjacent edges (or neighbors) of a vertex v are stored consecutively in the subarray edges

104. Specifically, this subarray is reorganized in two steps as follows:

1051. Split the subarray into two parts.We first split the subarray into two parts by putting all its neighbors whose core numbers are at least core(v) at the front (referred to as Part1), followed by the other neighbors (referred to as Part2).Note that, in this step, the order within each part is arbitrary.This is achieved by using two pointers p 1 and p 2 which are initialized as pstart [v] and pstart[v + 1] − 1, respectively.Then, as long as core(edges[ p 1 ]) is no less than core(v), we increment p 1 by 1, and as long as core(edges[ p 2 ]) is smaller than core(v), we decrement p 2 by 1. Otherwise, core(edges With vertices and adjacent edges in order, we can extract the k-core in time linear to the size of the k-core regardless of the size of the graph, as follows.The k-core contains all vertices with core number larger than or equal to k, which can be extracted by scanning vertices in non-increasing core number order until a vertex with core number lower than k is encountered.Then, edges of the k-core can be recovered by looking into the neighbors of each extracted vertex.That is, for each extracted vertex u, we scan its neighbors from the beginning until meeting a neighbor with core number lower than k.As all neighbors in Part1 of the neighbors of u are guaranteed to be included in the k-core whenever u is in the k-core, we did not enforce any order for the Part1 neighbors of each vertex when reorganizing the edges.

106Example 5 Figure 13 comes up with a detailed example indicating the intuition of extracting the k-core for different k values with our adjacency array-based graph representation.Two arrays, pstart and edges in Fig. 13b, represent the example graph in Fig. 13a.The array core stores the core number of all vertices as computed by core decomposition on the example graph.The peel array sorts vertices in non-increasing order regarding their core numbers; note that this peel array actually can be directly obtain from the core decomposition, which peels vertices in the reverse order.

107Neighbors in edges are ordered in the correct order according to their core numbers.It is worth pointing out that v 2 can be ahead of v 3 in the edges array within v 1 's neighbors despite that the core number of v 3 is larger than the core number of v 2 , since the core numbers of both vertices are larger than or equal to the core number of v 1 .On the other hand, v 1 , v 2 , and v 7 have to be arranged in descending order according to their core numbers in v 3 's neighbors because their core numbers are smaller than the core number of v 3 .In this case, the 3-core of the graph is composed by vertices and edges marked red.Then, the 2-core of the graph is made up of vertices and edges marked blue, together with the 3-core.Finally, the 1-core is the graph itself, which is green part in addition to the 2-core.

Complexity

108Analysis.Here, we analyze the time complexity of Lines 2-4 and 7 of Algorithm 6, which are the lines added in addition to Algorithm 2. Firstly, Line 2 takes O(m) time by the peeling algorithm [4,28], which iteratively removes the vertex with the minimum degree from the graph.Secondly, Line 3 can be conducted in O(m) time as discussed above.Thirdly, Line 4 can be conducted in O(n) time by bin sort.Lastly, Line 7 can be conducted in time that is linear to the size of the extracted graph G by noting that for each vertex u in G we access at most one of its adjacent edges that is not in G .Thus, the time complexity of Algorithm 6 is the same as that of Algorithm 2, i.e., O(δ(G) × T KECC (G)).Compared with Algorithm 2, the additional computations of Algorithm 6 can be conducted very efficiently, and the input to KECC-AA in Algorithm 6 can be much smaller than that in Algorithm 2; hence, the optimization of Algorithm 6 can bring an enormous improvement in practice.Regarding the space complexity, we note that Algorithm 6 can be implemented to take space 2m +O(n).To achieve this, we do not actually explicitly extract and store the subgraph G at Line 7. Instead, whenever we need to access the neighbors of a vertex u in G , we access the longest prefix of the adjacent edges in edges[ pstart[u], . . ., pstart[u + 1] − 1] such that the core numbers of the end-points are at least k.

Experiments

109In this section, we conduct extensive performance studies to evaluate the efficiency and effectiveness of our techniques.Specifically, we evaluate the following ECo-decomposition algorithms:

110• TD (Algorithm 1): the existing top-down approach proposed in [7] that uses the doubly linked list-based graph representation.• BU (Algorithm 2): an adaptation of the existing bottomup approach proposed in [42] that uses the doubly linked list-based graph representation.• DC (Algorithm 3): our near-optimal approach (Algorithm 3) that uses the doubly linked list-based graph representation and has a space complexity of O(m + n log δ(G)).• TD-AA, BU-AA, and DC-AA: space-optimized versions of TD, BU and DC by using the adjacency array-based graph representation (Sect.5.2).• BU * -AA (Algorithm 6): our core optimized version of BU-AA.

111In addition, we also evaluate two k-ECC computation algorithms:

112• KECC: the state-of-the-art algorithm proposed in [11] that uses the doubly linked list-based graph representation.• KECC-AA: our space-optimized version of KECC that uses the adjacency array-based graph representation (Sect.5.2).

113The source code of our algorithms is available at https:// lijunchang.github.io/ECo-Decompose/.All algorithms are implemented in C++ and compiled with GNU GCC with the -O3 optimization.All experiments are conducted on a machine with Intel(R) Xeon(R) 3.6GHz CPU and 128 GB memory running Ubuntu.We evaluate the performance of all algorithms on both real and synthetic graphs as follows.

114Real Graphs.We evaluate the algorithms on fourteen real graphs from different domains, which are downloaded from the Stanford Network Analysis Platform6 and the Laboratory of Web Algorithmics . 7Statistics of the graphs are shown in Table 1, where the second last column and the last column, respectively, show the average degree and the degeneracy.The graphs are ranked regarding their numbers of edges.We denote the graphs by D1, . .., D14.Synthetic Graphs.We also evaluate the algorithms on two kinds of synthetic graphs that are generated by the graph generator GTGraph . 8 Power-law graphs: A power-law graph is a random graph in which edges are randomly added such that the degree distribution follows a power-law distribution.• SSCA graphs: An SSCA graph contains a collection of randomly sized cliques and also random inter-clique edges.

115Firstly, we generate 14 power-law graphs, PL1, . .., PL14, where the number of vertices varies from 16 thousand to 133 million with an increasing factor of 2. The average degree of the power-law graphs is around 24.5; as a result, the number of undirected edges of the power-law graphs varies from 198 thousand to 1.6 billion.The degeneracy of these graphs varies from 18 to 25.

116Secondly, we further generate six power-law graphs fixing the number of vertices to be the same as PL7 (i.e., around one million), PL7_1, . .., PL7_6, where the number of edges Thirdly, we generate 12 SSCA graphs, SSCA1, . .., SSCA12, where the number of vertices varies from 4 thousand to 8 million with an increasing factor of 2. The average degree of the SSCA graphs varies from 12 to 135, and the number of undirected edges varies from 24 thousand to 567 million.The degeneracy of the SSCA graphs varies from 15 to 202.

117Evaluation Metrics.For all the evaluations, we record both the processing time and the peak main-memory usage.Each testing is run three times, and the average results are reported.All algorithms are run in main memory and use a single thread.For the reported processing time, we exclude the I/O time that is used for loading a graph from disk to main memory.The peak memory usage of a program is recorded by /usr/bin/time . 9

Results for ECo-decomposition

118We first compare DC-AA with the existing algorithms in Sect.7.1.1 and then compare BU * -AA with DC-AA in Sect.7.1.2.

Comparing DC-AA with existing algorithms

119In this subsection, we evaluate the six ECo-decomposition algorithms, TD, BU, DC, TD-AA, BU-AA, and DC-AA, regarding their processing time and main-memory usage. 9https://man7.org/linux/man-pages/man1/time.1.html.

120Results on Real Graphs.We first evaluate the algorithms on real graphs.The results are illustrated in Fig. 14.For better comparison, we separate the algorithms into two groups: linked list-based algorithms (i.e., TD, BU, and DC), and spaceoptimized algorithms (i.e., TD-AA, BU-AA, and DC-AA).The processing time of the three linked list-based algorithms is illustrated in Fig. 14a.We can see that our near-optimal approach DC consistently runs faster than the two stateof-the-art approaches TD and BU, which is inline with our theoretical analysis that the former has a lower time complexity than the latter two.However, all the three algorithms fail to process the two billion-scale graphs D13 and D14, due to running out-of-memory.On the other hand, our space-optimized algorithms are able to process these billion-scale graphs as shown in Fig. 14b, due to their reduced main-memory usage.The overall trend is similar to their counterparts in Fig. 14a, i.e., DC-AA consistently performs the best.When comparing the top-down approach TD-AA with the bottomup approach BU-AA, there is no clear winner despite of having the same time complexity, as their practical performance is sensitive to the graph topology.For example, the processing time of TD-AA, BU-AA, and DC-AA on D13 is, respectively, 13.9hrs, 36.8hrs, and 1.3hrs, while that on D14 is, respectively, 29.4hrs, 13.3hrs, and 3.3hrs.

121The main-memory usage of the six algorithms is demonstrated in Fig. 14c.It is evident that our space-optimized algorithms (TD-AA, BU-AA, DC-AA) consume much less memory than the linked list-based algorithms (TD, BU, DC), where TD and BU are the two state-of-the-art approaches.For example, the peak memory usage of our space-optimized algorithms is at most 15 GB for D13 and is at most 24 GB for D14, while the linked list-based algorithms run out-ofmemory even with 128 GB memory.There are three things worth mentioning for Fig. 14c.Firstly, it appears that TD consumes more memory than DC.This is due to implementation differences, i.e., we used the original implementation of TD from [7] while our implementations of BU and DC slightly optimized the constant on m in the space complexity.We do not optimize the code of TD, as linked list-based implementations, which are outperformed by their space-optimized counterparts, are not our main focus.Secondly, the linked list-based algorithm consume more memory on D13 than on D12, while for our space-optimized algorithms, the situation is the opposite.This is because (1) D13 has more edges but less vertices than D12, (2) the memory usage of linked listbased algorithms is mainly dominated by the part on m in the space complexity, while the memory usage of our spaceoptimized algorithms is also affected by the part on n.This is also observed for k-ECC computation algorithms in Fig. 19b.Thirdly, DC-AA always consumes a little bit more memory than TD-AA and BU-AA, which is due to the log δ(G) factor on n in the space complexity of DC-AA.Nevertheless, the gap is minor given that m dominates O(n log δ(G)) for typical graphs.

122Results on Synthetic Graphs.The processing time and memory usage of the six algorithms on synthetic graphs are shown in Fig. 15.The overall trend is similar to that on real graphs in Fig. 14.That is, our divide-and-conquer algorithms DC and DC-AA run the fastest, and our space-optimized algorithms consume much less memory than the linked list-based algorithms, e.g., the latter run out-of-memory on PL14 which has 1.6 billion undirected edges.It is interesting to observe that our space-optimized bottom-up approach BU-AA also perform quite well on power-law graphs that have small degeneracy (i.e., at most 25), see Fig. 15a.The results on power-law graphs by varying m and fixing n are shown in Fig. 15b, e; note that the degeneracy of these graphs also Fig. 16 Comparing BU * -AA with DC-AA on real graphs increases with m.We can see that BU-AA now runs slower than DC-AA when the degeneracy becomes large, e.g., the degeneracy of PL7_5 and PL7_6 are 705 and 1, 380, respectively.The processing time and usage of the six ECo-decomposition algorithms on SSCA graphs are, respectively, in Fig. 15c, f, which have similar trends as on the graphs that vary m while fixing n.This is because SSCA graphs as as these power-law graphs have large degeneracy, e.g., the degeneracy of SSCA12 is 202.From Fig. 15, we can also observe that DC-AA scales almost linearly to large graphs for both the processing time and the memory usage.

Comparing BU * -AA with DC-AA

123In this subsection, we compare the efficiency of our simpler approach BU * -AA with the near-optimal approach DC-AA.The results on real graphs are illustrated in Fig. 16a.We can see that BU * -AA consistently runs faster than DC-AA.For example, the processing time of BU * -AA on D13 and D14 is, respectively, 29 min and 1.5hrs, while the processing time of DC-AA on D13 and D14 is, respectively, 78 min and 3.3hrs.Recall that BU * -AA is optimized upon BU-AA by k-core reduction, and BU-AA runs much slower than DC-AA (e.g., on D13) as shown in Fig. 14.This demonstrates that our k-core reduction significantly improves the efficiency of BU-AA.To get more insights, we also show the size of the graph that is input to KECC by BU * -AA and BU-AA, for different k values.The results on ca-CondMat and soc-Epinions1 are reported in Fig. 17.We can see that the input graph to KECC by BU * -AA is significantly smaller than that by BU-AA, especially for large k values; note that, for k = 1, they are the same, as one would expect.This demonstrates the effectiveness of our k-core reduction in BU * -AA.

124The memory usage of BU * -AA and DC-AA on real graphs is shown in Fig. 16b.We can see that BU * -AA uses slightly less memory than DC-AA, though the improvement is not significant; this conforms with out theoretical analysis that the space complexity of BU * -AA is 2m + O(n), while the space complexity of DC-AA is 2m + O(n log n).The processing time and memory usage of BU * -AA and DC-AA on synthetic graphs are reported in Fig. 18.The results are similar to that in Fig. 16 for real graphs.That is, BU * -AA runs faster and uses less memory than DC-AA.

Results for k-ECC computation

125In this subsection, we evaluate our space-optimized algorithm KECC-AA for k-ECC computation.We first compare KECC-AA with the linked list-based counterpart KECC that is proposed in [11].The results on real graphs for k = 8 are shown in Fig. 19.We can observe that KECC-AA significantly reduces the memory usage compared with KECC.For example, KECC consumes 78 GB and 119 GB memory, respectively, for processing D13 and D14, while KECC-AA only consumes 11 GB and 17 GB memory for these two graphs.It is also interesting to see that KECC-AA is slightly We also compare KECC-AA with the k-ECC computation algorithm in NetworkX, a popular Python module for graph analytics.The results on the two smallest real graphs D1 and D2 for k = 8 are shown in Table 2; we do not test Net-workX on larger graphs as it is too slow.We can see that KECC-AA significantly outperforms NetworkX for k-ECC computation, e.g., on D2, KECC-AA is more than 60, 000 times faster and consumes 32 times less memory than Net-workX.Although there are factors of programming language difference (i.e., C++ vs. Python), it is clear that KECC-AA has significant advantages over the implementation in Net-workX.It will be an interesting future work to implement KECC-AA in NetworkX.

Applications

126In this subsection, we illustrate applying our ECodecomposition algorithms in applications.Firstly, our algorithms directly speed up the index construction for steiner component search studied in [7,25], which use the hierarchy tree as an index structure for efficiently processing online queries.Secondly, our algorithms can facilitate matrix completability analysis, where matrix completion is typically used for recommendation [14].Specifically, a matrix can be represented as a bipartite graph G = (U ∪ L, E) with U ∩ L = ∅ and E ⊆ U × L. Each row of the matrix corresponds to a vertex of U , each column corresponds to a vertex of L, and each non-zero entry at position (i, j) corresponds to an undirected edge between i ∈ U and j ∈ L. The problem of matrix completion is to predicate values for the entries of the matrix that currently have value 0 (i.e., with value missing).It has been shown in [14] that the higher the edge connectivity of the corresponding bipartite graph, the more accurate the low-rank matrix completion.Thus, the higher the value of k such that i and j are contained in the same k-ECC, the more accurate the predicated value of the (i, j)th entry of the matrix.The hierarchy tree constructed by our algorithms can be used to efficiently obtain the largest k such that i and j are contained in the same k-ECC and thus to estimate the accuracy of the matrix completion for the (i, j)th entry.Also, the hierarchy tree can be used to efficiently retrieve the submatrices, whose corresponding bipartite graphs are k-edge connected, to run the matrix completion algorithm and can be used to provide a guide on choosing the appropriate k.For example, Fig. 20a, b shows the total size of the submatrices whose corresponding bipartite graphs are k-edge connected, for datasets Netflix and Amazon_reviews; here, the size of a submatrix is #rows × #columns.We can see that Netflix is much denser than Amazon_reviews and can be completed more accurately than Amazon_reviews.In particular, the total size of the submatrices whose corresponding bipartite graphs are 200-edge connected is more than 10% of the entire matrix size for Netflix, while there is no such submatrix for Amazon_reviews.

12710 https://www.kaggle.com/netflix-inc/netflix-prize-data.

12811 http://snap.stanford.edu/data/web-Amazon-links.html.

Related work

129Besides the existing works on ECo-decomposition as discussed in Sects. 1 and 3, we categorize other related works as follows.k-ECC Computation.In the literature, there are three approaches for computing all k-ECCs of a graph for a given k: cutbased approach [31,40,43], decomposition-based approach [11], and randomized approach [3].In this paper, we adopted the decomposition-based approach [11] for k-ECC computation-which is the state of the art-and further optimized its memory usage.

Edge Connectivity Computation.

130Computing the edge connectivity between two vertices has been studied in graph theory [21], which is achieved by maximum flow techniques [17].The state-of-the-art algorithms compute the maximum flow exactly in O(n × m) time [30] and approximately in almost linear time [26,35].Index structures have also been developed to efficiently process vertex-to-vertex edge connectivity queries [1,23].However, steiner connectivity as computed in this paper, which measures the connectivity in a subgraph, is different from edge connectivity as computed in [1,23], which measures the connectivity in the input graph.Thus, these techniques cannot be applied.Moreover, it is worth mentioning that none of our algorithms involve maximum flow computation.

131Cohesive Subgraph Computation.Extracting cohesive subgraphs from a large graph has also been extensively studied in the literature (see [9] for a recent survey).Here, the cohesiveness of a subgraph usually is measured by the minimum degree (aka, k-core) [34], the average degree (aka, edge density) [8,12,22], the minimum number of triangles each edge participates in (aka, k-truss) [16,32], and the vertex connectivity [38].For some of the measures, the cohesive subgraphs for different cohesiveness values also form hierarchical structures and efficient algorithms have been proposed to construct these hierarchical structures, e.g., core decomposition [15], truss decomposition and its higher-order variants [33], and density-friendly graph decomposition [18,37].However, due to inherently different problem natures, these techniques are inapplicable to computing ECo-decomposition of a graph.

132Community Search.The problem of community search, which aims to find a densely connected subgraph containing user-given query vertices, has received a lot of attention recently.Edge connectivity is used as one of the density measures [7,24,25]; the techniques proposed in this paper can be used to speed up their index construction.Other density measures include minimum degree, average degree, minimum number of triangles each edge participates in, etc.A comprehensive survey of community search with respect to the different density measures can be found in [19].Modularity, the classic density measure that was originally designed for partitioning a graph into communities (referred to as the community detection problem in the literature) was recently extended to the community search problem [27].Efficient techniques have been proposed in [41] for finding a good community whose number of vertices falls in a user-given range.With the success of deep learning in many domains, graph neural networks have also been recently used for solving the community search problem [13].

Conclusion

133In this paper, we proposed a near-optimal algorithm DC-AA for constructing the hierarchy tree of k-ECCs for all possible k values.DC-AA has both a lower time complexity and a lower space complexity compared with the state-of-the-art approaches TD and BU.Extensive experimental results on large graphs demonstrate that DC-AA outperforms TD and BU by up to 28 times in terms of running time and by up to 8 times regarding memory usage.As a result, DC-AA makes it possible to process billion-scale graphs in the main memory of a commodity machine.As a by-product, we also significantly reduced the memory usage of the state-of-the-art k-ECC computation algorithm.Moreover, we also proposed a simpler algorithm BU * -AA that is much easier to implement and runs faster than DC-AA in practice.

Algorithm 1 :

134TD(G)

Algorithm 2 :

135BU(G)

Fig. 5 Fig. 6

136Fig. 5 Steiner connectivities

Fig. 7

137Fig. 7 Recursion tree

2 and

138prove in the following theorem that the time complexity of Algorithm 3 then becomes O (log δ(G)) × T KECC (G) .Theorem 3 By setting M = L+H 2 , the time complexity of Algorithm 3 is O (log δ(G)) × T KECC (G) .

Fig. 8

139Fig. 8 Running example of DC

140indicates the whole running process of DC on G, where the top-most part is G itself.The degeneracy is δ(G) = 4.Then, we compute the Steiner connectivities of all edges of G by invoking Compute-DC with input G and [L, H ] = [1, 4].Here, GS 4 1 (G) is the same as G.As L = H and L+H 2 = 3, we compute the 3-ECCs of G and obtain the subgraphs induced by S 1 = {v

Fig. 9

141Fig. 9 Doubly linked list-based graph representation

Fig. 10

142Fig. 10 Adjacency array-based graph representation

Algorithm 5 :1 7 Execute 10 φ

143DC-AA(G) Compute the degeneracy δ(G) of G; 2 Execute Lines 1-2 of Algorithm 4; 3 Construct-DC-AA(G, 1, δ(G)); 4 return T ; Procedure Construct-DC-AA(g, L, H ) 5 if L = H then 6 foreach edge (u, v) ∈ E(g) do Lines 4-11 of Algorithm 4 with sc(u, v) equal to L; M (g) ← KECC-AA(g, M); 11 foreach connected subgraph g ∈ φ M (g) do 12 Construct-DC-AA(g , M, H ); 13 Contract g into a super-vertex in g; 14 Construct-DC-AA(g, L, M − 1);

2 .

144and core(edges[ p 2 ]) ≥ core(v); we swap edges[ p 1 ] with edges[ p 2 ].This process terminates when the two pointers meet each other.In this case, edges[ pstart[v], . . ., p 1 − 1] is Part1 and edges[ p 1 , . . ., pstart[v+1]−1] is Part2.Sort the neighbors in Part2 into non-increasing order regarding their core numbers.We achieve this by using bin sort.Let deg(v) be the degree of v in G.It is easy to see that the time complexity of Step 1 is O(deg(v)) and the time complexity of Step 2 is O(deg(v)+core(v)) = O(deg(v)); note that for the bucket sort in Step 2, the maximum key value is core(v).Thus, the overall time complexity of organizing the adjacent edges of all vertices is O( v∈V deg(v)) = O(m).

Fig. 13 k

145Fig. 13 k-core extraction on an example graph

Fig.Fig. 15

146Fig. Comparing DC-AA with existing algorithms on real graphs (best viewed in color)

Fig. 17

147Fig.17 The size of the input graph to KECC by BU * -AA and BU-AA

Fig. 18

148Fig.18 Comparing BU * -AA with DC-AA on synthetic graphs

149Netflix 10 has |U | = 480,189, |L| = 17,770, |E| = 100,480,507, k max = 1, 076, and Amazon_reviews 11 has |U | = 6,643,669, |L| = 2,441,053, |E| = 29,928,296, k max = 140.

1

150Create the root ECC node r of T with weight 1;

151Create one leaf node in T for each vertex of G; 2 Compute an upper bound k max (G) of the largest k such that G has a non-empty k-ECC;

152Create a new ECC node in T with weight sc(u, v), and add r u and r v as its children;Without loss of generality, assume r u is an ECC node with weight sc(u, v), and add r v as a child of r u in T ; as shown in right part of the middle layer of Fig.8.We compute the 4-ECCs of GS43 (G) and obtain the subgraph induced by vertices {v 1 , v 2 , ..., v 5 }.Thus, all edges among vertices {v 1 , v 2 , ..., v 5 } have Steiner connectivities 4 as indicated in is obtained by contracting each of S 1 and S 2 into a super-vertex as shown in the left part of the middle layer of Fig.8.In GS 2 1 (G), there are two parallel edges between s 1 and s 2 , corresponding to edges (v 9 , v 11 ) and (v 5 , v 12 ).As GS 2 1 (G) is 2-edge connected, the Steinerconnectivities of (v 9 , v 11 ) and (v 5 , v 12 ) are 2.

1531 , v 2 , . . ., v 9 } and S 2 = {v 10 , . . ., v 13 }, respectively.Thus, we obtain the two graphs GS 2 1 (G) and GS 4 3 (G) as shown in the middle layer of Algorithm 4: ConstructHierarchy Input: A graph G with sc(u, v) for each edge (u, v) Output: The hierarchy tree of ECo-decomposition of G 1 Initialize an empty hierarchy tree T ; 2 foreach vertex u ∈ V (G) do Insert a singleton node u into T ; 3 foreach edge (u, v) ∈ E(G) in non-increasing sc(u, v) order do 4 Let r u (resp r v ) be the root of the tree in T containing u (resp v); 5 if r u = r v then continue; 6 else if both r u and r v are ECC nodes with weight sc(u, v) then 7 Merge r u and r v into a single ECC node; 8 else if none of r u or r v is an ECC node with weight sc(u, v) then 9 Fig. 8.The computation continues on these two graphs with intervals [1, 2] and [3, 4], respectively.The graph GS 4 3 (G) is composed of the two 3-ECCs of G

Table 2

154Compare KECC-AA with NetworkX (k = 8)

참고문헌 34건

  1. Greedy Approximation Algorithms for Finding Dense Components in a Graph Lecture notes in computer science · Springer Science+Business Media · 2000 10.1007/3-540-44436-x_10
  2. Index-based Optimal Algorithms for Computing Steiner Components with Maximum Connectivity 2015 10.1145/2723372.2746486
  3. Max flows in O(nm) time, or better 2013 10.1145/2488608.2488705
  4. The Cohesiveness of Blocks In Social Networks: Node Connectivity and Conditional Density Sociological Methodology · SAGE Publishing · 2001 10.1111/0081-1750.00098
  5. A general framework for graph sparsification 2011 10.1145/1993636.1993647
  6. Mining closed relational graphs with connectivity constraints 2005 10.1145/1081870.1081908
  7. Mining newsgroups using networks arising from social behavior 2003 10.1145/775152.775227
  8. Smallest-last ordering and clustering and graph coloring algorithms Journal of the ACM · Association for Computing Machinery · 1983 10.1145/2402.322385
  9. Linear-time enumeration of maximal K-edge-connected subgraphs in large networks by random contraction 2013 10.1145/2505515.2505751
  10. Nearly Maximum Flows in Nearly Linear Time 2013 10.1109/focs.2013.36
  11. Multi-Terminal Network Flows Journal of the Society for Industrial and Applied Mathematics · Society for Industrial and Applied Mathematics · 1961 10.1137/0109047
  12. SkyGraph: an algorithm for important subgraph discovery in relational graphs Data Mining and Knowledge Discovery · Springer Science+Business Media · 2008 10.1007/s10618-008-0109-y
  13. Efficient core decomposition in massive networks 2011 10.1109/icde.2011.5767911
  14. Efficiently computing k-edge connected components via graph decomposition 2013 10.1145/2463676.2465323
  15. Finding maximal k-edge-connected subgraphs from a large graph 2012 10.1145/2247596.2247652
  16. Network structure and minimum degree Social Networks · Elsevier BV · 1983 10.1016/0378-8733(83)90028-x
  17. A model of Internet topology using <i>k</i> -shell decomposition Proceedings of the National Academy of Sciences · National Academy of Sciences · 2007 10.1073/pnas.0701175104
  18. Extracting Communities from Complex Networks by the k-dense Method 2006 10.1109/icdmw.2006.76
  19. An Almost-Linear-Time Algorithm for Approximate Max Flow in Undirected Graphs, and its Multicommodity Generalizations 2013 10.1137/1.9781611973402.16
  20. Querying Minimal Steiner Maximum-Connected Subgraphs in Large Graphs 2016 10.1145/2983323.2983748
  21. ALGORITHMIC GRAPH THEORY Bulletin of the London Mathematical Society · Wiley · 1986 10.1112/blms/18.6.630
  22. Enumerating k-Vertex Connected Components in Large Graphs 2022 IEEE 38th International Conference on Data Engineering (ICDE) · 2019 10.1109/icde.2019.00014
  23. Large Scale Density-friendly Graph Decomposition via Convex Programming 2017 10.1145/3038912.3052619
  24. On Minimal Steiner Maximum-Connected Subgraph Queries IEEE Transactions on Knowledge and Data Engineering · IEEE Computer Society · 2017 10.1109/tkde.2017.2730873
  25. A survey of community search over big graphs The VLDB Journal · Springer Science+Business Media · 2019 10.1007/s00778-019-00556-x
  26. Deconstruct Densest Subgraphs 2020 10.1145/3366423.3380033
  27. KClist++ Proceedings of the VLDB Endowment · Association for Computing Machinery · 2020 10.14778/3401960.3401962
  28. I/O efficient ECC graph decomposition via graph reduction The VLDB Journal · Springer Science+Business Media · 2016 10.1007/s00778-016-0451-4
  29. Efficient size-bounded community search over large networks Proceedings of the VLDB Endowment · Association for Computing Machinery · 2021 10.14778/3457390.3457407
  30. DMCS : Density Modularity based Community Search Proceedings of the 2022 International Conference on Management of Data · 2022 10.1145/3514221.3526137
  31. Introduction to Algorithms Undergraduate topics in computer science · 2020 10.1007/978-3-030-34209-8_4
  32. Cohesive Subgraph Computation over Large Sparse Graphs Springer series in the data sciences · Springer International Publishing · 2018 10.1007/978-3-030-03599-0
  33. A near-optimal approach to edge connectivity-based hierarchical graph decomposition Proceedings of the VLDB Endowment · Association for Computing Machinery · 2022 10.14778/3514061.3514063
  34. ICS-GNN$$^+$$: lightweight interactive community search via graph neural network The VLDB Journal · Springer Science+Business Media · 2022 10.1007/s00778-022-00754-0