We revisit the algorithmic problem of finding a triangle in a graph (Triangle Detection), and examine its relation to other problems such as 3Sum, Independent Set, and Graph Coloring. We obtain several new algorithms:
(I) A simple randomized algorithm for finding a triangle in a graph. As an application, we study a question of Pˇatraşcu (2010) regarding the triangle detection problem.
(II) An algorithm which given a graph 𝐺 = (𝑉 , 𝐸) performs one of the following tasks in 𝑂(𝑚 + 𝑛) (i.e., linear) time: (i) compute a Ω(1/√𝑛)-approximation of a maximum independent set in 𝐺 or (ii) find a triangle in 𝐺. The run-time is faster than that for any previous method for each of these tasks.
(III) An algorithm which given a graph 𝐺 = (𝑉 , 𝐸) performs one of the following tasks in 𝑂(𝑚+𝑛3/2) time: (i) compute √𝑛-approximation for Graph Coloring of 𝐺 or (ii) find a triangle in 𝐺. The run-time is faster than that for any previous method for each of these tasks on dense graphs, with 𝑚 = (𝑛9/8).
(IV) Results (II) and (III) above suggest the following broader research direction: if it is difficult to find (A) or (B) separately, can one find one of the two efficiently? This motivates the dual pair concept we introduce. We provide several instances of dual-pair approximation, relating Longest Path, (1,2)-TSP, and other NP-hard problems.
A. Abboud, V. V. Williams, and H. Yu. Matching triangles and basing hardness on an extremely popular conjecture. SIAM J. Comput., 47(3):1098–1122, 2018.
A. Adamaszek, M. Mnich, and K. Paluch. New approximation algorithms for (1, 2)-TSP. In 45th International Colloquium on Automata, Languages, and Programming, volume 107 of LIPIcs. Leibniz Int. Proc. Inform., page article no. 9. Schloss Dagstuhl. Leibniz-Zent. Inform., Wadern, 2018.
M. Ajtai, J. Komlós, and E. Szemerédi. A note on Ramsey numbers. J. Combin. Theory Ser. A, 29(3):354–360, 1980.
N. Alon, R. Yuster, and U. Zwick. Color-coding. J. Assoc. Comput. Mach., 42(4):844–856, 1995.
N. Alon, R. Yuster, and U. Zwick. Finding and counting given length cycles. Algorithmica, 17(3):209–223, 1997.
R. Bar-Yehuda and S. Even. On approximating a vertex cover for planar graphs. Proc. 14th Annual ACM Symposium on Theory of Computing (STOC), pages 303–309, 1982.
I. Baran, E. D. Demaine, and M. Pˇatraşcu. Subquadratic algorithms for 3SUM. Algorithmica, 50(4):584–596, 2008.
S. Bereg and A. Dumitrescu. The lifting model for reconfiguration. Discrete Comput. Geom., 35(4):653–669, 2006.
P. Berman and M. Karpinski. 8/7-approximation algorithm for (1, 2)-TSP. In Proceedings of the Seventeenth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 641–648. ACM, New York, 2006.
H. L. Bodlaender. On linear time minor tests with depth-first search. J. Algorithms, 14(1):1–23, 1993.
B. Bollobás. Modern Graph Theory, volume 184 of Grad. Texts in Math. Springer, New York, 1998.
N. Chiba and T. Nishizeki. Arboricity and subgraph listing algorithms. SIAM J. Comput., 14(1):210–223, 1985.
D. Coppersmith and S. Winograd. Matrix multiplication via arithmetic progressions. J. Symbolic Comput., 9(3):251–280, 1990.
D. de Caen. An upper bound on the sum of squares of degrees in a graph. Discrete Math., 185(1-3):245–248, 1998.
R. Duan, H. Wu, and R. Zhou. Faster matrix multiplication via asymmetric hashing. In 2023 IEEE 64th Annual Symposium on Foundations of Computer Science—FOCS 2023, pages 2129–2138. IEEE Computer Soc., Los Alamitos, CA, 2023.
L. Engebretsen and J. Holmerin. Clique is hard to approximate within 𝑛1−𝑜(1). In Automata, languages and programming (Geneva, 2000), volume 1853 of Lecture Notes in Comput. Sci., pages 2–12. Springer, Berlin, 2000.
D. Eppstein. Paired approximation problems and incompatible inapproximabilities. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1076–1086. SIAM, Philadelphia, PA, 2010.
U. Feige. Approximating maximum clique by removing subgraphs. SIAM J. Discrete Math., 18(2):219–225, 2004.
H. N. Gabow. Finding paths and cycles of superpolylogarithmic length. In Proceedings of the thirty-sixth annual ACM symposium on Theory of computing, STOC’04, page 407–416. ACM, jun 2004.
A. Gajentaan and M. H. Overmars. On a class of 𝑂(𝑛2) problems in computational geometry. Comput. Geom., 45(4):140–152, 2012.
M. R Garey and D. S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman and Co., New York, 1979.
J. Gimbel and C. Thomassen Coloring triangle-free graphs with fixed size. Discrete Math., 219(1-3):275–277, 2000.
O. Gold and M. Sharir. Improved bounds for 3SUM, 𝑘-SUM, and linear degeneracy. In 25th European Symposium on Algorithms, volume 87 of LIPIcs. Leibniz Int. Proc. Inform., page article no. 42. Schloss Dagstuhl. Leibniz-Zent. Inform., Wadern, 2017.
A. Grønlund and S. Pettie. Threesomes, degenerates, and love triangles. J. ACM, 65(4): article no. 22, 2018.
M. M. Halldórsson. A still better performance guarantee for approximate graph coloring. Inform. Process. Lett., 45(1):19–23, 1993.
D. S. Hochbaum. Approximating covering and packing problems: set cover, vertex cover, independent set, and related problems, pages 94–143. PWS Publishing Co., 1997. (D. S. Hochbaum, editor).
A. Itai and M. Rodeh. Finding a minimum circuit in a graph. SIAM J. Comput., 7(4):413–423, 1978.
M. Karpinski, M. Lampis, and R. Schmied. New inapproximability bounds for TSP. J. Comput. System Sci., 81(8):1665–1677, 2015.
M. Karpinski and R. Schmied. On approximation lower bounds for tsp with bounded metrics. Electronic Colloquium on Computational Complexity, 2012. TR12-008.
J. H. Kim. The Ramsey number 𝑅(3, 𝑡) has order of magnitude 𝑡2/ log 𝑡. Random Structures Algorithms, 7(3):173–207, 1995.
T. Kloks, D. Kratsch, and H. Müller. Finding and counting small induced subgraphs efficiently. Inform. Process. Lett., 74(3-4):115–121, 2000.
T. Kopelowitz, S. Pettie, and E. Porat. Higher lower bounds from the 3SUM conjecture. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1272–1287. ACM, New York, 2016.
C. Lund and M. Yannakakis. The approximation of maximum subgraph problems. In Proc. 20th International Colloquium on Automata, Languages, and Programming, volume 700 of LNCS, pages 40–51, 1993. ICALP.
J. Matoušek. Thirty-three Miniatures, volume 53 of Stud. Math. Libr. American Mathematical Society, Providence, RI, 2010. Mathematical and algorithmic applications of linear algebra.
M. Mitzenmacher and E. Upfal. Probability and computing, Randomization and probabilistic techniques in algorithms and data analysis. Cambridge University Press, Cambridge, second edition, 2017.
C. H. Papadimitriou and M. Yannakakis. The traveling salesman problem with distances one and two. Math. Oper. Res., 18(1):1–11, 1993.
M. Pˇatraşcu. Towards polynomial lower bounds for dynamic problems. In STOC’10— Proceedings of the 2010 ACM International Symposium on Theory of Computing, pages 603–609. ACM, New York, 2010.
S. Poljak. A note on stable sets and colorings of graphs. Comment. Math. Univ. Carolinae, 15:307–309, 1974.
P. Turán. Eine Extremalaufgabe aus der Graphentheorie. Mat. Fiz. Lapok, 48:436–452, 1941.
V. Vassilevska, R. Williams, and Shan L. M. Woo. Confronting hardness using a hybrid approach. In Proceedings of the Seventeenth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1–10. ACM, New York, 2006.
D. B. West. Combinatorial Mathematics. Cambridge University Press, Cambridge, 2021.
V. V. Williams, Y. Xu, Z. Xu, and R. Zhou. New bounds for matrix multiplication: from alpha to omega. In Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 3792–3835. SIAM, Philadelphia, PA, 2024.
D. P. Williamson and D. B. Shmoys. The Design of Approximation Algorithms. Cambridge University Press, Cambridge, 2011.