Skip to main content
Log in

Subquadratic Algorithms for Algebraic 3SUM

  • Published:
Discrete & Computational Geometry Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

Notes

  1. Throughout this document, \(\varepsilon \) denotes a positive real number that can be made as small as desired.

  2. 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.

  3. 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\).

  4. 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.

  5. Note that it is easy to modify the algorithm to count or report the solutions. In the latter case, the algorithm becomes output sensitive.

  6. Note that vertical and horizontal lines fall in both categories.

  7. The original algorithm relies on hierarchical cuttings which cannot be implemented in the bounded-degree ADT model.

  8. In the real-RAM and word-RAM models.

  9. Not including the independent monomial, namely, 1.

  10. Note that Raz et al. [54] use the same points and curves.

References

  1. 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)

  2. 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)

  3. 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)

  4. Ailon, N., Chazelle, B.: Lower bounds for linear degeneracy testing. J. ACM 52(2), 157–171 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  5. 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)

  6. Baran, I., Demaine, E.D., Pătracu, M.: Subquadratic algorithms for 3SUM. Algorithmica 50(4), 584–596 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  7. 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)

    Article  MathSciNet  MATH  Google Scholar 

  8. 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)

  9. Basu, S., Pollack, R., Roy, M.F.: Algorithms in Real Algebraic Geometry. Algorithms and Computation in Mathematics. Springer, Berlin (2006)

    MATH  Google Scholar 

  10. 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)

    Article  MathSciNet  MATH  Google Scholar 

  11. Brönnimann, H., Chazelle, B., Matoušek, J.: Product range spaces, sensitive sampling, and derandomization. SIAM J. Comput. 28(5), 1552–1575 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  12. 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)

  13. 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)

  14. Caviness, B.F., Johnson, J.R. (eds.): Quantifier Elimination and Cylindrical Algebraic Decomposition. Texts and Monographs in Symbolic Computation. Springer, Vienna (1998)

    MATH  Google Scholar 

  15. Chan, T.M.: All-pairs shortest paths with real weights in \({O}(n^3/{\log }\, n)\) time. Algorithmica 50(2), 236–243 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  16. 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)

  17. 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)

    Article  MATH  Google Scholar 

  18. Chazelle, B., Matoušek, J.: On linear-time deterministic algorithms for optimization problems in fixed dimension. J. Algorithms 21(3), 579–597 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  19. 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)

    Google Scholar 

  20. 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)

    Book  MATH  Google Scholar 

  21. Davenport, J.H., Heintz, J.: Real quantifier elimination is doubly exponential. J. Symb. Comput. 5(1–2), 29–35 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  22. 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)

    Article  MathSciNet  MATH  Google Scholar 

  23. Elekes, G., Rónyai, L.: A combinatorial problem on polynomials and rational functions. J. Comb. Theory, Ser. A 89(1), 1–20 (2000)

  24. Elekes, G., Szabó, E.: How to find groups? (and how to use them in Erdős geometry?). Combinatorica 32(5), 537–571 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  25. Erickson, J.: New lower bounds for hopcroft’s problem. Discrete Comput. Geom. 16(4), 389–418 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  26. Erickson, J.: Lower bounds for linear satisfiability problems. Chicago J. Theor. Comput. Sci. 1999, Art. No. 8 (1999)

  27. 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)

  28. Fredman, M.L.: How good is the information theory bound in sorting? Theor. Comput. Sci. 1(4), 355–361 (1976)

    Article  MathSciNet  MATH  Google Scholar 

  29. Freund, A.: Improved subquadratic 3SUM. Algorithmica 77(2), 440–458 (2017)

    Article  MathSciNet  MATH  Google Scholar 

  30. Gajentaan, A., Overmars, M.H.: On a class of \({O}(n^2)\) problems in computational geometry. Comput. Geom. 5(3), 165–185 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  31. 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)

  32. 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)

  33. Harris, J.: Algebraic Geometry: A First Course. Graduate Texts in Mathematics, vol. 133. Springer, New York (2013)

  34. Hartshorne, R.: Algebraic Geometry. Graduate Texts in Mathematics, vol. 52. Springer, New York (1977)

  35. 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)

  36. Matoušek, J.: Range searching with efficient hierarchical cutting. Discrete Comput. Geom. 10(2), 157–182 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  37. Matousek, J.: Approximations and optimal geometric divide-an-conquer. J. Comput. Syst. Sci. 50(2), 203–208 (1995)

    Article  MathSciNet  Google Scholar 

  38. Matoušek, J.: Derandomization in computational geometry. J. Algorithms 20(3), 545–580 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  39. Meiser, S.: Point location in arrangements of hyperplanes. Inform. Comput. 106(2), 286–303 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  40. Meyer auf der Heide, F.: A polynomial linear search algorithm for the \(n\)-dimensional knapsack problem. J. ACM 31(3), 668–676 (1984)

  41. 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)

  42. 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)

  43. 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)

  44. Nassajian Mojarrad, H., Pham, T., Valculescu, C., de Zeeuw, F.: Schwartz–Zippel bounds for two-dimensional products (2016). arXiv:1507.08181

  45. Pach, J., Sharir, M.: On the number of incidences between points and curves. Combin. Probab. Comput. 7(1), 121–127 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  46. Pach, J., Sharir, M.: Combinatorial Geometry and Its Algorithmic Applications: The Alcalá Lectures. Mathematical Surveys and Monographs. American Mathematical Society, Providence (2009)

    MATH  Google Scholar 

  47. 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)

  48. Preparata, F.P., Shamos, M.I.: Computational Geometry: An Introduction. Texts and Monographs in Computer Science. Springer, New York (1985)

    Book  MATH  Google Scholar 

  49. Rabin, M.O.: Proving simultaneous positivity of linear forms. J. Comput. Syst. Sci. 6(6), 639–650 (1972)

    Article  MathSciNet  MATH  Google Scholar 

  50. 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)

  51. 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)

    Article  MathSciNet  MATH  Google Scholar 

  52. 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)

  53. Raz, O.E., Sharir, M., Solymosi, J.: On triple intersections of three families of unit circles. Discrete Comput. Geom. 54(4), 930–953 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  54. 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)

  55. Raz, O.E., Sharir, M., de Zeeuw, F.: The Elekes-Szabó Theorem in four dimensions. Isr. J. Math. 227(2), 663–690 (2018)

    Article  MATH  Google Scholar 

  56. Seidenberg, A.: Constructions in algebra. Trans. Am. Math. Soc. 197, 273–313 (1974)

    Article  MathSciNet  MATH  Google Scholar 

  57. Steele, J.M., Yao, A.C.: Lower bounds for algebraic decision trees. J. Algorithms 3(1), 1–8 (1982)

    Article  MathSciNet  MATH  Google Scholar 

  58. 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)

  59. Yao, A.C.C.: A lower bound to finding convex hulls. J. ACM 28(4), 780–787 (1981)

    Article  MathSciNet  MATH  Google Scholar 

  60. 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)

Download references

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

Authors

Corresponding author

Correspondence to Aurélien Ooms.

Additional information

Editor in Charge: Kenneth Clarkson

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00454-018-0040-y

Keywords

Mathematics Subject Classification

Navigation