frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Generating Mazes with Inductive Graphs (2017)

https://jelv.is/blog/Generating-Mazes-with-Inductive-Graphs/
20•todsacerdoti•1y ago

Comments

tomfly•1y ago
where is the entrance and exit?
Jaxan•1y ago
Doesn’t matter, because all positions are reachable. So just pick any two positions at the border and remove a wall.
kazinator•1y ago
Here is a maze that was generated recursively starting at the upper left cell.

  +    +----+----+----+----+----+----+----+----+----+
  |    |                        |                   |
  |    |                        |                   |
  +    +----+----+    +----+    +----+    +----+    +
  |              |         |                   |    |
  |              |         |                   |    |
  +----+----+    +    +----+----+----+----+----+    +
  |              |    |                        |    |
  |              |    |                        |    |
  +    +----+----+    +    +----+----+----+    +    +
  |         |              |              |    |    |
  |         |              |              |    |    |
  +    +----+    +    +----+----+----+    +    +----+
  |              |    |                   |    |    |
  |              |    |                   |    |    |
  +----+----+----+    +    +----+----+----+    +    +
  |                        |                   |    |
  |                        |                   |    |
  +    +----+----+----+    +    +----+----+----+    +
  |    |    |              |    |              |    |
  |    |    |              |    |              |    |
  +    +    +    +    +----+    +    +----+    +    +
  |    |    |    |    |         |    |         |    |
  |    |    |    |    |         |    |         |    |
  +    +    +    +    +----+----+----+    +    +    +
  |    |    |    |    |                   |         |
  |    |    |    |    |                   |         |
  +    +    +----+    +    +----+----+    +----+----+
  |              |         |                        |
  |              |         |                        |
  +----+----+----+----+----+----+----+----+----+    +

It matters to start there because it will be easier if you go backwards.

The maze has 100 cells. For each cell, we can calculate which exit goes back toward the entrance, assigning the letters U, D, L, R:

  U R R D L L R D L L
  U L L D L U L L L U
  R R U D D L L L L U
  U L D L L R R D U U
  U L L U D L L L U D
  R R R U L R R R U D
  U D R R U U R R D D
  U D U U R U U D L D
  U D U U D L L L U L
  U L L U L R R U L L
Stats:

  L - 33
  U - 29
  R - 20
  D - 18
Left and Up are more frequent back-to-entrance escapes than Right or Down. This is because of the way the maze was generated.

To check the hypothesis, we should analyze it in the other direction. For each cell, determine the exit which heads in the direction of the exit:

  D R R D L L R D L L
  D R D D L U L L L U
  D L L D D L L L L U
  D L R D L R R D D U
  R R U D D L L L U D
  R R R R D R R R U D
  U D R D L U R R D D
  U D U D R U U D L D
  U D U D R R R D U L
  U L L R U R R R R D
Stats:

  D - 30
  R - 28
  L - 24
  U - 18
There is a weaker bias for the D-R axis toward the exit, compared to the L-U axis toward the entrance. I suspect if we study larger numbers of larger mazes, we will find similar findings.

So that is to say, it is easier to navigate the maze in the reverse direction: the heuristic to try left/up exits will work more often than the right/down in the proper direction.

smartmic•1y ago
From the book "Mazes for Programmers" by Jamis Buck, 2015, The Pragmatic Programmers (a must-read for any maze/programming enthusiast!):

> Aren't mazes supposed to have starting points and end points? […] honestly, […] it's entirely up to you. […] The maze […] is a perfect maze, and one of the attributes of a perfect maze is that there exists exactly one path between any two cells in it. […] You pick them, and there's guaranteed to be a path between them.

You do not need to choose an entrance or exit only on the sides, but you can also choose "Pacman-style" where the goal is to reach points inside the maze.

"Perfect" refers to the mathematical/logical properties of a maze (i.e. no loops), not the aesthetical aspect. I have not checked though if the mazes in the source here are all perfect.

kazinator•1y ago
While you can put the entrance and exit wherever you want, if you know that the maze was generated by a recursive branching process which had a starting point somewhere, it probably behooves you to put the start at that point corresponding to the root of the tree, so that the maze wanderer faces the most branching choices.

Laying out the abstract maze tree into the rectilinear grid of cells obfuscates the tree somewhat, but not entirely. A process that generates from upper left to lower right, for instance, will tend to generate cells whose parent-headed exits going left and up more often than not, making the reverse direction a bit easier.

(Again, it depends on the maze generation process.)

kazinator•1y ago
Making random mazes in a rectilinear grid is a good exercise for one big reason: mazes are not all the same. Mazes have style can be very knotty and twisty, or have long passages. You can add hacks into a given algorithm to vary the style, but there are certain things it won't necessarily do.

Library for fast mapping of Java records to native memory

https://github.com/mamba-studio/TypedMemory
28•joe_mwangi•1h ago•5 comments

Nullsoft, 1997-2004 (2004)

https://slate.com/technology/2004/11/the-death-of-the-last-maverick-tech-company.html
156•downbad_•3d ago•50 comments

Ratty – A terminal emulator with inline 3D graphics

https://ratty-term.org/
548•orhunp_•10h ago•176 comments

UCLA discovers first stroke rehabilitation drug to repair brain damage (2025)

https://stemcell.ucla.edu/news/ucla-discovers-first-stroke-rehabilitation-drug-repair-brain-damage
30•bookofjoe•2h ago•5 comments

Counting Fast in Erlang with:counters and:atomics

https://andrealeopardi.com/posts/erlang-counters-and-atomics/
36•malmz•2d ago•1 comments

Gmail registration now requires scanning a QR code and sending a text message

https://discuss.privacyguides.net/t/google-account-registration-now-requires-sending-an-sms-via-p...
466•negura•13h ago•311 comments

CUDA-oxide: Nvidia's official Rust to CUDA compiler

https://nvlabs.github.io/cuda-oxide/index.html
303•adamnemecek•4h ago•94 comments

Training an LLM in Swift, Part 1: Taking matrix mult from Gflop/s to Tflop/s

https://www.cocoawithlove.com/blog/matrix-multiplications-swift.html
184•zdw•1d ago•9 comments

Interfaze: A new model architecture built for high accuracy at scale

https://interfaze.ai/blog/interfaze-a-new-model-architecture-built-for-high-accuracy-at-scale
64•yoeven•4h ago•16 comments

Can Someone Please Explain Whether Cloudflare Blackmailed Canonical?

https://www.flyingpenguin.com/can-someone-please-explain-whether-cloudflare-blackmailed-canonical/
117•speckx•2h ago•51 comments

AMÁLIA and the future of European Portuguese LLMs

https://duarteocarmo.com/blog/amalia-and-the-future-of-european-portuguese-llms
94•johnbarron•3d ago•46 comments

Bild AI (YC W25) Is Hiring Founding Product Engineers

https://bild.ai/jobs
1•rooppal•2h ago

Linux Terminal Memory Usage

https://gilesorr.com/blog/linux-terminal-memory-usage.html
10•speckx•51m ago•3 comments

The Boston library where you still can borrow a giant puppet

https://binj.news/2026/05/06/the-boston-library-where-you-still-can-borrow-a-giant-puppet/
23•gnabgib•2d ago•2 comments

Venom and Hot Peppers Offer a Key to Killing Resistant Bacteria

https://www.wired.com/story/mexican-science-transforms-scorpion-venom-and-habanero-chile-into-ant...
145•littlexsparkee•2d ago•55 comments

Building a web server in aarch64 assembly to give my life (a lack of) meaning

https://imtomt.github.io/ymawky/
81•theanonymousone•3d ago•27 comments

Holding Community Space

https://supernuclear.substack.com/p/building-a-space-people-never-want
31•surprisetalk•3d ago•20 comments

Software engineering may no longer be a lifetime career

https://www.seangoedecke.com/software-engineering-may-no-longer-be-a-lifetime-career/
258•movis•6h ago•461 comments

Show HN: TikTok but for Scientific Papers

https://andreaturchet.github.io/website/index.html
80•ciwrl•4h ago•45 comments

The greatest shot in television: James Burke had one chance to nail this scene (2024)

https://www.openculture.com/2024/10/the-greatest-shot-in-television.html
325•susam•17h ago•178 comments

Hardware Attestation as Monopoly Enabler

https://grapheneos.social/@GrapheneOS/116550899908879585
2038•ChuckMcM•1d ago•687 comments

Guitar tuner that uses phone accelerometer

https://tautme.github.io/phone-sensors/accel-tuner.html
139•adm4•3d ago•81 comments

590k buyers paid $59M for Trump's gold phone, but not one has shipped

https://finance.yahoo.com/markets/stocks/articles/590-000-buyers-paid-59-223500998.html
16•surprisetalk•21m ago•9 comments

Local AI needs to be the norm

https://unix.foo/posts/local-ai-needs-to-be-norm/
1710•cylo•1d ago•677 comments

I'm going back to writing code by hand

https://blog.k10s.dev/im-going-back-to-writing-code-by-hand/
882•dropbox_miner•19h ago•547 comments

Red Hot Chili Peppers ink $300M deal with Warner Music to sell catalog

https://www.hollywoodreporter.com/music/music-industry-news/wmg-acquired-red-hot-chili-peppers-ca...
40•randycupertino•1h ago•27 comments

Mythos Finds a Curl Vulnerability

https://daniel.haxx.se/blog/2026/05/11/mythos-finds-a-curl-vulnerability/
565•TangerineDream•14h ago•240 comments

Bliss (Photograph)

https://en.wikipedia.org/wiki/Bliss_(photograph)
104•cainxinth•3d ago•43 comments

A.I. note takers are making lawyers nervous

https://www.nytimes.com/2026/05/09/business/dealbook/ai-notetakers-legal-risk.html
211•JumpCrisscross•10h ago•151 comments

Running local models on an M4 with 24GB memory

https://jola.dev/posts/running-local-models-on-m4
525•shintoist•21h ago•156 comments