Feed

Algorithms

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

Articles from the last 30 days

Cosmologically Unique IDs
01Thursday, February 12, 2026

Cosmologically Unique IDs

This explore explores optimal strategies for assigning universally unique IDs to devices throughout human expansion across the galaxy. It compares probabilistic methods using random numbers with deterministic tree-based schemes like Dewey and Binary. While deterministic systems offer certainty, the analysis indicates random 798-bit IDs are more scale-efficient for universal growth.

Show HN: Algorithmically Finding the Longest Line of Sight on Earth
02Monday, February 9, 2026

Show HN: Algorithmically Finding the Longest Line of Sight on Earth

This project highlights the discovery of the world's longest lines of sight using a custom-developed algorithm named CacheTVS. By exhaustively analyzing topographical data across the planet, researchers identified the longest possible direct view: a 530km span from the Hindu Kush to Pik Dankova. Other notable mentions include a 504km line from Antioquia to Pico Cristobal in Colombia and a 483km view from Mount Elbrus in Russia across the Black Sea to the Pontic Mountains in Turkey. The project provides an interactive map containing approximately 4.5 billion calculated lines of sight, showcasing how geography, atmospheric conditions, and advanced computational algorithms can uncover unique geographical records.

Sources:Hacker News374 pts
It's all a blur
03Friday, February 6, 2026

It's all a blur

This article explores how common image blurring algorithms, specifically moving averages, are often reversible. By demonstrating a pixel-reconstruction method based on arithmetic means and padding, the author shows that even 2D filters and lossy JPEG compression often fail to securely redact information, allowing for significant recovery of original details.

Show HN: Wikipedia as a doomscrollable social media feed
04Monday, February 2, 2026

Show HN: Wikipedia as a doomscrollable social media feed

Xikipedia is an experimental social media feed project that demonstrates the power of algorithmic content curation. By leveraging Simple Wikipedia as its primary content source, the application uses a basic non-machine learning algorithm that runs entirely locally in the user's browser. The project illustrates how quickly digital systems can identify user engagement patterns to suggest similar content without relying on centralized data collection or collaborative filtering from other users. Privacy is a central component, as no data is stored or shared; everything is cleared upon closing the tab. The source code is publicly available on GitHub, inviting discussions across various social platforms regarding privacy-first algorithmic transparency and modern web development techniques.

Sources:Hacker News354 pts
Text classification with Python 3.14's zstd module
05Friday, February 6, 2026

Text classification with Python 3.14's zstd module

The introduction of the compression.zstd module in Python 3.14 provides a powerful tool for text classification using the principle that compression length approximates Kolmogorov complexity. Unlike older algorithms like gzip or LZW, Zstd supports incremental compression and pre-trained dictionaries, making it computationally efficient to estimate the similarity between a document and a class-specific buffer. By comparing which class-specific compressor yields the smallest output for a given text, a simple yet effective classifier can be built without using gradients or matrices. Benchmarks on the 20 newsgroups dataset show that this method achieves 91% accuracy in under two seconds, outperforming previous compression-based methods in speed and rivaling traditional TF-IDF and logistic regression models in accuracy. This approach highlights the viability of using standard library compression utilities for low-resource machine learning tasks where simplicity and maintenance are priorities.

Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB
07Saturday, February 14, 2026

Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB

sameshi.h is a minimal chess engine implemented in C, utilizing a 120-cell mailbox board and Negamax search with alpha-beta pruning. Despite missing complex rules like castling or promotion, it achieves approximately 1170 Elo through material-based evaluation and capture-first move ordering, as validated by 240 games against Stockfish.

Sources:Hacker News209 pts
Font Rendering from First Principles
08Sunday, February 8, 2026

Font Rendering from First Principles

The article explores font rendering from first principles, focusing on the TrueType (TTF) file format. It details the complexity of parsing glyph data, handling quadratic Bezier curves, and the transition from raw bitmap rasterization to Signed Distance Fields (SDF) for high-quality scaling. The author documents building a custom implementation to understand lower-level text layout and rendering.

Sources:Hacker News186 pts
An interactive intro to quadtrees
09Tuesday, February 24, 2026

An interactive intro to quadtrees

A quadtree is a spatial data structure that recursively divides 2D space into four quadrants to optimize location-based queries. By organizing data hierarchically, it allows systems to prune irrelevant regions, significantly improving efficiency in map applications, collision detection, and image compression by reducing search complexity from linear to logarithmic scales.

Sources:Hacker News175 pts
Two Bits Are Better Than One: making bloom filters 2x more accurate
10Monday, February 16, 2026

Two Bits Are Better Than One: making bloom filters 2x more accurate

Floe explains using bloom filters, probabilistic data structures that efficiently speed up SQL queries by filtering non-matching rows before decompression. By implementing a fixed-size 256KB filter with two bits stored in a single uint32, they reduced false positive rates by 2x (11.7% to 5.7%) with negligible performance costs, significantly optimizing database join operations.

Sources:Hacker News172 pts
Like Game-of-Life, but on Growing Graphs, with WASM and WebGL
11Sunday, February 8, 2026

Like Game-of-Life, but on Growing Graphs, with WASM and WebGL

This project explores an experimental simulation of emergent complexity inspired by Paul Cousin’s research on Graph-Rewriting Automata. By utilizing specific local topological rules, the system demonstrates how complex global patterns can arise from simple structural transformations. Unlike traditional cellular automata which operate on static grids, this approach employs dynamic graphs where nodes and edges evolve based on rewriting logic. This simulation serves as a bridge between computer science and mathematical theory, offering insights into how self-organizing systems function within computational frameworks. The work highlights the potential for non-linear growth and structural evolution in distributed systems and algorithmic design.

Sources:Hacker News169 pts
Faster Than Dijkstra?
12Monday, February 9, 2026

Faster Than Dijkstra?

A recent breakthrough in network theory claims to surpass Dijkstra's algorithm by breaking the sorting barrier to improve performance bounds. However, practical implementation in routers remains unlikely because current network sizes don't reach scaling limits where the difference is significant, and other factors like failure detection dominate routing convergence times.

Sources:Hacker News121 pts
How to choose between Hindley-Milner and bidirectional typing
13Sunday, February 15, 2026

How to choose between Hindley-Milner and bidirectional typing

The article explores the false dichotomy between Hindley-Milner and bidirectional type systems in language design. It argues that bidirectional typing is a superset of Hindley-Milner and that the critical decision is whether a language requires generics. While generics necessitate unification, bidirectional systems offer a flexible framework that can be implemented with or without complex unification processes.

Sources:Hacker News112 pts
Rabbit Ear "Origami": programmable origami in the browser
14Wednesday, February 4, 2026

Rabbit Ear "Origami": programmable origami in the browser

The provided text outlines the capabilities of Rabbit Ear, an origami-based computational library that utilizes FOLD objects and graph theory to model flat-foldable origami. Centered around the mathematical principles of folding, it explores specific theorems such as Kawasaki's theorem—which dictates that the alternating sum of sector angles around a single vertex must be 180° for flat-foldability—and Maekawa’s theorem, which requires the difference between mountain and valley creases to be exactly two. The library provides tools for 2D and 3D visualization, including a global layer-order solver designed to handle complex face-overlapping scenarios, ensuring correct SVG rendering of folded models. Additionally, the system implements the seven origami axioms to allow users to programmatically generate creases through geometric constructions rather than relying solely on coordinate-based inputs, making it a robust platform for both design and technical simulation.

Sources:Hacker News100 pts
The Fastest Way to Board an Airplane
15Saturday, February 21, 2026

The Fastest Way to Board an Airplane

The article explores airplane boarding efficiency through simulations, comparing methods like back-to-front, random, WilMA (Window-Middle-Aisle), and the Steffen Method. It highlights that parallel bag stowage and minimizing aisle interference are key, though real-world factors like priority classes and human behavior often outweigh theoretical efficiency.

Sources:Lobsters75 pts
Lindenmayer Systems
16Monday, February 16, 2026

Lindenmayer Systems

Exploring Lindenmayer systems (L-Systems), this content demonstrates how recursive string replacement rules combined with Logo-style turtle graphics create complex fractal patterns like the dragon curve, Koch snowflake, and space-filling curves. Implemented as a Rust library, it showcases various mathematical visualizations and provides source code for generating these intricate geometric images.

Sources:Lobsters41 pts
Fast sorting, branchless by design
17Tuesday, February 17, 2026

Fast sorting, branchless by design

Sorting networks, like Batcher's bitonic sort and the vectorized djbsort, provide data-oblivious execution to prevent timing side-channel attacks in cryptography. By using a fixed sequence of operations independent of input values, these algorithms ensure security and often outperform traditional data-dependent sorts like quicksort through SIMD optimization and inherent parallelism.

Sources:Lobsters33 pts
miniKanren.org
18Sunday, February 8, 2026

miniKanren.org

miniKanren is an influential family of embedded domain-specific languages (EDSLs) specifically designed for logic and relational programming. Originally implemented in Scheme, it has been ported to over 40 different host languages including Clojure, Haskell, Python, and Rust. The core language is notably minimalistic, consisting of only three logical operators and one interface operator, yet it supports powerful extensions like Constraint Logic Programming and probabilistic logic. The ecosystem encompasses numerous research papers, academic theses, and community-driven projects such as Barliman for program synthesis and core.logic for Clojure. It serves as a vital tool for exploring advanced programming language concepts like relational interpreters, unification algorithms, and automated theorem proving.

Sources:Lobsters32 pts