,
Ronitt Rubinfeld,
Arsen Vasilyan
Creative Commons Attribution 4.0 International license
We consider the fundamental problems of approximately counting the numbers of edges and triangles in a graph in sublinear time. Previous algorithms for these tasks are significantly more efficient under a promise that the arboricity of the graph is bounded by some parameter ̅α. However, when this promise is violated, the estimates given by these algorithms are no longer guaranteed to be correct.
For the triangle counting task, we give an algorithm that requires no promise on the input graph G, and computes a (1±ε)-approximation for the number of triangles t in G in time O^*((m⋅ α(G))/t + m/(t^{2/3)}), where α(G) is the arboricity of the graph. The algorithm can be used on any graph G (no prior knowledge of the arboricity α(G) is required), and the algorithm adapts its run-time on the fly based on the graph G.
We accomplish this by trying a sequence of candidate values α̃ for α(G) and using a novel algorithm in the framework of testable algorithms. This ensures that wrong candidates α̃ cannot lead to wrong estimates: if the advice is incorrect, the algorithm either succeeds despite this or detects this and continues with a new candidate. Once the algorithm accepts the candidate, its output is guaranteed to be correct with high probability.
We prove that this approach preserves - up to an additive overhead - the dramatic efficiency gains obtainable when good arboricity bounds are known in advance, while ensuring robustness against misleading advice. We further complement this result with a lower bound, showing that such an overhead is unavoidable whenever the advice may be faulty.
We further demonstrate implications of our results for triangle counting in the streaming model.
@InProceedings{eden_et_al:LIPIcs.ITCS.2026.54,
author = {Eden, Talya and Rubinfeld, Ronitt and Vasilyan, Arsen},
title = {{Testable Algorithms for Approximately Counting Edges and Triangles in Sublinear Time and Space}},
booktitle = {17th Innovations in Theoretical Computer Science Conference (ITCS 2026)},
pages = {54:1--54:24},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-410-9},
ISSN = {1868-8969},
year = {2026},
volume = {362},
editor = {Saraf, Shubhangi},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ITCS.2026.54},
URN = {urn:nbn:de:0030-drops-253417},
doi = {10.4230/LIPIcs.ITCS.2026.54},
annote = {Keywords: Sublinear Algorithms, Triangle Counting, Edge Counting, Arboricity}
}