alphaFeedback

WorksComputer Science

Counting Hamiltonian cycles in sparse graphs in subexponential time, assuming the new #SAT algorithms

AI contributions
  • Anthropic Claude Fable
  • Anthropic Claude Opus
View details
Ancillary data
1 code link
View

Abstract

In October 2026 two manuscripts claimed refutations of the Exponential Time Hypothesis by deterministic algorithms for #k\#k-SAT, each with a Lean formalisation of its top-level statement. Neither result applies directly to connectivity problems such as Hamiltonicity, because no linear-size CNF encoding of "this edge set is a single cycle" is known. This paper derives a corollary of the Anthropic manuscript: assuming three of its internal results (a network-to-clique reduction, an algorithm for cliques of all levels, and the existence of its "pieces"), the number of Hamiltonian cycles of a graph with nn vertices and at most DnDn edges can be computed exactly and deterministically in time O(2δn)O(2^{\delta n}) for every δ>0\delta>0, and in time 2O(max⁡(m,n)/log⁡n)2^{O(\max(m,n)/\sqrt{\log n})} for a graph with mm edges. A rank-encoded variant of the construction gives 2O(nlog⁡dˉ/log⁡n)2^{O(n\log\bar d/\sqrt{\log n})} for average degree dˉ\bar d. Deterministic decision, search and Hamiltonian-path counting follow, and so do exact sparse TSP with polynomially bounded weights, exact counting of directed Hamiltonian cycles, and ATSP. The result is not a standalone breakthrough; it stands or falls with the claimed refutation. The ingredients are known: the folklore matrix-tree identity on 22-factors, the fermionic (Berezin) matrix-tree theorem of Caracciolo, Jacobsen, Saleur, Sokal and Sportiello, and the blob partitions of Cut&Count. What is new is the observation that connectivity can be encoded with O(1)O(1) bits per edge through a Grassmann determinant whose only non-local part is a sign, and that this sign costs only O(g3)O(g^3) bits for gg blobs, so the whole construction is a network in the sense of the manuscript, whose value is n⋅#HC(G)n\cdot\#\mathrm{HC}(G). Every theorem we claim is formally verified in Lean, end to end, on top of the manuscript's own Lean development: the three counting theorems, the decision, search and path corollaries, sparse TSP, directed Hamiltonian cycles and ATSP, using only the standard axioms, with fresh kernel replays. The Lean sources are at https://github.com/xennygrimmato/eth-hamiltonicity. We also record weaker results that rest only on the machine-checked top-level theorems: the parity of #HC(G)\#\mathrm{HC}(G) for every graph in time 2O((m+n)/log⁡(m+n))2^{O((m+n)/\sqrt{\log(m+n)})} (machine-checked in Lean, with the hypotheses discharged by the labs' own Lean proofs), and one-sided randomized decision. We describe what is proved, what is checked numerically, what is formalised, what is assumed, and what the limitations are.

Introduction

Background

The Exponential Time Hypothesis (ETH) of Impagliazzo and Paturi [27] asserts that there is δ>0\delta> 0 such that 3-SAT on nn variables cannot be solved in time O(2δn)O(2^{\delta n}). Together with the sparsification lemma [28] it underlies a large body of conditional lower bounds [33, 18]. Among them is the statement that, unless ETH fails, Hamiltonian Cycle has no 2o(n+m)2^{o(n+m)}-time algorithm on graphs with nn vertices and mm edges [18 Ch. 14] (see also [33 Thm. 3.3], stated there as the absence of a 2o(n)2^{o(n)}-time algorithm for Hamiltonian Path).

In October 2026 two manuscripts appeared, by OpenAI [35] and by Anthropic [15], each claiming a deterministic algorithm that counts the satisfying assignments of a kk-CNF in subexponential time, and hence a refutation of ETH. Both are accompanied by Lean 4 formalisations of their top-level statements. We stress that these are claimed results that are, at the time of writing, still under review by the community. We write [A] for the Anthropic manuscript [15]. Its Main Theorem gives one deterministic algorithm that counts the models of a kk-CNF with mm clauses on nn variables in time

2O(min⁡{km/log⁡m, k2nlog⁡log⁡n/log⁡n})2^{O(\min\{km/\sqrt{\log m},\, k^2n\log\log n/\sqrt{\log n}\})}

with an absolute constant in the OO. The bound of [35] that is machine-checked is 2Ok(ρ(n))2^{O_k(\rho(n))} with ρ(N)=N(log⁡log⁡N)2/log⁡N\rho(N)=N(\log\log N)^2/\sqrt{\log N}.

A refutation of ETH does not by itself yield fast algorithms for connectivity problems. ETH lower bounds for Hamiltonicity come from linear-size reductions from 3-SAT to Hamiltonian Cycle; an algorithm needs the reverse direction, an encoding of Hamiltonicity as a counting problem on O(n)O(n) Boolean variables with short clauses. Connectivity is a global property and no such encoding is known. Accordingly, the consequences listed by both labs (Independent Set, Vertex Cover, Dominating Set, colouring, circuit lower bounds) are all local problems.

Results

Throughout, G=(V,E)G=(V,E) is a finite simple undirected graph with n=∣V∣n=|V| and m=∣E∣m=|E|, and #HC(G)\#\mathrm{HC}(G) is the number of Hamiltonian cycles of GG, each counted once as a subgraph (so #HC(K4)=3\#\mathrm{HC}(K_4)=3); #HC(G)=0\#\mathrm{HC}(G)=0 if n≤2n\le2. Running times are counted as in [A]: operations on words long enough to hold an address, plus table queries. All logarithms are to base 2.

Our main results are corollaries of [A]: they are conditional on three results of [A], which we recall precisely in § 2, and they inherit whatever doubt attaches to those results. If [A] is wrong, the theorems below lose their proofs.

Hypothesis (HA_A). The following statements of [A] hold as stated there: Lemma 8, case (i) (the reduction from general networks to cliques, Theorem 2.4); Theorem A(a), (b) (one algorithm for the (Kℓ,λ)(K_\ell,\lambda)-cliques of all levels ℓ\ell, Theorem 2.5); and Theorem B (pieces with parameters (1/2,c)(1/\sqrt{2},c), Theorem 2.6).

For Theorem 1.1 it suffices to have the pieces of [A, Lemma 2] (parameter 11/1211/12) in place of Theorem B, or alternatively the main-text pair [A, Lemma 1, Proposition 3] (Theorem 2.7). Nothing else of [A] is used; in particular we do not use its CNF Main Theorem, which does not suffice for our purposes (the fermionic sign below is not local at the level of vertices).

Theorem 1.1 (Exact counting, fixed density). Assume (HA_A). For every real δ>0\delta> 0 and every D≥1D \ge1 there is a deterministic algorithm that, given a graph GG with nn vertices and at most DnDn edges, outputs #HC(G)\#\mathrm{HC}(G) within O(2δn)O(2^{\delta n}) operations.

Theorem 1.2 (Exact counting, explicit rate). Assume (HA)(\mathrm{H}_{\mathrm{A}}). There are an absolute constant C∗C^{*} and one deterministic algorithm that, given any graph GG with n≥2n \ge2 vertices and mm *edges, outputs #HC(G)\#\mathrm{HC}(G) within 2C∗max⁡(m,n)/log⁡n2^{C^{*}\max(m,n)/\sqrt{\log n}} operations. In particular it runs in time 2O(Dn/log⁡n)2^{O(Dn/\sqrt{\log n})} on graphs with m≤Dnm \le Dn, where the OO-constant is absolute and DD may depend on nn.

When the density grows with nn, a variant of the network gives a much better dependence on the degree. Write dˉ:=2m/n\bar d := 2m/n for the average degree and Δ\Delta for the maximum degree.

Theorem 1.3 (Exact counting, maximum/average degree; machine-checked). Assume (HA)(\mathrm{H}_{\mathrm{A}}). There are an absolute constant C♯C^{\sharp} and one deterministic algorithm that, given any graph GG with n≥2n \ge2 vertices, average degree dˉ\bar d and maximum degree Δ\Delta, outputs #HC(G)\#\mathrm{HC}(G) within

2C♯nlog⁡(2emax⁡(dˉ,2))/log⁡n≤2C♯nlog⁡(2emax⁡(Δ,2))/log⁡n2^{C^{\sharp} n\log(2e\max(\bar d,2))/\sqrt{\log n}} \le2^{C^{\sharp} n\log(2e\max(\Delta,2))/\sqrt{\log n}}

operations. In particular it runs in time 2o(n)2^{o(n)} whenever log⁡dˉ=o(log⁡n)\log\bar d=o(\sqrt{\log n}), for example for dˉ=(log⁡n)O(1)\bar d=(\log n)^{O(1)} or dˉ=2(log⁡n)0.49\bar d=2^{(\log n)^{0.49}}.

Theorem 1.3 is machine-checked: the Lean theorem theorem3 gives one Turing machine that outputs #HC(G)\#\mathrm{HC}(G) in binary within ⌊C⋅2Cnlog⁡2(2m/n+2)/log⁡2(n+2)⌋\left\lfloor C\cdot2^{Cn\log_2(2m/n+2)/\sqrt{\log_2(n+2)}}\right\rfloor steps for every graph GG with nn vertices and mm edges, and theorem3\_maxdeg gives the same with log⁡2(Δ+2)\log_2(\Delta+2); both use the standard axioms only (§ 12). For bounded dˉ\bar d it gives the same order 2O(n/log⁡n)2^{O(n/\sqrt{\log n})} as Theorem 1.2; it is stronger when dˉ→∞\bar d\to\infty, because a pair of blobs then shares only the set of used crossing edges between them, rank-encoded, and the labels of those edges, so the total number of shared bits is about 2nlog⁡(2edˉ)2n\log(2e\bar d) instead of 2log⁡25⋅m≈2.32dˉn2\log_2 5\cdot m\approx2.32\bar d n. It does not reach dense graphs: for dˉ=Θ(n)\bar d=\Theta(n) the bound is 2O(nlog⁡n)2^{O(n\sqrt{\log n})}, above 2n2^n (§ 1.6).

Corollary 1.4 (Decision, search and paths; machine-checked). Assume (HA)(\mathrm{H}_{\mathrm{A}}). Within time bounds of the same form as Theorems 1.1 and 1.2 (with a larger constant CC), one can deterministically decide whether GG is Hamiltonian, output a Hamiltonian cycle if one exists, and, for n≥2n\ge2, count, decide and find Hamiltonian paths. The search machine makes n2+1n^2+1 calls to the counting machine, deleting candidate edges in a fixed order; Hamiltonian paths of GG correspond bijectively to Hamiltonian cycles of GG plus an apex vertex.

In Lean these are decision\_TM, search\_TM (fixed density) and decision\_TM\_rate, search\_TM\_rate (rate form), and for paths hamPaths\_count\_TM, hamPaths\_decision\_TM, hamPaths\_search\_TM and their \_rate versions, with the bijection card\_hamPaths\_eq; all use the standard axioms only.

The weighted version is the sparse travelling-salesman problem; it is machine-checked as well.

Theorem 1.5 (Sparse TSP; machine-checked). Assume (HA)(\mathrm{H}_{\mathrm{A}}). For every real δ>0\delta>0 and every D≥1D\ge1 there are a deterministic algorithm and a constant CC such that, given a graph GG with $n vertices and at most DnDn edges and integer edge weights w:E→{0,…,W}w:E\to\{0,\ldots,W\}, the algorithm outputs within C⋅2δn(W+2)C∗stepstheinteger∗C\cdot2^{\delta n}(W+2)^C *steps the integer*n\sum_H 2^{bw(H)}$, b=n2+nb=n^2+n, the sum running over the Hamiltonian cycles HH of GG. *Its base-*2 digit jj is nn times the number of tours of weight exactly jj; the minimum tour weight is the position of the lowest non-zero digit, and the number of optimal tours is that digit divided by nn. In particular the sparse TSP is solved exactly, with its optimum counted, in time 2δnpoly⁡(W)2^{\delta n}\operatorname{poly}(W) for every δ>0\delta>0: subexponential for all weights W=2o(n)W=2^{o(n)}.

In Lean this is theoremTSP and theoremTSP\_decode, built on [A]’s development with the standard axioms only (§ 12). What it does not give is as important: the running time grows with the number of edges, so dense and metric instances (complete graphs, Euclidean TSP) are untouched, and the O∗(2n)O^{*}(2^n) dynamic programme of Bellman and of Held and Karp [3, 26] remains essentially the record there (improved only to 2n−Ω(n/log⁡(nW))poly⁡(W)2^{n-\Omega(\sqrt{n/\log(nW)})}\operatorname{poly}(W) for integer weights up to WW [5], and, for bipartite instances, to O(1.9999n)O(1.9999^n) assuming quadratic-time matrix multiplication [34]); and weights W=2Θ(n)W = 2^{\Theta(n)} remain open (§ 1.6). The identity behind the theorem is the Kronecker substitution z=2bz = 2^b in nn ∑Hzw(H)=∑Xzw(X)κ(X)\sum_H z^{w(H)} = \sum_X z^{w(X)}\kappa(X), the weighted form of Theorem 5.7.

The next two results are weaker but depend only on the top-level theorems of the labs, which are themselves machine-checked; the first is machine-checked end to end on top of them.

Theorem 1.6 (Parity; machine-checked). There is one deterministic algorithm that, for every graph GG with n≥2n \ge2 vertices and mm edges, computes #HC(G) mod 2\#\mathrm{HC}(G) \bmod2 within 2O((m+n)/log⁡(m+n))2^{O((m+n)/\sqrt{\log(m+n)})} steps, assuming the Main Theorem of [A]. Assuming instead the Lean theorem of [35], it does so in time 2O(ρ(5m+3n))2^{O(\rho(5m+3n))} and polynomial space. Both statements are proved in Lean, and the hypotheses are discharged by the labs’ own Lean proofs, rebuilt from source; the resulting theorems depend only on the standard axioms propext\mathtt{propext}, Classical.choice\mathtt{Classical.choice}, Quot.sound\mathtt{Quot.sound}. The analogous statement holds for directed Hamiltonian cycles in digraphs of bounded in- and out-degree.

Theorem 1.7 (Randomized decision).

(a) (Machine-checked, assuming the Lean theorem of [35].) For every Δ\Delta and every δ>0\delta> 0 there is a randomized algorithm with one-sided error that decides Hamiltonicity of graphs of maximum degree Δ\Delta in time 2δn2^{\delta n}. The same holds for digraphs of bounded in- and out-degree.

An earlier version also stated a part (b), a randomized 2OD(n(log⁡log⁡n)2/log⁡n)2^{O_D(n(\log\log n)^2/\sqrt{\log n})} decision procedure for graphs with ∣E∣≤Dn|E| \le Dn. It is superseded by Theorem 1.2 (deterministic, and faster) and is no longer claimed; see Theorem 10.3.

Theorem 1.6 and Theorem 1.7(a) are from an earlier stage of this work and are superseded, as statements, by Theorems 1.1 and 1.4; we include them because they rest on far less. In (a), Lean checks soundness, the success fraction and the machine; only the outer loop of independent trials is not modelled.

§ 11 records further consequences of the same template, for example directed Hamiltonian cycles, TSP with polynomial weights, Steiner trees, feedback vertex sets and the Tutte polynomial on the line y=1y = 1. These are sketched and checked numerically on small instances; they are not fully proved here.

References

  1. [1]Noga Alon and Zoltán Füredi, Covering the cube by affine hyperplanes, European J. Combin. 14 (1993), no. 2, 79–83.DOI
  2. [2]Eric T. Bax, Inclusion and exclusion algorithm for the Hamiltonian path problem, Inform. Process. Lett. 47 (1993), no. 4, 203–207.DOI
  3. [3]Richard Bellman, Dynamic programming treatment of the travelling salesman problem, J. ACM 9 (1962), no. 1, 61–63.DOI
  4. [4]Andreas Björklund, Determinant sums for undirected Hamiltonicity, SIAM J. Comput. 43 (2014), no. 1, 280–299, Preliminary version in FOCS 2010.
  5. [5]——, Below all subsets for some permutational counting problems, Proc. 15th Scandinavian Symposium and Workshops on Algorithm Theory (SWAT), LIPIcs, vol. 53, 2016, pp. 17:1–17:11.arxiv.org/abs/1211.0391
  6. [6]Andreas Björklund and Thore Husfeldt, The parity of directed Hamiltonian cycles, Proc. 54th IEEE Symposium on Foundations of Computer Science (FOCS), 2013, pp. 727–735.arxiv.org/abs/1301.7250
  7. [7]Andreas Björklund, Thore Husfeldt, Petteri Kaski, and Mikko Koivisto, Computing the Tutte polynomial in vertex-exponential time, Proc. 49th IEEE Symposium on Foundations of Computer Science (FOCS), 2008, pp. 677–686.arxiv.org/abs/0711.2585
  8. [8]——, The traveling salesman problem in bounded degree graphs, ACM Trans. Algorithms 8 (2012), no. 2, Art. 18, Preliminary version in ICALP 2008.DOI
  9. [9]Andreas Björklund and Ryan Williams, Computing permanents and counting Hamiltonian cycles by listing dissimilar vectors, Proc. 46th International Colloquium on Automata, Languages, and Programming (ICALP), LIPIcs, vol. 132, 2019, pp. 25:1–25:14.
  10. [10]Hans L. Bodlaender, Marek Cygan, Stefan Kratsch, and Jesper Nederlof, Deterministic single exponential time algorithms for connectivity problems parameterized by treewidth, Inform. and Comput. 243 (2015), 86–111, Preliminary version in ICALP 2013.
  11. [11]Nicolas Bourbaki, Algebra I. Chapters 1–3, Elements of Mathematics, Springer, 1989.
  12. [12]Cornelius Brand, Holger Dell, and Marc Roth, Fine-grained dichotomies for the Tutte plane and Boolean #CSP, Algorithmica 81 (2019), no. 2, 541–556, Preliminary version in IPEC 2016; arXiv:1606.06581.arxiv.org/abs/1606.06581
  13. [13]Chris Calabro, Russell Impagliazzo, Valentine Kabanets, and Ramamohan Paturi, The complexity of Unique k-SAT: an isolation lemma for k-CNFs, J. Comput. System Sci. 74 (2008), no. 3, 386–393, Preliminary version in CCC 2003.
  14. [14]Sergio Caracciolo, Jesper Lykke Jacobsen, Hubert Saleur, Alan D. Sokal, and Andrea Sportiello, Fermionic field theory for trees and forests, Phys. Rev. Lett. 93 (2004), no. 8, 086001.DOI
  15. [15]Claude (Anthropic), A 2(n) time algorithm for 3-SAT, Preprint dated October 26, 2026. Paper and Lean formalisation in the repository https://github.com/anthropics/formal-math, folder eth, 2026.
  16. [16]Radu Curticapean, Block interpolation: a framework for tight exponential-time counting complexity, Inform. and Comput. 261 (2018), 265–280. Preliminary version in ICALP 2015.
  17. [17]Radu Curticapean, Nathan Lindzey, and Jesper Nederlof, A tight lower bound for counting Hamiltonian cycles via matrix rank, Proc. 29th ACM-SIAM Symposium on Discrete Algorithms (SODA), 2018, arXiv:1709.02311, pp. 1080–1099.
  18. [18]Marek Cygan, Fedor V. Fomin, Łukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michał Pilipczuk, and Saket Saurabh, Parameterized algorithms, Springer, 2015.DOI
  19. [19]Marek Cygan, Stefan Kratsch, and Jesper Nederlof, Fast Hamiltonicity checking via bases of perfect matchings, J. ACM 65 (2018), no. 3, Art. 12, Preliminary version in STOC 2013.
  20. [20]Marek Cygan, Jesper Nederlof, Marcin Pilipczuk, Michał Pilipczuk, Johan M. M. van Rooij, and Jakub Onufry Wojtaszczyk, Solving connectivity problems parameterized by treewidth in single exponential time, Proc. 52nd IEEE Symposium on Foundations of Computer Science (FOCS), 2011, Journal version in ACM Trans. Algorithms 18 (2022), no. 2, pp. 150–159.
  21. [21]Leonardo de Moura and Sebastian Ullrich, The Lean 4 theorem prover and programming language, Automated Deduction – CADE 28, Lecture Notes in Comput. Sci., vol. 12699, Springer, 2021, pp. 625–635.DOI
  22. [22]Holger Dell, Thore Husfeldt, Dániel Marx, Nina Taslaman, and Martin Wählén, Exponential time complexity of the permanent and the Tutte polynomial, ACM Trans. Algorithms 10 (2014), no. 4, Art. 21.
  23. [23]Holger Dell, Valentine Kabanets, Dieter van Melkebeek, and Osamu Watanabe, Is Valiant–Vazirani’s isolation probability improvable?, Comput. Complexity 22 (2013), no. 2, 345–383.
  24. [24]David Eppstein, The traveling salesman problem for cubic graphs, J. Graph Algorithms Appl. 11 (2007), no. 1, 61–81.
  25. [25]Fedor V. Fomin and Kjartan Høie, Pathwidth of cubic graphs and exact algorithms, Inform. Process. Lett. 97 (2006), no. 5, 191–196.DOI
  26. [26]Michael Held and Richard M. Karp, A dynamic programming approach to sequencing problems, J. Soc. Indust. Appl. Math. 10 (1962), no. 1, 196–210.
  27. [27]Russell Impagliazzo and Ramamohan Paturi, On the complexity of k-SAT, J. Comput. System Sci. 62 (2001), no. 2, 367–375.DOI
  28. [28]Russell Impagliazzo, Ramamohan Paturi, and Francis Zane, Which problems have strongly exponential complexity?, J. Comput. System Sci. 63 (2001), no. 4, 512–530.
  29. [29]Russell Impagliazzo and Avi Wigderson, P = BP if P requires exponential circuits: derandomizing the XOR lemma, Proc. 29th ACM Symposium on Theory of Computing (STOC), 1997, pp. 220–229.
  30. [30]Richard M. Karp, Dynamic programming meets the principle of inclusion and exclusion, Oper. Res. Lett. 1 (1982), no. 2, 49–51.DOI
  31. [31]Adam R. Klivans and Dieter van Melkebeek, Graph nonisomorphism has subexponential size proofs unless the polynomial-time hierarchy collapses, SIAM J. Comput. 31 (2002), no. 5, 1501–1526.
  32. [32]Samuel Kohn, Allan Gottlieb, and Meryle Kohn, A generating function approach to the traveling salesman problem, Proc. 1977 ACM Annual Conference, 1977, pp. 294–300.DOI
  33. [33]Daniel Lokshtanov, Dániel Marx, and Saket Saurabh, Lower bounds based on the Exponential Time Hypothesis, Bull. Eur. Assoc. Theor. Comput. Sci. EATCS 105 (2011), 41–72.
  34. [34]Jesper Nederlof, Bipartite TSP in O(1.9999^n) time, assuming quadratic time matrix multiplication, Proc. 52nd ACM Symposium on Theory of Computing (STOC), 2020, pp. 40–53.
  35. [35]OpenAI, The Exponential Time Hypothesis is false, Preprint dated 17 October 2026, revised 25 October 2026. Paper and Lean formalisation in the repository https://github.com/openai/math, 2026.
  36. [36]Ran Raz and Boris Spieker, On the “log rank”-conjecture in communication complexity, Combinatorica 15 (1995), no. 4, 567–588.
  37. [37]The mathlib Community, The Lean mathematical library, Proc. 9th ACM SIGPLAN International Conference on Certified Programs and Proofs (CPP), ACM, 2020, pp. 367–381.DOI
  38. [38]Vaibhav Tulsyan, eth-hamiltonicity: Lean 4 formalisation and research notes, Public repository https://github.com/xennygrimmato/eth-hamiltonicity, Lean sources as of commit https://github.com/xennygrimmato/eth-hamiltonicity/tree/ca17a3762bb21ddbe5942eeac9f29fa58123bb42, 2026.
  39. [39]Mingyu Xiao and Hiroshi Nagamochi, An exact algorithm for TSP in degree-3 graphs via circuit procedure and amortization on connectivity structure, Algorithmica 74 (2016), no. 2, 713–741.

Paper details

vlnc:W_v7renkdc
v1 · latestHistory (1)

published · Fresh — published within the last 30 days

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

Anthropic Claude Fable, Anthropic Claude Opus · View statement →

Looking for related papers…
Contents