WADS 2015: Algorithms and Data Structures pp 470-481 | Cite as
Dynamic Set Intersection
Abstract
Consider the problem of maintaining a family F of dynamic sets subject to insertions, deletions, and set-intersection reporting queries: given \(S,S'\in F\), report every member of \(S\cap S'\) in any order. We show that in the word RAM model, where w is the word size, given a cap d on the maximum size of any set, we can support set intersection queries in \(O(\frac{d}{w/\log ^2 w})\) expected time, and updates in O(1) expected time. Using this algorithm we can list all t triangles of a graph \(G=(V,E)\) in \(O(m+\frac{m\alpha }{w/\log ^2 w} +t)\) expected time, where \(m=|E|\) and \(\alpha \) is the arboricity of G. This improves a 30-year old triangle enumeration algorithm of Chiba and Nishizeki running in \(O(m \alpha )\) time.
We provide an incremental data structure on F that supports intersection witness queries, where we only need to find one \(e\in S\cap S'\). Both queries and insertions take \(O\left( {\sqrt{\frac{N}{w/\log ^2 w}}}\right) \) expected time, where \(N=\sum _{S\in F} |S|\). Finally, we provide time/space tradeoffs for the fully dynamic set intersection reporting problem. Using M words of space, each update costs \(O(\sqrt{M \log N})\) expected time, each reporting query costs \(O(\frac{N\sqrt{\log N}}{\sqrt{M}}\sqrt{op+1})\) expected time where op is the size of the output, and each witness query costs \(O(\frac{N\sqrt{\log N}}{\sqrt{M}} + \log N)\) expected time.
Keywords
Hash Function Lookup Table Expected Time Query Cost Fast Matrix MultiplicationPreview
Unable to display preview. Download preview PDF.
References
- 1.Kopelowitz, T., Pettie, S., Porat, E.: Dynamic set intersection (2014). CoRR abs/1407.6755v2Google Scholar
- 2.Masek, W.J., Paterson, M.: A faster algorithm computing string edit distances. J. Comput. Syst. Sci. 20(1), 18–31 (1980)MathSciNetCrossRefMATHGoogle Scholar
- 3.Myers, G.: A Four Russians algorithm for regular expression pattern matching. J. ACM 39(2), 432–448 (1992)CrossRefGoogle Scholar
- 4.Chan, T.M.: More algorithms for all-pairs shortest paths in weighted graphs. SIAM J. Comput. 39(5), 2075–2089 (2010)MathSciNetCrossRefMATHGoogle Scholar
- 5.Chan, T.M.: All-pairs shortest paths for unweighted undirected graphs in \(o(mn)\) time. ACM Transactions on Algorithms 8(4), 34 (2012)MathSciNetCrossRefGoogle Scholar
- 6.Chan, T.M.: All-pairs shortest paths with real weights in \(o(n^3/\log n)\) time. Algorithmica 50(2), 236–243 (2008)MathSciNetCrossRefMATHGoogle Scholar
- 7.Buchin, K., Buchin, M., Meulemans, W., Mulzer, W.: Four soviets walk the dog - with an application to Alt’s conjecture. In: Proceedings 25th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 1399–1413 (2014)Google Scholar
- 8.Baran, I., Demaine, E.D., Pǎtraşcu, M.: Subquadratic algorithms for 3SUM. Algorithmica 50(4), 584–596 (2008)MathSciNetCrossRefMATHGoogle Scholar
- 9.Grønlund, A., Pettie, S.: Threesomes, degenerates, and love triangles. In: Proceedings 55th IEEE Symposium on Foundations of Computer Science (FOCS) (2014). Full manuscript available as arXiv:1404.0799
- 10.Chan, T.M.: The art of shaving logs. In: Dehne, F., Solis-Oba, R., Sack, J.-R. (eds.) WADS 2013. LNCS, vol. 8037, p. 231. Springer, Heidelberg (2013) CrossRefGoogle Scholar
- 11.Pǎtraşcu, M.: Towards polynomial lower bounds for dynamic problems. In: Proceedings 42nd ACM Symposium on Theory of Computing (STOC), pp. 603–610 (2010)Google Scholar
- 12.Kopelowitz, T., Pettie, S., Porat, E.: 3sum hardness in (dynamic) data structures (2014). CoRR abs/1407.6756Google Scholar
- 13.Demaine, E.D., López-Ortiz, A., Munro, J.I.: Adaptive set intersections, unions, and differences. In: Proceedings of the Eleventh Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 743–752 (2000)Google Scholar
- 14.Barbay, J., Kenyon, C.: Adaptive intersection and t-threshold problems. In: Proceedings 13th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 390–399 (2002)Google Scholar
- 15.Baeza-Yates, R.: A fast set intersection algorithm for sorted sequences. In: Sahinalp, S.C., Muthukrishnan, S., Dogrusoz, U. (eds.) CPM 2004. LNCS, vol. 3109, pp. 400–408. Springer, Heidelberg (2004) CrossRefGoogle Scholar
- 16.Bille, P., Pagh, A., Pagh, R.: Fast evaluation of union-intersection expressions. In: Tokuyama, T. (ed.) ISAAC 2007. LNCS, vol. 4835, pp. 739–750. Springer, Heidelberg (2007) CrossRefGoogle Scholar
- 17.Cohen, H., Porat, E.: Fast set intersection and two-patterns matching. Theor. Comput. Sci. 411(40–42), 3795–3800 (2010)MathSciNetCrossRefMATHGoogle Scholar
- 18.Itai, A., Rodeh, M.: Finding a minimum circuit in a graph. SIAM J. Comput. 7(4), 413–423 (1978)MathSciNetCrossRefMATHGoogle Scholar
- 19.Chiba, N., Nishizeki, T.: Arboricity and subgraph listing algorithms. SIAM J. Comput. 14(1), 210–223 (1985)MathSciNetCrossRefMATHGoogle Scholar
- 20.Björklund, A., Pagh, R., Williams, V.V., Zwick, U.: Listing triangles. In: Esparza, J., Fraigniaud, P., Husfeldt, T., Koutsoupias, E. (eds.) ICALP 2014. LNCS, vol. 8572, pp. 223–234. Springer, Heidelberg (2014) Google Scholar
- 21.Albers, S., Hagerup, T.: Improved parallel integer sorting without concurrent writing. Inf. Comput. 136(1), 25–51 (1997)MathSciNetCrossRefMATHGoogle Scholar
- 22.Fredman, M.L., Willard, D.E.: Surpassing the information theoretic bound with fusion trees. J. Comput. Syst. Sci. 47(3), 424–436 (1993)MathSciNetCrossRefMATHGoogle Scholar
- 23.Brodnik, A., Miltersen, P.B., Munro, J.I.: Trans-dichotomous algorithms without multiplication—some upper and lower bounds. In: Rau-Chaplin, A., Dehne, F., Sack, J.-R., Tamassia, R. (eds.) WADS 1997. LNCS, vol. 1272, pp. 426–439. Springer, Heidelberg (1997) CrossRefGoogle Scholar