frontpage.
newsnewestaskshowjobs

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.

CSSQuake

https://cssquake.com/
90•msalsas•2h ago•18 comments

I Stored a Website in a Favicon

https://www.timwehrle.de/blog/i-stored-a-website-in-a-favicon/
190•theanonymousone•7h ago•73 comments

Where to Find the Colors Your Screen Can't Show You

https://moultano.wordpress.com/2026/06/19/where-to-find-the-colors-your-screen-cant-show-you/
211•moultano•9h ago•51 comments

16-year-old SATA II SSD survives 1 petabyte of writes, 25x the drive's rating

https://www.tomshardware.com/pc-components/ssds/16-year-old-sata-ii-ssd-survives-1-petabyte-of-wr...
29•giuliomagnifico•1h ago•9 comments

The Cold War's Accidental Whale Observatory

https://thereader.mitpress.mit.edu/the-cold-wars-accidental-whale-observatory/
19•pseudolus•3d ago•1 comments

Data Compression Explained (2012)

https://mattmahoney.net/dc/dce.html
149•mtdewcmu•3d ago•21 comments

Can you see three trees?

https://www.not-ship.com/can-you-see-three-trees/
177•Pamar•2d ago•91 comments

There are no instances in ATProto

https://overreacted.io/there-are-no-instances-in-atproto/
472•danabramov•21h ago•245 comments

GPT-5.5 hallucinates 3x more than MIT-licensed GLM-5.2

https://arrowtsx.dev/bigger-models/
276•oshrimpton•20h ago•109 comments

The discovery that changed how scientists think about memory

https://www.ibm.com/think/news/discovery-changed-how-scientists-think-about-memory-kavli-prize
76•rbanffy•3d ago•23 comments

Lithuanian startup launches open-source network to detect Shahed-type drones

https://www.lrt.lt/en/news-in-english/19/2965205/lithuanian-startup-launches-open-source-network-...
11•giuliomagnifico•1h ago•2 comments

Surprising economics of load-balanced systems

https://brooker.co.za/blog/2020/08/06/erlang.html
127•KraftyOne•16h ago•30 comments

Human Judgment as a Specification

https://blog.brownplt.org/2026/06/09/pick.html
6•surprisetalk•3d ago•0 comments

LLMs Are Complicated Now

https://ianbarber.blog/2026/06/19/llms-are-complicated-now/
60•matt_d•11h ago•12 comments

A 1969 camera operators' strike created Upstairs Downstairs multiverse

https://ironicsans.ghost.io/the-color-strike/
44•ohjeez•3d ago•12 comments

How many of the 170k English words do you know?

https://vocabowl-870366514258.us-west1.run.app/
408•abnry•23h ago•496 comments

Hyundai buys Boston Dynamics

https://startupfortune.com/hyundai-takes-full-control-of-boston-dynamics-as-softbank-exits-for-32...
866•ck2•20h ago•370 comments

Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

https://www.jvm-weekly.com/p/project-valhalla-explained-how-a
613•philonoist•1d ago•382 comments

Norway imposes near ban on AI in elementary school

https://www.reuters.com/technology/norway-imposes-near-ban-ai-elementary-school-2026-06-19/
725•ilreb•20h ago•499 comments

Soccer Arcade Games Through the Years

https://arcadeheroes.com/2026/06/13/world-cup-2026-soccer-arcade/
28•speckx•3d ago•12 comments

Bobby Prince, composer for Doom, Wolfenstein 3D, and Duke Nukem 3D, has died

https://www.legacy.com/legacy/robert-bobby-prince-lll
409•pgrote•17h ago•47 comments

Satellite reveals immense scale of GPS signal tampering

https://www.space.com/space-exploration/satellites/its-quite-a-bit-more-than-we-expected-satellit...
121•y1n0•8h ago•56 comments

A Perceptron in Age of Empires II

https://adewynter.github.io/notes/aoe2-circuits
92•EvgeniyZh•2d ago•35 comments

Egyptian Fractions (2006)

https://blog.plover.com/math/egyptian-fractions.html
100•luu•4d ago•13 comments

AURpocalypse now: a look at the recent AUR attacks

https://lwn.net/SubscriberLink/1077619/f7b07c5489fdd43a/
98•jwilk•19h ago•67 comments

Zen and the Art of Machine Learning Research

https://blog.jxmo.io/p/zen-and-the-art-of-machine-learning
269•jxmorris12•4d ago•98 comments

Building a robotics research setup that lives next to my desk

https://dfdxlabs.com/research/2026/robotics-setup/
159•mplappert•1d ago•57 comments

Court Records Should Be Free

https://www.eff.org/deeplinks/2026/06/court-records-should-be-free
410•hn_acker•19h ago•92 comments

John Jumper to join Anthropic

https://twitter.com/JohnJumperSci/status/2068001285173834106
147•artninja1988•19h ago•111 comments

Show HN: Metiq: a real time 3D globe for 100 public datasets

https://metiq.space
134•rakeda•3d ago•36 comments