Abstract
The 3SUM problem asks if an input n-set of real numbers contains a triple whose sum is zero. We qualify such a triple of degenerate because the probability of finding one in a random input is zero. We consider the 3POL problem, an algebraic generalization of 3SUM where we replace the sum function by a constant-degree polynomial in three variables. The motivations are threefold. Raz et al. gave an \(O(n^{11/6})\) upper bound on the number of degenerate triples for the 3POL problem. We give algorithms for the corresponding problem of counting them. Grønlund and Pettie designed subquadratic algorithms for 3SUM. We prove that 3POL admits bounded-degree algebraic decision trees of depth \(O(n^{12/7+\varepsilon })\), and we prove that 3POL can be solved in \(O(n^2 {(\log \log n)}^{3/2} / {(\log n)}^{1/2})\) time in the real-RAM model, generalizing their results. Finally, we shed light on the General Position Testing (GPT) problem: “Given n points in the plane, do three of them lie on a line?”, a key problem in computational geometry: we show how to solve GPT in subquadratic time when the input points lie on a small number of constant-degree polynomial curves. Many other geometric degeneracy testing problems reduce to 3POL.
Similar content being viewed by others
Notes
Throughout this document, \(\varepsilon \) denotes a positive real number that can be made as small as desired.
Chan [16] shows that an additional logarithmic factor can be shaved by augmenting the real-RAM model with constant time nonstandard operations on \({\varTheta }(\log n)\) bits words. His improvements extend to 3POL.
The main result in Gold and Sharir’s paper [31] is a randomized\(O(n^{k/2})\)-depth \((2k-2)\)-linear decision tree for \(k\)-SUM, for all odd \(k \ge 3\).
Because our results do not depend on the meaning of group related form, we do not bother defining it here. We refer the reader to Raz et al. [54] for the exact definition.
Note that it is easy to modify the algorithm to count or report the solutions. In the latter case, the algorithm becomes output sensitive.
Note that vertical and horizontal lines fall in both categories.
The original algorithm relies on hierarchical cuttings which cannot be implemented in the bounded-degree ADT model.
In the real-RAM and word-RAM models.
Not including the independent monomial, namely, 1.
Note that Raz et al. [54] use the same points and curves.
References
Abboud, A., Vassilevska Williams, V.: Popular conjectures imply strong lower bounds for dynamic problems. In: Proceedings of the 55th Annual IEEE Symposium on Foundations of Computer Science (FOCS’14), pp. 434–443. IEEE, Los Alamitos (2014)
Abboud, A.: Vassilevska Williams, V., Weimann, O.: Consequences of faster alignment of sequences. Automata, Languages, and Programming, Part I (ICALP’14). Lecture Notes in Computer Science, vol. 8572, pp. 39–51. Springer, Heidelberg (2014)
Abboud, A., Vassilevska Williams, V., Yu, H.: Matching triangles and basing hardness on an extremely popular conjecture. In: Proceedings of the 47th ACM Symposium on Theory of Computing (STOC’15), pp. 41–50. ACM, New York (2015)
Ailon, N., Chazelle, B.: Lower bounds for linear degeneracy testing. J. ACM 52(2), 157–171 (2005)
Amir, A., Chan, T.M., Lewenstein, M., Lewenstein, N.: On hardness of jumbled indexing. Automata, Languages, and Programming, Part I (ICALP’14). Lecture Notes in Computer Science, vol. 8572, pp. 114–125. Springer, Heidelberg (2014)
Baran, I., Demaine, E.D., Pătracu, M.: Subquadratic algorithms for 3SUM. Algorithmica 50(4), 584–596 (2008)
Barequet, G., Har-Peled, S.: Polygon containment and translational min Hausdorff-distance between segment sets are 3SUM-hard. Int. J. Comput. Geom. Appl. 11(4), 465–474 (2001)
Basu, S., Pollack, R., Roy, M.-F.: Computing roadmaps of semi-algebraic sets (extended abstract). In: Proceedings of the 28th ACM Symposium on Theory of Computing (STOC’96), pp. 168–173. ACM, New York (1996)
Basu, S., Pollack, R., Roy, M.F.: Algorithms in Real Algebraic Geometry. Algorithms and Computation in Mathematics. Springer, Berlin (2006)
Bremner, D., Chan, T.M., Demaine, E.D., Erickson, J., Hurtado, F., Iacono, J., Langerman, S., Pătraşcu, M., Taslakian, P.: Necklaces, convolutions, and X+Y. Algorithmica 69(2), 294–314 (2014)
Brönnimann, H., Chazelle, B., Matoušek, J.: Product range spaces, sensitive sampling, and derandomization. SIAM J. Comput. 28(5), 1552–1575 (1999)
Cardinal, J., Iacono, J., Ooms, A.: Solving \(k\)-SUM using few linear queries. In: Sankowski, P., Zaroliagis, C. (eds.) 24th Annual European Symposium on Algorithms (ESA’16). LIPIcs. Leibniz International Proceedings in Informatics, 57, pp. 25:1–25:17. Schloss Dagstuhl. Leibniz-Zentrum für Informatik, Wadern (2016)
Carmosino, M.L., Gao, J., Impagliazzo, R., Mihajlin, I., Paturi, R., Schneider, S.: Nondeterministic extensions of the strong exponential time hypothesis and consequences for non-reducibility. In: Proceedings of the 2016 ACM Conference on Innovations in Theoretical Computer Science (ITCS’16), pp. 261–270. ACM, New York (2016)
Caviness, B.F., Johnson, J.R. (eds.): Quantifier Elimination and Cylindrical Algebraic Decomposition. Texts and Monographs in Symbolic Computation. Springer, Vienna (1998)
Chan, T.M.: All-pairs shortest paths with real weights in \({O}(n^3/{\log }\, n)\) time. Algorithmica 50(2), 236–243 (2008)
Chan, T.M.: More logarithmic-factor speedups for 3SUM, (median,+)-convolution, and some geometric 3SUM-hard problems. In: Proceedings of the 29th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA’18), pp. 881–897. SIAM, Philadelphia (2018)
Chazelle, B., Edelsbrunner, H., Guibas, L.J., Sharir, M.: A singly exponential stratification scheme for real semi-algebraic varieties and its applications. Theor. Comput. Sci. 84(1), 77–105 (1991)
Chazelle, B., Matoušek, J.: On linear-time deterministic algorithms for optimization problems in fixed dimension. J. Algorithms 21(3), 579–597 (1996)
Collins, G.E.: Quantifier elimination for real closed fields by cylindrical algebraic decomposition. In: Brakhage, H. (ed.) Automata Theory and Formal Languages. Lecture Notes in Computer Science, vol. 33, pp. 134–183. Springer, Berlin (1975)
Cox, D., Little, J., O’Shea, D.: Ideals, Varieties, and Algorithms: An Introduction to Computational Algebraic Geometry and Commutative Algebra. Undergraduate Texts in Mathematics. Springer, New York (2007)
Davenport, J.H., Heintz, J.: Real quantifier elimination is doubly exponential. J. Symb. Comput. 5(1–2), 29–35 (1988)
Edelsbrunner, H., Guibas, L., Pach, J., Pollack, R., Seidel, R., Sharir, M.: Arrangements of curves in the plane–topology, combinatorics and algorithms. Theor. Comput. Sci. 92(2), 319–336 (1992)
Elekes, G., Rónyai, L.: A combinatorial problem on polynomials and rational functions. J. Comb. Theory, Ser. A 89(1), 1–20 (2000)
Elekes, G., Szabó, E.: How to find groups? (and how to use them in Erdős geometry?). Combinatorica 32(5), 537–571 (2012)
Erickson, J.: New lower bounds for hopcroft’s problem. Discrete Comput. Geom. 16(4), 389–418 (1996)
Erickson, J.: Lower bounds for linear satisfiability problems. Chicago J. Theor. Comput. Sci. 1999, Art. No. 8 (1999)
Ezra, E., Sharir, M.: A nearly quadratic bound for the decision tree complexity of \(k\)-SUM. In: Aronov, B., Katz, M.J. (eds.) Proceedings of the 33rd International Symposium on Computational Geometry (SoCG’17). Leibniz International Proceedings in Informatics, vol. 77, pp. 41:1–41:15. Schloss Dagstuhl. Leibniz-Zentrum für Informatik, Wadern (2017)
Fredman, M.L.: How good is the information theory bound in sorting? Theor. Comput. Sci. 1(4), 355–361 (1976)
Freund, A.: Improved subquadratic 3SUM. Algorithmica 77(2), 440–458 (2017)
Gajentaan, A., Overmars, M.H.: On a class of \({O}(n^2)\) problems in computational geometry. Comput. Geom. 5(3), 165–185 (1995)
Gold, O., Sharir, M.: Improved bounds for 3SUM, \(k\)-SUM, and linear degeneracy. In: Pruhs, K., Sohler, C. (eds.) Proceedings of the 25th European Symposium on Algorithms (ESA’17). LIPIcs. Leibniz International Proceedings in Informatics, vol. 87, pp. 42:1–42:13. Schloss Dagstuhl. Leibniz-Zentrum für Informatik, Wadern (2017)
Grønlund, A., Pettie, S.: Threesomes, degenerates, and love triangles. In: Proceedings of the 55th Annual IEEE Symposium on Foundations of Computer Science (FOCS’14), pp. 621–630. IEEE,, Los Alamitos (2014)
Harris, J.: Algebraic Geometry: A First Course. Graduate Texts in Mathematics, vol. 133. Springer, New York (2013)
Hartshorne, R.: Algebraic Geometry. Graduate Texts in Mathematics, vol. 52. Springer, New York (1977)
Kopelowitz, T., Pettie, S., Porat, E.: Higher lower bounds from the 3SUM conjecture. In: Proceedings of the 27th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA’16), pp. 1272–1287. SIAM, Philadelphia (2016)
Matoušek, J.: Range searching with efficient hierarchical cutting. Discrete Comput. Geom. 10(2), 157–182 (1993)
Matousek, J.: Approximations and optimal geometric divide-an-conquer. J. Comput. Syst. Sci. 50(2), 203–208 (1995)
Matoušek, J.: Derandomization in computational geometry. J. Algorithms 20(3), 545–580 (1996)
Meiser, S.: Point location in arrangements of hyperplanes. Inform. Comput. 106(2), 286–303 (1993)
Meyer auf der Heide, F.: A polynomial linear search algorithm for the \(n\)-dimensional knapsack problem. J. ACM 31(3), 668–676 (1984)
Henzinger, M., Krinninger, S., Nanongkai, D., Saranurak, T.: Unifying and strengthening hardness for dynamic problems via the online matrix-vector multiplication conjecture. In: Proceedings of the 47th ACM Symposium on Theory of Computing (STOC’15), pp. 21–30. ACM, New York (2015)
Kane, D.M., Lovett, S., Moran, S.: Near-optimal linear decision trees for \(k\)-SUM and related problems. In: Proceedings of the 50th ACM Symposium on Theory of Computing (STOC’15), pp. 554–563. ACM, New York (2018)
Mishra, B.: Computational real algebraic geometry. In: Goodman, J.E., O’Rourke, J. (eds.) Handbook of Discrete and Computational Geometry, 2nd edn., pp. 743–764. Discrete Mathematics and its Applications (Boca Raton). Chapman and Hall/CRC, Boca Raton (2004)
Nassajian Mojarrad, H., Pham, T., Valculescu, C., de Zeeuw, F.: Schwartz–Zippel bounds for two-dimensional products (2016). arXiv:1507.08181
Pach, J., Sharir, M.: On the number of incidences between points and curves. Combin. Probab. Comput. 7(1), 121–127 (1998)
Pach, J., Sharir, M.: Combinatorial Geometry and Its Algorithmic Applications: The Alcalá Lectures. Mathematical Surveys and Monographs. American Mathematical Society, Providence (2009)
Pătracu, M.: Towards polynomial lower bounds for dynamic problems. In: Proceedings of the 42nd ACM International Symposium on Theory of Computing (STOC’10), pp. 603–609. ACM, New York (2010)
Preparata, F.P., Shamos, M.I.: Computational Geometry: An Introduction. Texts and Monographs in Computer Science. Springer, New York (1985)
Rabin, M.O.: Proving simultaneous positivity of linear forms. J. Comput. Syst. Sci. 6(6), 639–650 (1972)
Raz, O.E., Sharir, M.: The number of unit-area triangles in the plane: Theme and variations. In: Arge, L., Pach, J. (eds.) Proceedings of the 31st International Symposium on Computational Geometry (SoCG’15). LIPIcs. Leibniz International Proceedings in Informatics, vol. 34, pp. 569–583. Schloss Dagstuhl. Leibniz-Zentrum für Informatik, Wadern (2015)
Raz, O.E., Sharir, M., Shkredov, I.D.: On the number of unit-area triangles spanned by convex grids in the plane. Comput. Geom. 62, 25–33 (2017)
Raz, O.E., Sharir, M., Solymosi, J.: Polynomials vanishing on grids: The Elekes–Rónyai problem revisited. In: Proceedings of the 30th Annual Symposium on Computational Geometry (SoCG’14), pp. 251–260. ACM, New York (2014)
Raz, O.E., Sharir, M., Solymosi, J.: On triple intersections of three families of unit circles. Discrete Comput. Geom. 54(4), 930–953 (2015)
Raz, O.E., Sharir, M., de Zeeuw, F.: Polynomials vanishing on cartesian products: The Elekes–Szabó theorem revisited. In: Arge, L., Pach, J. (eds.) Proceedings of the 31st International Symposium on Computational Geometry (SoCG’15). LIPIcs. Leibniz International Proceedings in Informatics, vol. 34, pp. 522–536. Schloss Dagstuhl. Leibniz-Zentrum für Informatik, Wadern (2015)
Raz, O.E., Sharir, M., de Zeeuw, F.: The Elekes-Szabó Theorem in four dimensions. Isr. J. Math. 227(2), 663–690 (2018)
Seidenberg, A.: Constructions in algebra. Trans. Am. Math. Soc. 197, 273–313 (1974)
Steele, J.M., Yao, A.C.: Lower bounds for algebraic decision trees. J. Algorithms 3(1), 1–8 (1982)
Tarski, A.: A decision method for elementary algebra and geometry. In: Caviness, B.F., Johnson, J.R. (eds.) Quantifier Elimination and Cylindrical Algebraic Decomposition. Texts and Monographs in Symbolic Computation, pp. 24–84. Springer, Vienna (1998)
Yao, A.C.C.: A lower bound to finding convex hulls. J. ACM 28(4), 780–787 (1981)
Yun, D.Y.Y.: On square-free decomposition algorithms. In: Proceedings of the 3th ACM Symposium on Symbolic and Algebraic Computation (SYMSACC’76) , pp. 26–35. ACM New York (1976)
Acknowledgements
The authors wish to thank the anonymous referees for many useful suggestions. Jean Cardinal is supported by the “Action de Recherche Concertée” (ARC) COPHYMA, convention number 4.110.H.000023. John Iacono’s research was partially completed while on sabbatical at the Algorithms Research Group of the Département d’Informatique at the Université libre de Bruxelles with support from a Fulbright Research Fellowship, the Fonds de la Recherche Scientifique—FNRS, and NSF Grants CNS-1229185, CCF-1319648, and CCF-1533564. Stefan Langerman is Directeur de recherches du F.R.S.-FNRS. Aurélien Ooms is supported by the Fund for Research Training in Industry and Agriculture (FRIA). Noam Solomon is supported by Grant 892/13 from the Israel Science Foundation.
Author information
Authors and Affiliations
Corresponding author
Additional information
Editor in Charge: Kenneth Clarkson
Rights and permissions
About this article
Cite this article
Barba, L., Cardinal, J., Iacono, J. et al. Subquadratic Algorithms for Algebraic 3SUM. Discrete Comput Geom 61, 698–734 (2019). https://doi.org/10.1007/s00454-018-0040-y
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00454-018-0040-y
Keywords
- 3SUM
- Subquadratic algorithms
- General position testing
- Range searching
- Dominance reporting
- Algebraic geometry
- Degeneracy testing