Parallel Batch-Dynamic K-Clique Counting

Parallel Batch-Dynamic K-Clique Counting

Parallel Batch-Dynamic k-Clique Counting Laxman Dhulipala Quanquan C. Liu Julian Shun Shangdi Yu MIT CSAIL MIT CSAIL MIT CSAIL MIT CSAIL [email protected] [email protected] [email protected] [email protected] Abstract dynamic algorithms. A k-clique consists of k vertices and all k In this paper, we study new batch-dynamic algorithms 2 possible edges among them (for applications of k-cliques, for the k-clique counting problem, which are dynamic algo- see, e.g., [HR05]). As many real-world graphs change rapidly rithms where the updates are batches of edge insertions and in real-time, it is crucial to design dynamic algorithms that deletions. We study this problem in the parallel setting, where efficiently maintain k-cliques upon updates, since the cost of the goal is to obtain algorithms with low (polylogarithmic) re-computation from scratch can be prohibitive. Furthermore, due to the fact that dynamic updates can occur at a rapid depth. Our first result is a newp parallel batch-dynamic triangle counting algorithm with O(∆ ∆ + m) amortized work and rate in practice, it is increasingly important to design batch- O(log∗(∆ + m)) depth with high probability, and O(∆ + m) dynamic algorithms which can take arbitrarily large batches space for a batch of ∆ edge insertions or deletions. Our sec- of updates (edge insertions or deletions) as their input. Finally, ond result is an algebraic algorithm based on parallel fast since the batches, and corresponding update complexity can matrix multiplication. Assuming that a parallel fast matrix be large, it is also desirable to use parallelism to speed- multiplication algorithm exists with parallel matrix multiplica- up maintenance and design algorithms that map to modern tion constant !p, the same algorithm solves dynamic k-clique parallel architectures. (2k−1)!p 2(k+1)!p Due to the broad applicability of k-clique counting in 3(! +1) 3(! +1) counting with O min ∆m p ; (∆ + m) p practice and the fact that k-clique counting is a fundamental amortized work and O(log(∆ + m)) depth with high prob- theoretical problem of its own right, there has been a large 2(k+1)!p body of prior work on the problem. Theoretically, the fastest 3(! +1) ability, and O (∆ + m) p space. Using a recently static algorithm for arbitrary graphs uses fast matrix multipli- developed parallel k-clique counting algorithm, we also ob- cation, and counts 3` cliques in O(n`!) time where ! is the tain a simple batch-dynamic algorithm for k-clique counting matrix multiplication exponent [NP85]. Considerable effort on graphs with arboricity α running in O(∆(m + ∆)αk−4) has also been devoted to efficient combinatorial algorithms. expected work and O(logk−2 n) depth with high probabil- Chiba and Nishizeki [CN85] show how to compute k-cliques ity, and O(m + ∆) space. Finally, we present a multicore in O(αk−2m) work, where m is the number of edges in the CPU implementation of our parallel batch-dynamic triangle graph and α is the arboricity of the graph. This algorithm was counting algorithm. On a 72-core machine with two-way recently parallelized by Danisch et al. [DBS18a] (although hyper-threading, our implementation achieves 36.54–74.73x not in polylogarithmic depth). Worst-case optimal join al- parallel speedup, and in certain cases achieves significant gorithms can perform k-clique counting in O(mk=2) work speedups over existing parallel algorithms for the problem, as a special case [NPRR18, ALT+17]. Alon, Yuster, and which are not theoretically-efficient. Zwick [AYZ97] design an algorithm for triangle counting 1 Introduction in the sequential model, based on fast matrix multiplication. Eisenbrand and Grandoni [EG04] then extend this result to Subgraph counting algorithms are fundamental graph k-clique counting based on fast matrix multiplication. Vas- analysis tools, with numerous applications in network clas- silevska designs a space-efficient combinatorial algorithm sification in domains including social network analysis and for k-clique counting [Vas09]. Finocchi et al. give clique bioinformatics. A particularly important type of subgraph counting algorithms for MapReduce [FFF15]. Jain and Se- for these applications is the triangle, or 3-clique—three ver- shadri provide probabilistic algorithms for estimating clique tices that are all mutually connected [New03]. Counting counts [JS17]. The k-clique problem is also a classical prob- the number of triangles is a basic and fundamental task that lem in parameterized-complexity, and is known to be W [1]- is used in numerous social and network science measure- complete [DF95]. ments [Gra77, WS98]. The problem of maintaining k-cliques under dynamic In this paper, we study the triangle counting problem and updates began more recently. Eppstein et al. [ES09, EGST12] its generalization to higher cliques from the perspective of Copyright c 2021 by SIAM Copyright for this paper is retained by authors. design sequential dynamic algorithms for maintaining size- dynamic algorithms that admit strong theoretical bounds 3 subgraphs in O(h) amortized time and O(mh) space and on their work and have polylogarithmic depth with high 2 2 size-4 subgraphs in O(h ) amortized time andpO(mh ) space, probability. Note that although our work bounds may be where h is the h-index of the graph (h = O( m)). Ammar amortized, our depth will be polylogarithmic with high et al. extend the worst-case optimal join algorithms to the probability, leading to efficient RNC algorithms. As a special parallel and dynamic setting [AMSJ18]. However, their case of our results, we obtain algorithms for parallelizing update time is not better than the static worst-case optimal single updates (∆ = 1). We first design a parallel batch- join algorithm. Recently, Kara et al. [KNN+19] present dynamic triangle counting algorithm based on the sequential + a sequentialp dynamic algorithm for maintaining triangles algorithm of Kara et al. [KNN 19]. Forp triangle counting, in O( m) amortized time and O(m) space. Dvorak and we obtain an algorithm that takes O(∆ ∆ + m) amortized Tuma [DT13] present a dynamic algorithm that maintains work and O(log∗(∆ + m)) depth w.h.p.1 assuming a fetch- k-cliques as a special case in O(αk−2 log n) amortized time and-add instruction that runs in O(1) work and depth, and and O(αk−2m) space by using low out-degree orientations runs in O(∆ + m) space. The work of our parallel algorithm for graphs with arboricity α. matches that of the sequential algorithm of performing one Designing Parallel Batch-Dynamic Algorithms. Tradi- update at a time (i.e., it is work-efficient), and we can perform tional dynamic algorithms receive and apply updates one all updates in parallel with low depth. at a time. However, in the parallel batch-dynamic setting, We then present a new parallel batch-dynamic algorithm the algorithm receives batches of updates one after the other, based on fast matrix multiplication. Using the best currently where each batch contains a mix of edge insertions and dele- known parallel matrix multiplication [Wil12, LG14], our tions. Unlike traditional dynamic algorithms, a parallel batch- algorithm dynamically maintains the number of k-cliques 0:469k−0:235 0:469k+0:469 dynamic algorithm can apply all of the updates together, and in O min ∆m ; (∆ + m) amor- also take advantage of parallelism while processing the batch. tized work w.h.p. per batch of ∆ updates where m is de- We note that the edges inside of a batch may also be ordered fined as the maximum number of edges in the graph be- (e.g., by a timestamp). If there are duplicate edge insertions fore and after all updates in the batch are applied. Our ap- within a batch, or an insertion of an edge followed by its proach is based on the algorithm of [AYZ97, EG04, NP85], deletion, a batch-dynamic algorithm can easily remove such and maintains triples of k=3-cliques that together form k- redundant or nullifying updates. cliques. The depth is O(log(∆ + m)) w.h.p. and the space 0:469k+0:469 The key challenge is to design the algorithm so that up- is O (∆ + m) . Our results also imply an amor- 0:469k−0:235 dates can be processed in parallel while ensuring low work tized time bound of O m per update for dense and depth bounds. The only existing parallel batch-dynamic graphs in the sequential setting. Of potential independent algorithms for k-clique counting are triangle counting algo- interest, we present the first proof of logarithmic depth in the rithms by Ediger et al. [EJRB10] and Makkar et al. [MBG17], parallelization of any tensor-based fast matrix multiplication which take linear work per update in the worst case. The algo- algorithms. We also give a simple batch-dynamic k-clique rithms in this paper make use of efficient data structures such listing algorithm, based on enumerating smaller cliques and as parallel hash tables, which let us perform parallel batches intersecting them with edges in the batch. The algorithm runs k−2 of edge insertions and deletions with better work and (poly- in O(∆(m + ∆)αk−4) expected work, O(log n) depth logarithmic) depth bounds. To the best of our knowledge, no w.h.p., and O(m + ∆) space. prior work has designed dynamic algorithms for the problem Finally, we implement our new parallel batch-dynamic that support parallel batch updates with non-trivial theoretical triangle counting algorithm for multicore CPUs, and present guarantees. some experimental results on large graphs and with varying Theoretically-efficient parallel dynamic (and batch- batch sizes using a 72-core machine with two-way hyper- dynamic) algorithms have been designed for a variety threading.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    15 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us