Preprint
Article

This version is not peer-reviewed.

Triangle Detection via Complement Vertex Covers: A Fast Certifier with an Exact Fallback

Submitted:

29 June 2026

Posted:

30 June 2026

You are already at the latest version

Abstract
We present Aegypti, a triangle-detection framework for an undirected simple graph \( G=(V,E) \) with \( n=|V| \) vertices and \( m=|E| \) edges, built on the duality between triangles and independent sets: a triangle of \( G \) is exactly a three-vertex independent set of the complement \( \overline{G} \), which is what a small vertex cover of \( \overline{G} \) leaves uncovered. Aegypti dispatches on density at \( \lceil n^{4/3}\rceil \). When \( m \le \lceil n^{4/3}\rceil \) it runs the exact Chiba--Nishizeki routine, whose \( \mathcal{O}(m^{3/2}) \) cost is \( \mathcal{O}(n^{2}) \) on inputs this sparse. When \( m > \lceil n^{4/3}\rceil \) it covers \( \overline{G} \) with the linear-time Hvala algorithm and reads three uncovered vertices, certified as a triangle in \( \mathcal{O}(1) \). We prove unconditional soundness for both variants. The fast variant is a quadratic-time, one-sided certificate procedure: in the dense regime it is complete exactly when the Hvala cover of \( \overline{G} \) leaves at least three vertices uncovered, a condition the factor-\( 2 \) bound guarantees only for graphs with\( \omega(G) \ge \lceil(n+3)/2\rceil \); its failure to return a triangle is not, by itself, evidence of triangle-freeness. The safe variant adds a Chiba--Nishizeki fallback and is therefore unconditionally complete, with worst-case running time \( \mathcal{O}(n + m^{3/2}) \). We make no claim against any fine-grained lower bound. Empirically, across a deterministic benchmark---random and structured families, adversarial dense families with small clique number, and an exhaustive sweep of all graphs on at most seven vertices---all routines agreed with an exact oracle and the fast dense branch recorded no miss. A public reference implementation is provided in the aegypti Python package, which depends on hvala.
Keywords: 
;  ;  ;  ;  

1. Introduction

Triangle detection—determining whether an undirected graph G contains three mutually adjacent vertices—is one of the most fundamental problems in graph algorithms. It arises as a primitive in network analysis [1], sparse-matrix computations [2], database join processing [3], and as the base case of exact clique solvers [4].
  • Known complexity.
Let n = | V | and m = | E | . The classical results are:
  • O ( m 3 / 2 ) via adjacency intersections. Chiba and Nishizeki [5] showed that listing all triangles costs O ( a ( G ) · m ) , where a ( G ) is the arboricity of G; since a ( G ) = O ( m ) , detection costs O ( m 3 / 2 ) .
  • O ( n ω ) via matrix multiplication. Itai and Rodeh [6] observed that triangle detection reduces to Boolean matrix multiplication; with the current best exponent ω < 2.371339  [7], this gives O ( n 2.372 ) . Alon, Yuster, and Zwick [8] sharpened the combination to O ( m 2 ω / ( ω + 1 ) ) .
  • Conditional lower bounds. Triangle detection sits at the centre of a web of fine-grained reductions [9,10]. The associated lower bounds are model-sensitive—they distinguish combinatorial from algebraic algorithms and are stated variously in terms of n or m—so they must be quoted with care. We make no claim against them in this paper.
  • Our contribution.
We introduce Aegypti, a framework built on a single structural observation:
A triangle of G is precisely a three-vertex independent set of the complement G ¯ , and a large independent set of G ¯ is exactly the part of V left uncovered by a small vertex cover of G ¯ .
A vertex cover of G ¯ is produced in linear time by the Hvala algorithm [11], a companion work giving a 2-approximate minimum vertex cover in O ( n + m ) time. Removing it from V leaves an independent set of G ¯ , i.e. a clique of G; any three such vertices are a triangle, which we certify in O ( 1 ) . This complement route is efficient exactly when G is dense—the regime in which adjacency intersection becomes expensive—so we dispatch at the density threshold n 4 / 3 : Chiba–Nishizeki below it, the complement cover above it. The dense branch is always sound, but it can be inconclusive (a 2-approximate cover need not leave three vertices uncovered even when G has a triangle), which yields two variants:
  • Aegypti-fast (the default mode): use the dense branch as-is. A uniform O ( n 2 ) -time, one-sided triangle certifier: every triple it returns is a genuine triangle, but a None answer is conclusive only in the sparse regime or when the dense-branch cover condition (Theorem 4 and Hypothesis 1) holds.
  • Aegypti-safe: if the dense branch is inconclusive, fall back to Chiba–Nishizeki. Unconditionally sound and complete on every graph, at a worst-case cost of O ( n + m 3 / 2 ) .
We are explicit about what is and is not new. The safe variant’s worst case, O ( n + m 3 / 2 ) , is the classical Chiba–Nishizeki regime; its value is correctness, not speed. The fast variant is quadratic but conditionally complete. The contribution is therefore best read as a framework rather than an unconditional fast detector:
  • the complement-cover view turns a linear-time vertex cover into a certificate-producing dense preconditioner for triangle detection;
  • it is sound on every graph, and every positive answer carries an explicit witness;
  • it composes cleanly with an exact fallback to give an unconditionally complete detector;
  • it isolates a precise structural condition (Theorem 4, Hypothesis 1) under which the fast branch alone is complete; and
  • empirically it avoids the fallback on every tested dense instance, including adversarial small-clique families and an exhaustive sweep of all graphs on at most seven vertices (Section 6).
The framework is named Aegypti after Aedes aegypti, a mosquito whose compound eye detects a pattern by aggregating many simple local signals—analogous to reducing the local pattern of a triangle to a single global structure, a vertex cover of the complement.
  • Paper organisation.
Section 2 fixes notation and recalls the two ingredients: the triangle/independent-set duality and the Hvala cover. Section 3 states Aegypti and its sub-routines as pseudocode that mirrors the reference implementation. Section 4 proves soundness, characterises the completeness of each variant, and establishes the running-time bounds. Section 5 reviews related work. Section 6 reports the empirical evaluation. Section 7 concludes.

2. Preliminaries

2.1. Graph Notation

All graphs G = ( V , E ) are simple and undirected. We write n = | V | , m = | E | , N ( v ) for the open neighbourhood of v, d ( v ) = | N ( v ) | , and Δ = max v d ( v ) . The complement G ¯ = ( V , E ¯ ) has the same vertex set and edge set E ¯ = V 2 E , so | E ¯ | = n 2 m .
Definition 1 
(Triangle). Atrianglein G is a set { u , v , w } V of three distinct vertices with { u , v } , { v , w } , { u , w } E .
Definition 2 
(Vertex cover, independent set, clique). Avertex coverof G is a set C V such that every edge has at least one endpoint in C. Anindependent setis a set I V with no edge between its members. Acliqueis a set of pairwise-adjacent vertices. We write α ( G ) for the maximum independent set size and ω ( G ) for the maximum clique size.

2.2. Two Structural Facts

The framework rests on two textbook dualities, stated explicitly because the dense regime is a direct application of them.
Proposition 1 
(Cover/independent-set duality). For any graph H = ( V , E H ) , a set C V is a vertex cover of H if and only if V C is an independent set of H. Consequently α ( H ) = n OPT VC ( H ) , where OPT VC ( H ) is the minimum vertex cover size.
Proposition 2 
(Complement duality). A set S V is a clique of G if and only if S is an independent set of G ¯ . In particular ω ( G ) = α ( G ¯ ) , and { u , v , w } is a triangle of G if and only if it is a three-vertex independent set of G ¯ .
Combining the two: if C is any vertex cover of G ¯ , then V C is an independent set of G ¯ (Proposition 1), hence a clique of G (Proposition 2). If | V C | 3 , any three of its vertices form a triangle of G. This is the soundness of the dense regime; the only algorithmic content is producing a small cover C quickly.

2.3. The Hvala Vertex Cover

Hvala [11] is a linear-time ensemble heuristic for minimum vertex cover. On a graph with n vertices and m edges it returns, in O ( n + m ) time and space, a vertex cover whose size is at most twice optimal. We use it as a black box through the call C H v a l a V e r t e x C o v e r ( H ) and rely only on the following.
Lemma 1 
(Hvala guarantee). For every finite simple graph H, H v a l a V e r t e x C o v e r ( H ) returns a valid vertex cover C of H with | C | 2 OPT VC ( H ) , in time and space O ( | V ( H ) | + | E ( H ) | ) .
Validity (that C is a genuine cover) underwrites soundness; the factor-2 size bound gives the unconditional large-clique guarantee of Theorem 4.

2.4. Chiba–Nishizeki Detection

For the sparse regime, and as the fallback of Aegypti-safe, we use the classical adjacency-intersection routine of Chiba and Nishizeki [5]. It scans each edge once and searches the smaller of the two endpoints’ adjacency sets for a common neighbour; a common neighbour completes a triangle. No vertex ordering is needed: building the adjacency sets is O ( n + m ) and the scan is { u , v } E min ( d ( u ) , d ( v ) ) = O ( m 3 / 2 ) , for O ( n + m 3 / 2 ) total (Theorem 5).

3. The Aegypti Framework

Aegypti (Algorithm 1) is a density-split detector whose pseudocode mirrors the reference implementation (find_triangle_coordinates): the same threshold n 4 / 3 , the same two branches, the same extraction of three uncovered vertices, and the same O ( 1 ) certification. The Boolean parameter fallback selects the variant: with the marked line 19 it is Aegypti-safe; omitting that line yields Aegypti-fast, a one-sided certifier. The reference implementation defaults to f a l l b a c k = f a l s e (the fast variant); the safe variant is opt-in. Algorithm 2 states the Chiba–Nishizeki sub-routine (find_triangle_chiba_nishizeki) used in the sparse branch and as the fallback.
Algorithm 1 Aegypti(G,Fallback): a sound triangle certifier (with optional exact fallback).
Require: 
Simple undirected graph G = ( V , E ) , no self-loops; flag fallback
Ensure: 
A certified triangle { u , v , w } , or None
1:
if  | V | < 3 or | E | = 0 then
2:
    return None
3:
end if
4:
n | V | ;    m | E | ;    bound n 4 / 3
5:
if  m bound then                                                                                                       ▹Sparse regime: exact
6:
    return Chiba-Nishizeki ( G )
7:
end if
                                                                                                                                                 ▹Dense regime
8:
H G ¯ ;    C H v a l a V e r t e x C o v e r ( H )                                                   ▹ linear-time 2-approx cover of G ¯
9:
I V C                                                                                               ▹ independent set of G ¯ = clique of G
10:
if  | I | 3 then
11:
    pick three distinct vertices u , v , w I
12:
    if  { u , v } , { v , w } , { u , w } E  then                                                                                     ▹ O ( 1 ) certification
13:
        return  { u , v , w }
14:
    end if
15:
end if
16:
iffallbackthen                                                                                                              ▹Aegypti-safe only
17:
    return Chiba-Nishizeki ( G )
18:
end if
19:
return NoneAegypti-fast: inconclusive, not a proof of triangle-freeness
Algorithm 2 Chiba-Nishizeki ( G ) : exact O ( n + m 3 / 2 ) adjacency-intersection detection.
Require: 
Simple undirected graph G = ( V , E ) , no self-loops
Ensure: 
A triangle { u , v , w } if one exists, else None
1:
if  | V | < 3 or  | E | = 0  then
2:
    return None
3:
end if
4:
adj [ v ] set ( N ( v ) ) for every v                                                        ▹ static adjacency sets
5:
for each edge ( u , v ) E  do
6:
    let (small, large) be the smaller and larger of adj [ u ] , adj [ v ]
7:
    for each w small  do
8:
        if  w u  and  w v  and  w large  then
9:
           return  { u , v , w }
10:
        end if
11:
    end for
12:
end for
13:
return None
The matrix-multiplication routine (is_triangle_free_brute_force), which forms A 3 and tests its diagonal for the adjacency matrix A, is retained in the package only as a reference baseline and is not part of Aegypti.

4. Correctness and Complexity Analysis

4.1. Soundness

Theorem 1 
(Soundness). For either value offallback, ifAegypti ( G , f a l l b a c k ) returns a set { u , v , w } , then { u , v , w } is a triangle of G.
Proof. 
A non-None answer is returned at one of three sites. The sparse branch and the fallback both return the output of Chiba-Nishizeki ( G ) , which returns { u , v , w } only after checking w adj [ u ] and w adj [ v ] for an edge ( u , v ) E , so the three pairs are edges. The dense branch returns { u , v , w } only after the explicit O ( 1 ) test { u , v } , { v , w } , { u , w } E . In all cases the returned set is a triangle. (The dense branch is sound by construction even without the test: by Lemma 1 the set C is a valid cover of G ¯ , so V C is an independent set of G ¯ , hence a clique of G by Proposition 2; the test is a constant-time safeguard against a cover-routine fault.)    □

4.2. Completeness

Completeness holds outright in the sparse regime. In the dense regime it depends on the variant.
Theorem 2 
(Sparse-regime completeness). If m n 4 / 3 and G contains a triangle, thenAegypti ( G , f a l l b a c k ) returns one, for either value offallback.
Proof. 
Here the algorithm returns the output of the complete detector Chiba-Nishizeki ( G ) : its edge scan searches, for every edge, the smaller endpoint neighbourhood for a common neighbour, so a triangle { a , b , c } is found when the first of its three edges is scanned [5].    □
Theorem 3 (Unconditional completeness ofAegypti-safe)With f a l l b a c k = t r u e ,Aegypti ( G ) returns a triangle if and only if G contains one.
Proof. 
“Only if” is Theorem 1. For “if”, suppose G has a triangle. If m n 4 / 3 , apply Theorem 2. Otherwise the dense branch either returns a certified triangle, or reaches line 19 and returns C h i b a N i s h i z e k i ( G ) , an exact detector that finds the triangle.    □
The fast variant is, by contrast, a one-sided certifier: it never returns a false triangle, but a None answer is conclusive only under the condition below. We state this prominently to forestall misreading.
Theorem 4 (Dense-regime completeness ofAegypti-fast)Let m > n 4 / 3 and f a l l b a c k = f a l s e . The dense branch returns a triangle if and only if the cover C returned byHvalaon G ¯ satisfies | C | n 3 . Since | C | 2 OPT VC ( G ¯ ) = 2 n ω ( G ) by Lemma 1 and Proposition 2, this is guaranteed whenever
ω ( G ) n + 3 2 .
Proof. 
The branch returns a triangle exactly when | I | = n | C | 3 , i.e. | C | n 3 ; soundness is Theorem 1. For the sufficient condition, | C | 2 OPT VC ( G ¯ ) and OPT VC ( G ¯ ) = n α ( G ¯ ) = n ω ( G ) , so n | C | 2 ω ( G ) n 3 exactly when (1) holds.    □
Remark 1 (The fast variant is a certifier; None is not a triangle-free proof). Condition (1) is what the factor-2 bound alone guarantees: a clique on more than half the vertices. Outside it—a dense graph with a triangle but only small cliques—the fast variant may returnNoneon a triangle-containing input. Its failure to return a triangle is therefore not evidence of triangle-freeness unless Hypothesis 1 below is known to hold for the Hvala implementation. Use Aegypti-safe when a decision (not just a certificate) is required.
Hypothesis 1 
(Hvala independent-set completeness). For every finite simple graph H with α ( H ) 3 , the cover returned by H v a l a V e r t e x C o v e r ( H ) leaves at least three vertices uncovered.
Remark 2 
(Hypothesis 1 is the central open problem, not a mild detail). Applied to H = G ¯ (so α ( G ¯ ) = ω ( G ) ), Hypothesis 1 says exactly: whenever G has a triangle,Hvalaexposes at least three uncovered vertices in G ¯ . This is essentially the dense-branch completeness problem itself, so we present it as the framework’s principal open question rather than a supporting assumption. It isnota consequence of the 2-approximation: Hvalareturns amaximalindependent set of G ¯ , and a maximal independent set can be strictly smaller than a maximum one—the independent domination number can be 2 while α = 3 (e.g. the five-vertex graph with edges { a x , b x , c y } ). A worst-case 2-approximate cover can leave only 2 ω ( G ) n < 3 vertices uncovered. Aegypti-safe removes the dependency entirely; Section 6 reports the empirical behaviour, including on families built to attack Hypothesis 1.

4.3. Running Time and Space

Theorem 5 
(Running time). On every simple undirected graph G = ( V , E ) :Aegypti-fastruns in O ( n 2 ) time and space;Aegypti-saferuns in O ( n + m 3 / 2 ) time and O ( n 2 ) space. The Chiba–Nishizeki sub-routine runs in O ( n + m 3 / 2 ) time.
Proof. 
Chiba–Nishizeki. Building the adjacency sets is O ( n + m ) . The scan does, per edge { u , v } , work min ( d ( u ) , d ( v ) ) . Splitting vertices at degree m : an edge with both endpoints of degree m contributes m , and there are at most m such edges, for O ( m 3 / 2 ) ; an edge with an endpoint of degree > m is charged to that endpoint, and since v d ( v ) = 2 m there are at most 2 m such vertices, each contributing u min ( · ) u d ( u ) = 2 m over its incident edges, again O ( m 3 / 2 ) . Hence { u , v } E min ( d ( u ) , d ( v ) ) = O ( m 3 / 2 )  [5]; adding the O ( n + m ) initialisation of the adjacency sets (over all n vertices, including isolated ones), the routine runs in O ( n + m 3 / 2 ) time and O ( n + m ) space.
Sparse branch ( m n 4 / 3 , both variants). The above is O ( ( n 4 / 3 ) 3 / 2 ) = O ( n 2 ) time and O ( n 2 ) space.
Dense branch ( m > n 4 / 3 ). Forming G ¯ touches each of the n 2 pairs once, O ( n 2 ) time and a graph of size O ( n 2 ) . Hvala on G ¯ costs O ( | V | + | E ¯ | ) = O ( n 2 ) (Lemma 1); cover removal, selection, and the O ( 1 ) certification are O ( n ) . So the dense branch up to line 19 is O ( n 2 ) .
For Aegypti-fast the dense branch ends there: total O ( n 2 ) across both regimes. For Aegypti-safe, an inconclusive dense branch additionally runs Chiba–Nishizeki, adding O ( n + m 3 / 2 ) , so the worst-case time is O ( n + m 3 / 2 ) and the space O ( n 2 ) .    □
Remark 3 
(Why the threshold is n 4 / 3 ). The crossover is the m at which the sparse cost m 3 / 2 reaches the dense cost n 2 : m 3 / 2 = n 2 m = n 4 / 3 . Splitting at n 4 / 3 caps the fast variant at O ( n 2 ) uniformly.

4.4. Position Relative to the Barriers

The fast branch has a quadratic worst-case running time, but because its dense-regime completeness is conditional (Remark 1 and Remark 2), this should not be read as an unconditional improvement over complete algebraic triangle detection, whose best exponent stands at ω < 2.371339  [7]. Comparing a one-sided certifier to a complete algorithm would be unfair, and we do not. The unconditionally complete variant, Aegypti-safe, runs in O ( m 3 / 2 ) —the classical combinatorial regime—so the framework refutes no fine-grained lower-bound conjecture [9,10]; those bounds are model-sensitive and connect triangle, matrix, and path problems by subcubic reductions. What Aegypti contributes is structural: a sound, certificate-producing, linear-time dense preconditioner that, on every instance we tested, lets the quadratic branch decide the problem without invoking the fallback.

6. Experimental Evaluation

We validate the implementation with the reproducible car/ experiment in the repository. It runs four routines, scoring each against an independent exact oracle (triangle existence by direct neighbourhood intersection): Aegypti-safe (fallback=True), Aegypti-fast (fallback=False), find_triangle_chiba_nishizeki, and the is_triangle_free_brute_force baseline. For every dense-regime instance the harness additionally records the cover diagnostics that decide Aegypti-fast completeness: | C | , the uncovered count | V C | , ω ( G ) (exact, for n 24 ), OPT VC ( G ¯ ) = n ω ( G ) , the ratio | C | / OPT VC ( G ¯ ) , and the miss / fallback flags.
Benchmark.
The suite combines three groups. (i) Random and structured families: sparse Erdos–Rényi ( n [ 12 , 60 ] , p { 0.02 , 0.04 , 0.06 , 0.08 } ), dense Erdos–Rényi ( n [ 10 , 40 ] , p { 0.4 , 0.55 , 0.7 , 0.85 } ), triangle-free bipartite, planted-triangle sparse graphs, planted-clique dense graphs, and structured graphs (complete, even cycles, wheels, complete bipartite, random regular). (ii) Adversarial dense, small clique number: complete tripartite K a , b , c (dense, ω = 3 , K 4 -free), complete 4-partite K a , b , c , d ( ω = 4 , K 5 -free), and balanced complete bipartite plus one intra-part edge (dense, ω = 3 )—families where “has a triangle” is far from “has a large clique”, precisely the regime that stresses Hypothesis 1. (iii) Exhaustive: all graphs on at most seven vertices (the NetworkX Graph Atlas), giving complete coverage of small cases. A fixed seed makes the run deterministic.
Reproducibility.
The baseline forms A 3 by sparse int8 matrix products (SciPy CSR) and tests the diagonal; it is a practical linear-algebra check, not an implementation of an O ( n ω ) algorithm. The dense/sparse split uses n 4 / 3 exactly as in the dispatch. Each run records the platform string and the NetworkX, NumPy, and SciPy versions in car_experiment.json; the cover is the hvala package, the detectors the aegypti package (both at the repository version). The run reported below used Python 3.12.3, NetworkX 3.6.1, and NumPy 2.4.6 on a Windows 11 workstation. Per-instance and aggregate outputs (car_by_instance.csv, car_summary.csv, car_experiment.json) are emitted next to the script.
Correctness.
Across the full benchmark of 12 , 330 instances ( 8 , 860 triangle-containing), all four routines returned the oracle-correct verdict on every instance; the three witness-returning routines (both Aegypti variants and Chiba–Nishizeki) returned a valid triangle on every positive instance, with 0 disagreements and 0 invalid witnesses. Decisively for the one-sided fast variant, Aegypti-fast recorded 0 misses among the 4 , 799 triangle-containing dense instances: its dense branch left at least three vertices uncovered on every one. The Aegypti-safe fallback was entered on only 840 dense instances—all of them triangle-free, where returning None is correct—and never on a triangle-containing graph. Table 1 reports the mean running times. On these deliberately small instances the asymptotic gap between the O ( n 2 ) and matrix-multiplication methods is not visible; the value of the dispatch is the uniform O ( n 2 ) ceiling for the fast variant (Theorem 5), not a constant-factor win.
Stressing the dense branch.
Table 2 reports the dense-branch diagnostics on the families where “triangle” and “large clique” come apart. On the adversarial small-clique families—complete tripartite ( ω = 3 ), complete 4-partite ( ω = 4 ), and balanced bipartite plus one edge ( ω = 3 )—and on the exhaustive sweep of all graphs with n 7 , Hvala returned an optimal cover of the complement (ratio | C | / OPT VC ( G ¯ ) = 1.0 ) on every instance, leaving exactly ω ( G ) 3 vertices uncovered, and the fast branch certified a triangle on all of them. The largest cover ratio anywhere in the benchmark was 1.2 (dense Erdos–Rényi), and even there the minimum uncovered count over triangle-containing dense instances was 3—never below the threshold of Theorem 4. The exhaustive n 7 sweep ( 1 , 244 graphs, 91 of them in the dense regime) passed with no miss, a complete small-case certificate: a single miss in any of these families would have been the sharpest signal against Hypothesis 1. This remains finite evidence—it does not prove Hypothesis 1—and Aegypti-safe is what guarantees completeness in its absence.

7. Conclusion

We presented Aegypti, a triangle-detection framework that dispatches on density at n 4 / 3 : exact Chiba–Nishizeki on sparse inputs, and on dense inputs a single linear-time Hvala vertex cover of the complement whose uncovered vertices yield a certified triangle. The framework is sound on every graph. Aegypti-fast is a uniform O ( n 2 ) , one-sided certifier—complete in the sparse regime and, in the dense regime, under the explicit cover condition of Theorem 4—while Aegypti-safe adds an exact fallback and is unconditionally complete (Theorem 3) at a worst-case cost of O ( n + m 3 / 2 ) . The honest reading is a sound quadratic certifier with an unconditional O ( n + m 3 / 2 ) fallback detector, not an unconditional quadratic detector. A reference implementation is available in the aegypti Python package [15], which depends on hvala [16].
Open problems.
  • Hypothesis 1 (central). Does the Hvala ensemble leave at least three vertices uncovered on every graph with α 3 ? A proof would make Aegypti-fast an unconditionally complete O ( n 2 ) detector; a counterexample would pinpoint exactly where the fallback is indispensable. This is the framework’s principal open question.
  • Avoiding explicit complementation. The dense branch spends O ( n 2 ) materialising G ¯ . Can Hvala run implicitly on the complement to lower the constant?
  • Counting. Does the cover/complement view extend from detecting one triangle to counting or listing triangles within the same budget?

References

  1. Watts, D.J.; Strogatz, S.H. Collective Dynamics of `Small-World’ Networks. Nature 1998, 393, 440–442. [Google Scholar] [CrossRef] [PubMed]
  2. Buluç, A.; Gilbert, J.R. The Combinatorial BLAS: Design, Implementation, and Applications. Int. J. High Perform. Comput. Appl. 2011, 25, 496–509. [Google Scholar] [CrossRef]
  3. Ngo, H.Q.; Porat, E.; Ré, C.; Rudra, A. Worst-Case Optimal Join Algorithms. In Proceedings of the Proceedings of the 31st ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems (PODS 2012), 2012; ACM; pp. 37–48. [Google Scholar] [CrossRef]
  4. Bron, C.; Kerbosch, J. Algorithm 457: Finding All Cliques of an Undirected Graph. Commun. ACM 1973, 16, 575–577. [Google Scholar] [CrossRef]
  5. Chiba, N.; Nishizeki, T. Arboricity and Subgraph Listing Algorithms. SIAM J. Comput. 1985, 14, 210–223. [Google Scholar] [CrossRef]
  6. Itai, A.; Rodeh, M. Finding a Minimum Circuit in a Graph. SIAM J. Comput. 1978, 7, 413–423. [Google Scholar] [CrossRef]
  7. Alman, J.; Duan, R.; Williams, V.V.; Xu, Y.; Xu, Z.; Zhou, R. More Asymmetry Yields Faster Matrix Multiplication. Preprint. 2024. Available online: https://arxiv.org/abs/2404.16349.
  8. Alon, N.; Yuster, R.; Zwick, U. Finding and counting given length cycles. Algorithmica 1997, 17, 209–223. [Google Scholar] [CrossRef]
  9. Williams, V.V.; Williams, R. Subcubic Equivalences Between Path, Matrix and Triangle Problems. In Proceedings of the Proceedings of the 51st Annual IEEE Symposium on Foundations of Computer Science (FOCS 2010), 2010; pp. 645–654. [Google Scholar] [CrossRef]
  10. Abboud, A.; Williams, V.V. Popular Conjectures Imply Strong Lower Bounds for Dynamic Problems. In Proceedings of the Proceedings of the 55th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2014), 2014; pp. 434–443. [Google Scholar] [CrossRef]
  11. Vega, F. An Approximate Solution to the Minimum Vertex Cover Problem: The Hvala Algorithm. Gauge Freedom J. 2026, 1. [Google Scholar] [CrossRef]
  12. Latapy, M. Main-memory Triangle Computations for Very Large (Sparse (Power-Law)) Graphs. Theor. Comput. Sci. 2008, 407, 458–473. [Google Scholar] [CrossRef]
  13. Ortmann, M.; Brandes, U. Triangle Listing Algorithms: Back from the Diversion. In Proceedings of the Proceedings of the 16th Workshop on Algorithm Engineering and Experiments (ALENEX 2014), 2014; SIAM; pp. 1–8. [Google Scholar] [CrossRef]
  14. Williams, V.V.; Xu, Y.; Xu, Z.; Zhou, R. New Bounds for Matrix Multiplication: from Alpha to Omega. In Proceedings of the Proceedings of the 35th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2024) SIAM, 2024; pp. 3792–3835. [Google Scholar] [CrossRef]
  15. Vega, F. Aegypti: Triangle-Free Solver. Software package. 2026. Available online: https://pypi.org/project/aegypti/.
  16. Vega, F. Hvala: Linear-Time Vertex Cover Approximation. Software package. 2026. Available online: https://pypi.org/project/hvala/.
Table 1. Mean per-instance running time (milliseconds) of the four routines on the full 12 , 330 -instance benchmark, by family and by dispatch regime. “With Δ” counts triangle-containing instances (exact oracle). Every routine matched the oracle on every instance, with no invalid witnesses; Aegypti-fast recorded no triangle-containing dense miss.
Table 1. Mean per-instance running time (milliseconds) of the four routines on the full 12 , 330 -instance benchmark, by family and by dispatch regime. “With Δ” counts triangle-containing instances (exact oracle). Every routine matched the oracle on every instance, with no invalid witnesses; Aegypti-fast recorded no triangle-containing dense miss.
Family Instances With Δ Aeg.-safe Aeg.-fast Chiba–Nish. Matrix mult.
(ms) (ms) (ms) (ms)
er_sparse 2486 1139 0.040 0.036 0.023 0.115
planted_triangle 1500 1500 0.037 0.034 0.020 0.110
atlas ( n 7 ) 1244 1080 0.023 0.021 0.007 0.100
structured 1000 541 0.218 0.203 0.027 0.119
tri_free_bipartite 1500 0 0.925 0.873 0.054 0.123
omega3_tripartite 400 400 0.644 0.669 0.018 0.130
omega4_fourpartite 300 300 0.611 0.657 0.020 0.137
near_turan 400 400 1.613 1.706 0.023 0.140
er_dense 2500 2500 1.417 1.422 0.028 0.175
planted_clique 1000 1000 1.435 1.390 0.025 0.160
Sparse regime ( m n 4 / 3 ) 6691 4061 0.034 0.030 0.019 0.111
Dense regime ( m > n 4 / 3 ) 5639 4799 1.353 1.342 0.034 0.156
Overall 12330 8860 0.637 0.630 0.026 0.132
Table 2. Dense-branch diagnostics for Aegypti-fast, over the instances that take the dense branch. “Dense” and “Dense ▵” count dense-regime and triangle-containing dense-regime instances; “Fallback” counts those where the fast branch was inconclusive (always triangle-free, where None is correct); “max | C | / OPT ” is the worst observed Hvala cover ratio on G ¯ ( n 24 ); “min | V C | ” is the smallest uncovered count over triangle-containing dense instances. No triangle-containing dense instance was ever missed.
Table 2. Dense-branch diagnostics for Aegypti-fast, over the instances that take the dense branch. “Dense” and “Dense ▵” count dense-regime and triangle-containing dense-regime instances; “Fallback” counts those where the fast branch was inconclusive (always triangle-free, where None is correct); “max | C | / OPT ” is the worst observed Hvala cover ratio on G ¯ ( n 24 ); “min | V C | ” is the smallest uncovered count over triangle-containing dense instances. No triangle-containing dense instance was ever missed.
Family Dense Dense Δ Fallback max | C | / OPT min | V C |
omega3_tripartite 400 400 0 1.00 3
omega4_fourpartite 300 300 0 1.00 4
near_turan 400 400 0 1.00 3
atlas ( n 7 ) 91 91 0 1.00 3
er_dense 2425 2425 0 1.20 3
planted_clique 987 987 0 1.17 3
structured 365 196 169 1.00 3
tri_free_bipartite 671 0 671 1.00
Overall 5639 4799 840 1.20 3
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2026 MDPI (Basel, Switzerland) unless otherwise stated

Accessibility

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings