Abstract
Pǎtraşcu (STOC ’10) reduces the \(\mathrm {3SUM}\) problem to listing triangles in a graph. In the other direction, we show that if one can solve \(\mathrm {3SUM}\) on a set of size \(n\) in time \(n^{1+\epsilon }\) then one can list \(t\) triangles in a graph with \(m\) edges in time \(\tilde{O}(m^{1+\epsilon }t^{1/3-\epsilon /3})\). Our result builds on and extends works by the Paghs (PODS ’06) and by Vassilevska and Williams (FOCS ’10). We make our reductions deterministic using tools from pseudorandomness. We then re-execute both Pǎtraşcu’s reduction and ours for the variant \(\mathrm {3XOR}\) of \(\mathrm {3SUM}\) where integer summation is replaced by bit-wise xor. As a corollary we obtain that if \(\mathrm {3XOR}\) is solvable in linear time but \(\mathrm {3SUM}\) requires quadratic randomized time, or vice versa, then the randomized time complexity of listing \(m\) triangles in a graph with \(m\) edges is \(m^{4/3}\) up to a factor \(m^\alpha \) for any \(\alpha > 0\).
Similar content being viewed by others
Notes
References
Ailon, N., Chazelle, B.: Lower bounds for linear degeneracy testing. J. ACM 52(2), 157–171 (2005)
Alon, N., Goldreich, O., Håstad, J., Peralta, R.: Simple constructions of almost \(k\)-wise independent random variables. Random Struct. Algorithms 3(3), 289–304 (1992)
Amossen, R.R.: Scalable Query Evaluation in Realational Databases. PhD Thesis, IT University of Copenhagen (2011)
Alon, N., Yuster, R., Zwick, U.: Finding and counting given length cycles. Algorithmica 17(3), 209–223 (1997)
Baran, I., Demaine, E.D., Pǎtraşcu, M.: Subquadratic algorithms for 3sum. Algorithmica 50(4), 584–596 (2008)
Bhattacharyya, A., Indyk, P., Woodruff, D.P., Xie, N.: The complexity of linear dependence problems in vector spaces. In: ACM Innovations in Theoretical Computer Science Conference (ITCS), pp. 496–508 (2011)
Bjőrklund, A., Pagh, R., Williams, V.V., Zwick, U.: Listing triangles. In: Colloquium on Automata, Languages and Programming (ICALP) (2014)
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. MIT Press, Cambridge, MA (2001)
Dietzfelbinger, M.: Universal hashing and \(k\)-wise independent random variables via integer arithmetic without primes. In: Symposium on Theoretical Aspects of Computer Science (STACS), pp. 569–580 (1996)
Elkin, M.: An improved construction of progression-free sets (2008). arXiv:0801.4310
Erickson, J.: Lower bounds for linear satisfiability problems. Chic. J. Theor. Comput. Sci. (1999)
Gajentaan, A., Overmars, M.H.: On a class of \({O}(n^2)\) problems in computational geometry. Comput. Geom. 5, 165–185 (1995)
Gutfreund, D., Viola, E.: Fooling parity tests with parity gates. In: 8thWorkshop on Randomization and Computation (RANDOM), pp. 381–392. Springer (2004)
Impagliazzo, R., Paturi, R., Zane, F.: Which problems have strongly exponential complexity? J. Comput. Syst. Sci. 63(4), 512–530 (2001)
Jorgesen, A.G., Pettie, S.: Threesomes, degenerates, and love triangles. In: IEEE Symposium on Foundations of Computer Science (FOCS) (2014)
Maslen, D.K., Rockmore, D.N.: Generalized FFTs—a survey of some recent results. In: Groups and Computation, II (New Brunswick, NJ, 1995), volume 28 of DIMACS Ser. Discrete Math. Theor. Comput. Sci., pp. 183–237. Amer. Math. Soc., Providence, RI (1997)
Naor, J., Naor, M.: Small-bias probability spaces: efficient constructions and applications. SIAM J. Comput. 22(4), 838–856 (1993)
Nisan, N., Wigderson, A.: Hardness vs randomness. J. Comput. Syst. Sci. 49(2), 149–167 (1994)
O’Bryant, K.: Sets of integers that do not contain long arithmetic progressions (2008). arXiv:0811.3057
Pǎtraşcu, M.: Towards polynomial lower bounds for dynamic problems. In: ACM Symposium on the Theory of Computing (STOC), pp. 603–610 (2010)
Pagh, A., Pagh, R.: Scalable computation of acyclic joins. In: ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS), pp. 225–232 (2006)
Pǎtraşcu, M., Williams, R.: On the possibility of faster SAT algorithms. In: ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 1065–1075 (2010)
Ruzsa, I.Z.: Solving a linear equation in a set of integers I. Acta Arith. LXV(3), 261–263 (1993)
Vardy, A.: The intractability of computing the minimum distance of a code. IEEE Trans. Inf. Theory 43(6), 1757–1766 (1997)
Viola, E.: Reducing 3XOR to listing triangles, an exposition (2011). http://www.ccs.neu.edu/home/viola/
Vassilevska, V., Williams, R.: Finding, minimizing, and counting weighted subgraphs. In: ACM Symposium on the Theory of Computing (STOC), pp. 455–464 (2009)
Williams, V.V., Williams, R.: Subcubic equivalences between path, matrix and triangle problems. In: IEEE Symposium on Foundations of Computer Science (FOCS), pp. 645–654 (2010)
Acknowledgments
We are very grateful to Rasmus Pagh and Virginia Vassilevska Williams for answering many questions on finding triangles in graphs. Rasmus also pointed us to [3, 21]. We also thank Siyao Guo for pointing out that a step in a previous proof of Lemma 14 was useless, and Ryan Williams for stimulating discussions. Finally, we thank the anonymous referees for their helpful comments.
Author information
Authors and Affiliations
Corresponding author
Additional information
Supported by NSF Grants CCF-0845003, CCF-1319206.
Rights and permissions
About this article
Cite this article
Jafargholi, Z., Viola, E. \(\mathrm {3SUM}\), \(\mathrm {3XOR}\), Triangles. Algorithmica 74, 326–343 (2016). https://doi.org/10.1007/s00453-014-9946-9
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453-014-9946-9