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.

I paid people to try and follow my README

https://shkspr.mobi/blog/2026/10/i-paid-people-to-try-and-follow-my-readme/
1•edent•54s ago•0 comments

Show HN: A Mac app to focus on your actions instead of distractions

https://now.korture.com/go/mac
1•skprasad•1m ago•0 comments

Creative Forces in the Global Village (1993)

https://reason.com/1993/05/01/creative-forces/
1•rwmj•2m ago•0 comments

Why Ketamine Immobilizes Some Users

https://www.nytimes.com/2026/10/10/science/ketamine-cornell-anesthesia.html
1•bookofjoe•4m ago•1 comments

Why Your $400 Rain Jacket Fails in Heavy Rain (and What to Do Instead)

https://thetrek.co/why-your-400-rain-jacket-fails-in-heavy-rain-and-what-to-do-instead/
1•bryanrasmussen•5m ago•0 comments

Show HN: Guard hooks for Claude Code, tested against a public corpus

https://github.com/skillkeel/skillkeel-starter
1•northbridgedev•6m ago•0 comments

App Talk back and track on a Mac

https://sixcolors.com/post/2026/08/app-report-talk-back-and-track-on-a-mac/
1•skprasad•6m ago•0 comments

First detection of variable water clouds outside of our solar system

https://news.arizona.edu/news/discovery-marks-first-detection-variable-water-clouds-outside-our-s...
1•geox•8m ago•0 comments

Everything Is a Ralph Loop

https://ghuntley.com/loop/
1•maayank•8m ago•0 comments

What driving across Europe costs in tolls, vignettes, bridges and fuel

https://copilot.travel/tolls/europe-2026
2•heikkikalliokos•9m ago•0 comments

Textual (IRC Client) has a new home, and it is us

https://www.textualapp.com/news/a-new-chapter
1•mococa•13m ago•0 comments

AI is creating a 'human premium' for art created by people

https://www.bbc.com/news/articles/c5vgjm3gk7rzo
4•colinprince•13m ago•1 comments

Versity S3 Gateway: an S3 interface for your filesystem

https://www.versity.com/products/versitygw/
1•mikeocool•16m ago•2 comments

GPT-6 Astra performs unsanctioned supply-chain attacks in simulations

https://www.aisi.gov.uk/blog/gpt-6-astra-performs-unsanctioned-supply-chain-attacks-in-simulations
2•throw0101a•19m ago•0 comments

Cloudflare Radar: HTTP traffic from Yandex drops to 0 after strikes

https://radar.cloudflare.com/traffic/as13238?dateRange=28d
1•schleck8•19m ago•4 comments

Evaluating Whether GPT-6 Astra Performs Unsanctioned Supply-Chain Attacks

https://arxiv.org/abs/2609.38415
1•throw0101a•20m ago•0 comments

The Economics of Agents

https://marginalrevolution.com/marginalrevolution/2026/10/the-economics-of-agents.html
2•smitty1e•23m ago•0 comments

Teardown: LifeOS

https://github.com/jimy-r/agent-workspace-architecture/blob/main/teardowns/2026-08-28-lifeos.md
1•jimyr•25m ago•0 comments

Ask HN: How do you differentiate yourself at a software engineer nowadays?

1•jmoosh34•25m ago•2 comments

Video Cameras Are Everywhere–and Now They Are Being Hacked for War

https://www.wsj.com/tech/cybersecurity/video-cameras-webcams-hacked-war-b00b8a24
1•diogenes_atx•26m ago•0 comments

Our tracking script is smaller than a favicon. How heavy is yours?

https://foresite.dev/blog/analytics-script-page-speed
1•cheesemoopy•31m ago•0 comments

Microsoft 365 subscribers set to lose up to 4 TB of OneDrive storage

https://www.theregister.com/personal-tech/2026/10/09/microsoft-365-subscribers-set-to-lose-up-to-...
2•Bender•37m ago•0 comments

Reflect Orbital's eye-safety claim, checked against the FCC order

https://pub-a941bfd863a24f91a60e6c4979c18a84.r2.dev/pi-sandbox-uploads/359669717541064704/2026-10...
1•khaelexmoroe•37m ago•0 comments

I made the first I2PD client for iOS that works without Jailbreak

https://github.com/SoItsTime/I2PdiOS
1•SoItsTime•41m ago•1 comments

Nicolas Cage says he won't work with Amazon again over AI dispute

https://www.latimes.com/entertainment-arts/business/story/2026-10-10/nicolas-cage-says-he-wont-wo...
3•Bluestein•45m ago•1 comments

OpenCode 2.0

https://anoma.ly/notes/opencode-2-0/
2•bovermyer•45m ago•0 comments

The baffling intelligence of a single cell (2024)

https://jsomers.net/e-coli-chemotaxis/
2•jsomers•45m ago•0 comments

OpenAI agents tried to hack Wikipedia tools and flooded it with traffic

https://arstechnica.com/security/2026/10/openai-agents-tried-to-hack-wikipedia-tools-and-flooded-...
3•joozio•46m ago•0 comments

Fixated on AI, the world has forgotten it is staring at nuclear annihilation

https://www.theguardian.com/commentisfree/2026/oct/11/ai-annihilation-advanced-nuclear-weapons
1•beardyw•46m ago•2 comments

Show HN: A free coding agent that writes its own multi-agent workflows

https://kolega.ai/code
1•fabioricardo7•47m ago•0 comments