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.

StumbleTV: Chat Roulette but for Exposed Webcams

https://stumbletv.alectrocute.workers.dev/c/2e6ff336f1235cc1
1•arm32•51s ago•0 comments

The millionaires tax was pitched as a $2B revenue source. It's blown past that

https://www.bostonglobe.com/2026/05/25/metro/millionaires-tax-massachusetts/
1•ceejayoz•3m ago•0 comments

Delaware court upholds voting by companies in small town's election

https://www.reuters.com/legal/government/delaware-court-upholds-voting-by-companies-small-towns-e...
1•anigbrowl•4m ago•0 comments

Poll: Would you allow a first generation plumber robot in your home?

1•Bender•12m ago•1 comments

Amazon Strikes $6B Deal with Snowflake for Agentic Computing Chips

https://www.wsj.com/tech/amazon-strikes-6-billion-deal-with-snowflake-for-its-agentic-computing-c...
1•jpau•13m ago•0 comments

Breaking Rust

https://en.wikipedia.org/wiki/Breaking_Rust
1•petethomas•15m ago•0 comments

Agents can sign up for Composio

https://composio.dev/blog/your-agents-can-signup-for-composio
1•mooreds•16m ago•0 comments

Xania Monet

https://en.wikipedia.org/wiki/Xania_Monet
1•petethomas•17m ago•0 comments

Agent Security Is a Systems Problem

https://arxiv.org/abs/2605.18991
1•yakkomajuri•20m ago•0 comments

Attrition: The Chinese Family Collapse

https://www.strategypage.com/htmw/htatrit/articles/2026052754034.aspx
1•skmurphy•20m ago•1 comments

The Authorization Paradox: Who Has the Keys to Your AI? [video]

https://www.youtube.com/watch?v=5UUpxgcGKXk
1•mooreds•22m ago•0 comments

GitMo – Auto sync your local project files to GitHub while you work.

https://github.com/KyleBenzle/GitMo/tree/main
1•WWIII_Historian•25m ago•0 comments

Ansel: Complete Pipeline Overhaul

https://ansel.photos/en/news/complete-pipeline-overhaul/
1•neucoas•30m ago•0 comments

Dutch block US takeover of Solvinity as against public interest

https://www.reuters.com/technology/dutch-government-block-takeover-cloud-services-company-solvini...
3•rectang•36m ago•1 comments

Show HN: Liiists, a Markdown-first, iOS and CLI list app

https://github.com/djt53/liiists
1•dtingle•36m ago•0 comments

What Will Happen When the AI Barons Give Back?

https://www.nytimes.com/2026/05/27/opinion/ai-philanthropy-charity.html
1•berkeleyjunk•39m ago•0 comments

You Should Not Update Your Dependencies

https://www.mendral.com/blog/you-should-not-update
7•OlivierCG•40m ago•0 comments

Atom Exhaustion Is Not a Footgun. It's One Third of Our CVEs

https://www.erlef.org/blog/eef/atom-exhaustion
1•croottree•40m ago•0 comments

A non-coding coding agent

https://zserge.com/posts/socreates/
1•croottree•41m ago•0 comments

OpenDisplay – open standard for e-paper screens

https://opendisplay.org/
2•balloob•44m ago•0 comments

Building the Future of Accessible Tech: Inside Uvilox AI

https://uvilox-aiwebsite.pages.dev/
1•Pallav123•46m ago•0 comments

Monome at Twenty

https://monome.org/twenty
2•robenkleene•46m ago•0 comments

Monome at 20: memories of the grid, in pictures

https://cdm.link/monome-at-20-memories-of-the-grid-in-pictures/
1•robenkleene•46m ago•0 comments

Did Newton know that force is mass times acceleration?

https://hsm.stackexchange.com/questions/19441/did-newton-know-that-force-is-mass-times-acceleration
2•kristianp•51m ago•0 comments

Am I a Bad Friend?

https://drobinin.com/posts/am-i-a-bad-friend/
2•valzevul•51m ago•0 comments

Balcony solar could help fight rising US utility costs

https://www.theguardian.com/environment/2026/may/27/balcony-solar-panels-rising-utility-costs
3•ottoboney•52m ago•0 comments

Ask HN: How to live life before AGI

3•atleastoptimal•53m ago•5 comments

German child killer Magnus Gaefgen awarded damages (2011)

https://www.bbc.com/news/world-europe-14408657
1•petethomas•54m ago•0 comments

FBI Arrests CIA Official with $40M in Gold Bars in His Home

https://www.nytimes.com/2026/05/27/us/politics/fbi-arrest-cia-official-gold-bars.html
9•cwwc•59m ago•2 comments

Google Engineer Charged with Insider Trading on Polymarket

https://finance.yahoo.com/markets/crypto/articles/google-engineer-charged-insider-trading-2109041...
2•1vuio0pswjnm7•1h ago•0 comments