r/algorithms • • 16d ago

Research/Papers Implementation of Andreas Bjorklund's algorithm for determining hamiltonicity

16 Upvotes

Hello, I want to share a project that i've been working on for the last month or so. It's and implementation (from what i could find the only rn on the internet) of Andreas Bjorklund's theoretical algorithm for determining weather a graph is hamiltonian or not. The algorithm is revolutionary because it lowered the exponential part of the time complexity of Held-Karp which is the standard algorithm for determining weather a graph is hamiltonian, from O^*(2^n) to O^*(1.657^n) for general graphs(this is what i've managed to implement as of right not) and for bipartite its O^*(1.414^n).

It might have some logical errors, and could maybe be optimised but right now, as of writting this it is 4AM and i want to sleep.

link to paper: https://arxiv.org/pdf/1008.0541
link to the github repo: https://github.com/Ak0-m/Bjorklunds_algorithm_for_Hamiltonicity

r/algorithms • • Sep 20 '26

Research/Papers O(r^N) to O(r^2): An integer-native "row-collapse" algorithm for exact lattice enumeration (bypassing FPU drift)

13 Upvotes

Hi r/algorithms,

I’m an independent researcher and I recently published a 4-paper suite detailing an exact, integer-native framework that collapses the computational complexity of high-dimensional lattice point enumeration. I'd love to finally get further input from people who KNOW. Rigorous proving in the papers, plus executable code to put the proof. In that pudding.

(I've already extended and originated new sequences on OEIS using this framework. It truly brings "forever" or "intractable" to "now" and "bit-perfect in no time.")

Here's the skinny, including Zenodo links and GitHub Repos active and waiting:

Collapsing High-Dimensional Lattice Enumeration from O(rN) to Quasi-Quadratic O(r2 log_2 N log r)

For over two centuries, the standard approach to discrete lattice point enumeration has relied on continuous Euclidean tools—transcendental functions, Bessel expansions, modular forms, and floating-point approximations—projected onto integer grids. This approach frequently runs into boundary-vertex collisions, floating-point precision drift, and the classical exponential coordinate bottleneck.

Instead of forcing continuous calculus onto discrete space, I developed an integer-native geometric framework that treats discrete grids on their own native algebraic terms. By recognizing that squared Euclidean distance is additively separable across orthogonal submanifolds, high-dimensional boundaries can be decoupled and evaluated via single-pass integer dot products and discrete cross-convolutions.

The complete research suite consists of four preprints establishing the theoretical derivations, asymptotic complexity proofs, and hardware-native C++ reference implementations:

  • Paper I: An Integer-Only Orthotropic Lattice Enumeration Framework and Asymptotic Convergence of Discrete Rational π

    • Core Premise: Couples orthotropic boundaries 4r ± 1 to construct Diophantine parity constraints that mathematically prohibit boundary-vertex collisions.
    • Result: Resolves boundary discrepancy and derives a deterministic, rational convergence envelope for discrete π_d ∈ ℚ.
    • Zenodo DOI: 10.5281/zenodo.22282210 | GitHub: orthotropic-parity-and-discrete-pi
  • Paper II: A Dimension-Paired Combinatorial Framework: Asymptotic O(r2) Reduction and O(r2 log_2 N log r) Generalized Convolution for High-Dimensional Discrete Lattice Enumeration

    • Core Premise: Decomposes 4D space as orthogonal planes (Z4 ≅ Z2 × Z2), reducing 4-space enumeration from O(r4) to a single-pass 1D dot product in strict O(r2) without floating-point operations.
    • Generalization: Applies recursive bisection via Number Theoretic Transforms (NTT) in finite fields Z_p[t], collapsing N-dimensional ball enumeration to O(r2 log_2 N log r).
    • Zenodo DOI: 10.5281/zenodo.22509388 | GitHub: dimension-paired-cross-convolution
  • Paper III: Hierarchical Dimension-Pairing: Hardware-Native O(r2) Enumeration of 5D through 8D Spherical Lattices and High-Dimensional Capacity Limits

    • Core Premise: Neutralizes the historical odd-dimension class-number barrier for Z5 and Z7 by slicing 1D axial profiles against precomputed even-dimensional hyperdisk profiles.
    • Empirical Scaling: Verifies sequences against OEIS baselines (A000333–A000336), and benchmarks a 1024-dimensional R = 2896 hyperball (output = 831168560 (mod 998244353)) in 1561.833 ms on a single desktop core. Extended OEIS
    • Zenodo DOI: 10.5281/zenodo.22691273 | GitHub: hierarchical-ntt-bisection
  • Paper IV: Parity-Filtered Bisection: Hardware-Native O(r2) Enumeration of Optimal D_N Lattices

    • Core Premise: Extends the bisection architecture beyond primitive grids to dense, non-orthogonal kissing-number lattices. By redefining geometries as parity-constrained sublattices of ZN (∑ x_i ≡ 0 (mod 2)), internal coordinate staggering is fully absorbed into pre-filtered arrays.
    • Result: Achieves hardware-native O(r2) exact enumeration for Face-Centered Cubic (D_3), the 24-cell honeycomb (D_4), and the D_8 root lattice, verified bit-for-bit against OEIS A005875, A004011, and A004013.
    • Zenodo DOI: 10.5281/zenodo.22824219 | GitHub: parity-filtered-kissing-lattices

The Empirical Validation

The C++ implementations are designed as self-contained, reproducible test benches running exclusively on 64-bit integer ALUs with zero floating-point emulation: * Resolving 246+ million points in the 4D 24-cell honeycomb at R=100 in 2 ms on consumer hardware. * Pushing the finite-field Number Theoretic Transform (NTT) bisection tree to its theoretical single-prime 2-adic ceiling (R = 2896, transform size M = 223), evaluating a 1024-dimensional hyperball across an 8.38-million-element ring in 1,561 ms on a single desktop core. * Evaluating 7-dimensional bounding hyperballs from R = 0..5000, culminating in a bit-perfect 27-digit lattice point count, thereby extending OEIS A055413 from R = 0..500 to R = 0..5000.

All four preprints, source code, and benchmark suites are open-access. Feedback on the combinatorial proofs, algorithmic bounds, and hardware pipelining is welcome. And, if you like it, please, spread the word!


The Discrete Lattice Research Suite

This repository is part of a 4-paper research program establishing hardware-native, integer-only lattice enumeration:

  1. orthotropic-parity-and-discrete-pi: 3D row-collapse, 4r ± 1 parity bounds, and rational π_d ∈ ℚ convergence. [Zenodo DOI: 10.5281/zenodo.22282210]
  2. dimension-paired-cross-convolution: 4D orthogonal plane bisection (O(r2)) and generalized NTT convolution (O(r2 log_2 N log r)). [Zenodo DOI: 10.5281/zenodo.22509388]
  3. hierarchical-ntt-bisection: 5D–8D odd-dimension slicing, OEIS A000333–A000336 verification, and N=1024 NTT scaling. [Zenodo DOI: 10.5281/zenodo.22691273]
  4. parity-filtered-kissing-lattices: Exact O(r2) kissing-number root lattices (D_3 FCC, D_4 24-cell, and D_8). [Zenodo DOI: 10.5281/zenodo.22824219]

r/algorithms • • 4d ago

Research/Papers Converting any text input to beautiful and coherent landscapes

7 Upvotes

I created a function that turns any text ("hello world", your name, a random phrase) into a landscape image, images themselves are not LLM generated, but algorithmically rendered. Here is the white paper https://beautifulhash.com/algorithm

r/algorithms • • 14d ago

Research/Papers Stop blind-guessing algorithms: Why allocating 1% of your compute budget to "Landscape Reconnaissance" yields 4.5x speedups in NP-Hard problems.

6 Upvotes

TL;DR: Instead of immediately throwing 100% of our compute budget at a solver and hoping for the best, inserting a lightweight "reconnaissance" pipeline to measure landscape ruggedness and constraint density (costing <0.5% of total time) can dictate exactly which algorithm to use, yielding massive wall-clock speedups.

Hey everyone,

I’ve been doing some deep research into how we handle the pipeline between "building a mathematical model" and "deploying a solver" for large-scale optimization problems (VRP, MKP, Scheduling, etc.).

It feels like the industry standard is still heavily reliant on trial-and-error: Should we use a Genetic Algorithm here? Simulated Annealing? Let's just run a grid search on hyperparameters and burn some AWS credits to find out.

I recently formalized a framework based on a very simple military philosophy: The scouts are the brain; the solver is the muscle.

Instead of blind deployment, I proposed a Dynamic Reconnaissance-Flattening (DRF) Pipeline. Before the main solver fires up, we send a tiny batch of "scouts" (e.g., 50 Sobol sampled points) to evaluate the loss landscape. We measure three universal metrics:

  1. Ruggedness
  2. Constraint Density
  3. Gradient Smoothness

Based on these metrics, the pipeline acts as a dispatcher, automatically assigning the correct algorithm and parameters.

Here are the actual benchmark results from the papers:

  • For Routing (VRP): By using the reconnaissance data to perform "Angular partition cutting" (flattening the terrain before solving), we saw a +74% performance improvement compared to raw solving.
  • For Multi-dimensional Knapsack ($n=5000$): Allocating just 0.5% of the compute budget to reconnaissance and dynamic resolution shifting resulted in a 4.5x wall-clock speedup and a 61% improvement in solution quality.

Why this isn't Snake Oil (The SAT Test):

The most important part of this pipeline is its discipline. When the reconnaissance scouts hit a Boolean Satisfiability (SAT) problem in the phase transition region, the pipeline doesn't try to aggressively smooth it out. It correctly diagnoses it as a "Hard Wall" (discrete cliffs), abandons the heuristic intervention, and hands it straight to CDCL solvers. It knows what it can't do.

I’ve published the complete theoretical taxonomy (dividing NP-hard problems into 7 boxes) and the DRF pipeline architecture as open-access whitepapers on Zenodo.

📄 Paper 1 (The Taxonomy & Reconnaissance): https://doi.org/10.5281/zenodo.19510539

📄 Paper 2 (The DRF Pipeline): https://doi.org/10.5281/zenodo.19600597

I’m currently working on turning this into a lightweight, open-source Python middleware (drf-scout). The goal is to let developers pass their objective function, have the middleware run the 1% reconnaissance, and automatically dispatch to the best open-source solver (like OR-Tools or PySAT).

I’d love to hear your thoughts. How do you currently handle algorithm selection? Do you rely on pure experience, or do you have any pre-solve diagnostic tools in your workflow?

r/algorithms • • Aug 17 '26

Research/Papers A Geometric, Best-Improvement Heuristic for the Travelling Salesman Problem

0 Upvotes

I spent six months in 2021 building a TSP solver from geometric first principles, with no prior reading of the literature. Recently turned it into an interactive web app with step-by-step animation of every algorithmic move.

Interesting result: the algorithm independently rediscovered convex hull seeding and 2-opt uncrossing. It also produced a farthest-neighbour strategy I haven't seen documented.

On Berlin52: 7783 vs world optimal 7542 (3.2% above). 14ms on a single CPU core.

Demo: tsp.uncledroid.app
Paper: tsp.uncledroid.app/paper.pdf

Happy to discuss the algorithm — especially if anyone can point me to prior work on farthest-neighbour as a TSP construction heuristic.

video: youtu.be/92z670RTsJg