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•12mo ago

Comments

tomfly•12mo ago
where is the entrance and exit?
Jaxan•12mo ago
Doesn’t matter, because all positions are reachable. So just pick any two positions at the border and remove a wall.
kazinator•12mo 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•12mo 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•12mo 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•12mo 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.

Dash – A self-learning data agent that grounds answers in 6 layers of context

https://github.com/agno-agi/dash
1•ashpreet-bedi•3m ago•0 comments

Per-Image BT.601 Decorrelation Gap Measured Against KLT Across the Kodak Suite

https://github.com/PearsonZero/kodak-pcd0992-bt601-decorrelation-gap
1•PearsonZero•8m ago•0 comments

Under Trump, Green Card Seekers Face New Scrutiny for Views on Israel

https://www.nytimes.com/2026/04/25/us/politics/trump-green-cards-scrutiny.html
2•vrganj•15m ago•0 comments

Show HN: CrabPDF – privacy-first PDF editor that edits real text

https://crabpdf.com/
1•rabbithols•15m ago•0 comments

Zero-Cost Transparent Semiotic Awareness for Frozen Language Models SRT-Adapter

https://sublius.substack.com/p/srt-adapter-transparent-semiotic
1•spacebacon•21m ago•0 comments

Former MIT president says the US is losing the innovation race to China

https://www.npr.org/2026/04/25/nx-s1-5772703/former-mit-president-says-the-us-is-losing-the-innov...
1•Brajeshwar•26m ago•0 comments

Voice Modems

https://computer.rip/2026-04-26-voice-modems.html
1•K7PJP•26m ago•0 comments

Human AI Collaboration in LIterature

https://indignified.com/history-of-human-ai-collaboration-in-literature/
1•ZguideZ•29m ago•0 comments

Generative design of novel bacteriophages with genome language models [pdf]

https://www.biorxiv.org/content/10.1101/2025.09.12.675911v1.full.pdf
1•thunderbong•40m ago•0 comments

Built a safety-first options automation tool for covered calls

1•jansonlau•49m ago•0 comments

Why cars charge 5x faster in China when the research is shared?

https://cyrusradfar.com/thoughts/why-cars-charge-5x-faster-in-china/
5•cyrusradfar•55m ago•0 comments

America's Pandemic Car Bubble Is Now Trapping Buyers in Debt

https://www.wsj.com/business/autos/car-owners-debt-negative-equity-3cfcd031
4•JumpCrisscross•56m ago•0 comments

Our Principles

https://openai.com/index/our-principles/
2•salkahfi•1h ago•0 comments

A New Idea to Save the Climate? Dam the Bering Strait.

https://www.nytimes.com/2026/04/24/climate/amoc-bering-strait-dam.html
3•bookofjoe•1h ago•1 comments

Sabastian Sawe becomes first person to break two-hour marathon mark

https://www.rte.ie/sport/athletics/2026/0426/1570275-sawe-becomes-first-man-to-break-two-hour-mar...
2•austinallegro•1h ago•0 comments

Show HN: Nitrum – Rust Toolkit and CLI for AWS Nitro Enclaves

https://github.com/matzapata/nitrum
2•matzapata•1h ago•1 comments

I Learned to Stop Worrying and Love Coding with AI

https://jeffield.net/blog/claude-strangelove-or-how-i-learned-to-stop-worrying-and-love-coding-wi...
1•jsheffie•1h ago•0 comments

The Atari 1200XL – By Paul Lefebvre

https://www.goto10retro.com/p/inside-the-atari-1200xl
1•rbanffy•1h ago•0 comments

Did You Say "Intellectual Property"? It's a Seductive Mirage

https://www.gnu.org/philosophy/not-ipr.html.en
2•MontyCarloHall•1h ago•0 comments

FreeBSD Device Drivers Book

https://github.com/ebrandi/FDD-book
3•myth_drannon•1h ago•0 comments

Jaeger adopts OpenTelemetry at its core to solve the AI agent observability gap

https://thenewstack.io/jaeger-v2-ai-observability/
1•Brajeshwar•1h ago•0 comments

Intel reportedly says it boosted yields by selling what would normally be scrap

https://www.tomshardware.com/pc-components/cpus/intel-reportedly-says-it-boosted-yields-by-sellin...
2•rbanffy•1h ago•0 comments

The tortoise and the hare: will China beat the US in the race back to the moon?

https://www.theguardian.com/science/2026/apr/26/china-us-space-race-moon
3•pseudolus•1h ago•0 comments

Show HN: CheckThisOut – a filtered directory of side hustles and AI tools

https://checkthisout.com/
1•mbahlitz•1h ago•0 comments

SnakeBreak [a Browser Extension Game]

https://addons.mozilla.org/en-US/firefox/addon/snakebreak/
1•programmexxx•1h ago•1 comments

VPinFE – Cross-platform Front end for VPinball

https://github.com/superhac/vpinfe
1•terry107•1h ago•0 comments

JQuake – monitor real-time shaking events in Japan

https://jquake.net/en/
1•pndy•1h ago•0 comments

Statistical Structure and the Evolution of Languages

https://royalsocietypublishing.org/rspb/article/293/2068/20252374/481270/Statistical-structure-an...
1•Anon84•1h ago•0 comments

The Spinor Genus and the Distinguishing Lattice Isomorphism Problem(2024)

https://eprint.iacr.org/2024/1475
1•rolph•1h ago•0 comments

NSF science advisory board fired by Trump administration

https://www.nature.com/articles/d41586-026-01361-7
3•rguiscard•1h ago•1 comments