Topic

Algorithms

Algorithm and data structure discussions covering complexity analysis, competitive programming, and practical implementation insights from developer communities.

What this topic tracks

  • Engineering practices and ecosystem debates
  • Tools, architecture, and implementation lessons
  • Relevant discussions from developer communities

Algorithms · 306 stories

Recent stories

Each story's summary, with the places it was discussed.

Summaries are written by AI from the linked sources. Open the source for full context.

20 stories

Show HN: LatticeDB – Like SQLite but for graph databases

github.com · 25 Aug

Algorithms · Database · NoSQL

LatticeDB is an embedded single-file graph database for local, relationship-heavy workloads.

It unifies graph traversal, HNSW vector similarity, and BM25 full-text search in one query layer, with ACID transactions, WAL-backed durability, event streams, and graph changefeeds. Python, TypeScript, Go, and CLI access it. Benchmarks report sub-microsecond lookups and 0.83 ms 10-NN search at 1M vectors, but single-writer, single-machine design limits scaling.

Artificial-life: A simple (300 lines of code) reproduction of Computational Life

github.com · 6 Mar

Algorithms · Python · Computer Science

This 300-line Python reproduction demonstrates the emergence of self-replicating programs from a grid of Brainfuck-like instructions.

Randomly initialized programs interact, concatenate, and execute, leading to an evolutionary process where efficient replicators eventually dominate the system. It visualizes computational life using uv and a pixel-based instruction mapping.

Show HN: Reverse Minesweeper

sunflowersgame.com · 26 Jul

Algorithms · Computer Science

This guide details the difficulty tuning for Sunflowers, a grid-based logic puzzle.

Difficulty levels—Easy, Medium, Hard, Extreme, and Insane—are determined by specific move types like subsets and what-if chains. An automated engine verifies puzzles by mimicking human deduction, using sub-metrics, step-based time estimation, and strict rules for zero-clue squares to ensure consistent, balanced challenges.

How we can reduce traffic congestion

research.google · 12 Jul

Artificial Intelligence · Algorithms · Business

Google Research conducted a large-scale study in 10 US cities demonstrating that network-aware routing in navigation apps can reduce congestion.

By slightly modifying traffic guidance to disperse vehicle flow away from bottlenecks, they achieved faster driving speeds and lowered CO2 emissions. This experiment provides a scalable framework for cooperative traffic management and suggests future potential for city-wide sustainability.

Static Allocation, Constant Work

matklad.github.io · 2 Sept

Algorithms · Low-Level Programming · Performance

Typed, type-segregated object pools can reduce use-after-free type confusion, though inline enums remain a caveat.

For robust systems, static allocation sets capacity at startup and rejects excess load, avoiding catastrophic OOM failures. Constant Work keeps a fixed collection of objects and processes all entries, improving state reasoning, cache behavior, vectorization, and predictable latency at maximum load.

Dithering – Part 2: The Ordered Dithering

visualrambling.space · 26 Jan

Algorithms · Design Patterns

The article provides a comprehensive visual exploration of ordered dithering, a technique used to simulate a wider range of colors through a limited palette by utilizing a threshold map.

It explains the core concept of quantization, where grayscale shades are converted into black and white patterns based on specific threshold values. The guide highlights the importance of matrix arrangement, contrasting simple patterns with the Bayer matrix to eliminate vertical line artifacts. It further investigates higher-order matrices, such as the 8x8 Bayer matrix, Cluster Dot patterns for a newspaper aesthetic, and the naturalistic Void and Cluster blue noise method. This educational piece clarifies how these mathematical maps determine final pixel arrangements to create smooth gradients and detailed textures in digital images.

OpenAI’s Navier-Stokes release included a Lean 4 formal proof

johndcook.com · 9 Sept

Artificial Intelligence · Algorithms · Programming Languages

OpenAI’s Navier-Stokes result included a machine-verifiable Lean 4 proof, highlighting a dramatic shift in formal mathematics.

Whereas formalizing one textbook page once took about 40 hours, OpenAI verified a 166-page research proof in 17 hours—an estimated four-order-of-magnitude reduction. AI-assisted formal verification could also improve security policies, smart contracts, and mission-critical algorithms.

Needed 1+1, built a functional programming language

hereticpleb.vercel.app · 29 Sept

Algorithms · Low-Level Programming · Programming Languages

What began as a binary-tree arithmetic assignment evolved into graphLang, a functional programming language built in C.

The project adds algebraic data types, closures, environments, custom chunk allocation, and a graph-reduction evaluator. A mark-and-sweep garbage collector reduced fib(40) memory use from over 12 GB to 1.7 MB, though exponential evaluation still took six minutes.

Computation as a universal and fundamental concept

ergo.org · 10 Jul

Algorithms · Science · Computer Science

Tim Roughgarden explores the foundations of computer science, starting with Alan Turing's limits of computation.

He explains algorithmic efficiency, the P vs NP problem, and the implications of NP-completeness. By analyzing what computers can and cannot do, he provides a fundamental overview of computation, ranging from the halting problem to modern challenges in cryptography and AI.

JIT Compiling Code in 5μs

malisper.me · 23 Aug

Algorithms · Low-Level Programming · Performance

The article shows how AI assistance enabled a fast ARM64 JIT compiler in Rust using copy-and-patch assembly stencils.

A toy regex engine demonstrates runtime code generation, executable memory loading, and backtracking. The JIT compiles in about 5μs and matches handwritten performance, delivering roughly 10–20x speedups over interpretation and enabling pgrust to compile every SQL query.

Show HN: Stacked Game of Life

stacked-game-of-life.koenvangilst.nl · 28 Feb

Algorithms · Science · Computer Science

The provided content lists various patterns and controls for a simulation involving Conway's Game of Life.

Key patterns such as Acorn, R-Pentomino, Glider, Diehard, Gosper Gun, and Pulsar are mentioned, along with interface options like camera views, randomization, and reset functions to explore cellular automata dynamics.

How the Lobsters front page works

atharvaraykar.com · 18 Jan

Algorithms · Open Source · Computer Science

The article provides a detailed breakdown of the front page ranking algorithm used by Lobsters, an open-source computing-focused community.

The 'hotness' formula combines a tag-based base modifier, a logarithmic order term derived from scores and comments, a sign multiplier for flags, and a linear age factor. Key findings reveal that the system prioritizes new content by ensuring age eventually outweighs votes, while specific gates prevent controversial or low-quality posts from trending. The author highlights that while the algorithm is technically sound at penalizing junk, the site's unique character is primarily shaped by its strict moderation and invite-only culture. Ultimately, the analysis suggests that early individual engagement, such as upvoting and nuanced commenting, significantly impacts story visibility due to the logarithmic nature of the scoring system.

Show HN: misa77 - a codec that decodes 2x faster than LZ4 (at better ratios)

github.com · 15 Jul

Algorithms · Performance · Programming Languages

misa77 is an LZ-based codec optimized for write-once, read-many workloads.

It excels in decompression throughput while maintaining constant memory usage. While compression is slower, it offers high-performance decoding that often surpasses competitors. Designed for C++20, it provides a lightweight library and a standalone CLI tool for efficient data handling.

ISO PDF spec is getting Brotli – ~20 % smaller documents with no quality loss

pdfa.org · 20 Jan

Algorithms · Cloud Computing · Open Source

The PDF specification is evolving to include Brotli compression, a technology that powers much of the modern web, as a successor to the decades-old Deflate algorithm. iText has introduced a production-ready implementation that reduces PDF file sizes by 15-25% without quality loss.

While currently experimental and awaiting full ISO 32000 standardization, this integration aims to modernize document storage efficiency and reduce infrastructure costs.

When “idle” isn't idle: how a Linux kernel optimization became a QUIC bug

blog.cloudflare.com · 12 May

Algorithms · Performance · Open Source

Cloudflare engineers resolved a 'death spiral' bug in their quiche QUIC implementation where CUBIC congestion control remained pinned at a minimum window after congestion collapse.

The issue stemmed from an incorrect idle-time calculation that erroneously triggered recovery states. By correctly tracking the last ACK time to measure true inactivity, the team restored proper congestion window growth.

Curvature Beziers: Improving on a timeless recipe

acko.net · 24 Aug

Algorithms · Mathematics · Computer Science

The article proposes curvature-aware Bezier editing that preserves endpoint curvature and continuity, replacing misleading tangent-length controls with curvature handles.

It derives tangent lengths from endpoint geometry and curvature via a quartic system, then uses weighted solution selection to avoid jumps and loops. The approach remains compatible with classic Bezier tools, while noting S-bend and inflection ambiguities.

Unicode's transliteration rules are Turing-complete

seriot.ch · 8 Jul

Algorithms · Programming Languages · Computer Science

Unicode UTS #35 transliteration rules, used globally in the ICU library, are Turing-complete.

By leveraging unbounded rewriting and a revisiting cursor, these rules can simulate any 2-tag system, cellular automata like Rule 110, or Turing machines. This finding reveals that locale data files are essentially executable programs, posing potential security implications for systems processing untrusted transliteration rules.

Where it came fromHacker NewsLobstersCreate a Snapbyte.dev digest and choose Algorithms as one of your topics.Build your digest