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

Comments

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

An open-source tool for designing homes using AI

https://github.com/bayllama/homemaker
2•graphllama•8m ago•0 comments

Cc-budget – Know your Claude Code budget before you hit the wall

https://github.com/boyand/cc-budget
1•nathariel_•10m ago•0 comments

C++26 is done ISO C++ standards meeting, Trip Report

https://herbsutter.com/2026/03/29/c26-is-done-trip-report-march-2026-iso-c-standards-meeting-lond...
1•pjmlp•10m ago•0 comments

The Cartel: the talent was always there, the market access wasn't

https://mayankagrawalphd.substack.com/p/the-cartel
1•timshell•12m ago•0 comments

An Introduction to Writing Systems and Unicode

https://r12a.github.io/scripts/tutorial/part2
1•mariuz•13m ago•0 comments

Thermodynamics, Organisations and Governments

https://deadneurons.substack.com/p/thermodynamics-organisations-and
1•nr378•13m ago•0 comments

Towards Scalable Dataframe Systems

https://arxiv.org/abs/2001.00888
2•fanf2•15m ago•1 comments

Stanley Milgram wasn't pessimistic enough about human nature?

https://www.lesswrong.com/posts/ogapPTArhBM6abSJj/stanley-milgram-wasn-t-pessimistic-enough-about...
1•paulpauper•15m ago•0 comments

Apple Preparing 'Most Significant Overhaul in the iPhone's History'

https://www.macrumors.com/2026/03/29/biggest-iphone-overhaul-ever-rumor/
1•prmph•15m ago•1 comments

Miniature Cities Are What Schools Were Always Supposed to Be

https://minicities.org/p/miniature-cities-a-reply-to-deutsch
1•paulpauper•16m ago•0 comments

Pascal's Wager

https://angelarichardson842599.substack.com/p/on-pascals-wager
1•paulpauper•16m ago•0 comments

Neovim 0.12.0

https://github.com/neovim/neovim/releases/tag/v0.12.0
4•pawelgrzybek•17m ago•0 comments

Behind the Curtain: AI's looming cyber nightmare

https://www.axios.com/2026/03/29/claude-mythos-anthropic-cyberattack-ai-agents
1•dkobia•17m ago•0 comments

Windows 95 defenses against installers that overwrite a file with an older one

https://devblogs.microsoft.com/oldnewthing/20260324-00/?p=112159
2•michelangelo•18m ago•0 comments

CoreFlow – Find hidden spend waste in bank CSVs

https://getcoreflow.com
1•maxzomerdyke•19m ago•0 comments

RIP Associate Product Managers

https://github.com/jackreacher80/product-manager-skill
2•neocortex666•21m ago•0 comments

ADL Shut Down Sora

https://twitter.com/ADL/status/2037585125765185572
2•black6•22m ago•1 comments

Netscape News Feed Straight Out of the Late 00s

https://isp.netscape.com/
11•mistyvales•22m ago•1 comments

Claude Code Chronicles

https://darshanmakwana412.github.io/2026/03/claude-code-chronicles/
2•darshanmakwana•24m ago•0 comments

Show HN: I built an 8-axis MTG draft advisor that runs inside ChatGPT

https://savecraft.gg/games/mtga
1•Veraticus•24m ago•1 comments

Show HN: Escape the Room, bounded AI stats game

https://github.com/AymanJabr/Escape-the-room-AI-stats-game
1•AymanJabr•26m ago•0 comments

Wp-tarpit – A honeypot that wastes WordPress scanners' time

https://github.com/lakeforestcomputer-com/wp-tarpit/
2•xLFCx•29m ago•1 comments

Ask HN: I'm hiring a SysAdmin in El Paso. Is there a place on HN to share?

1•WarcrimeActual•33m ago•2 comments

Shipping a Week's Work in a Day using parallel Claude agents

https://thewriting.dev/shipping-a-weeks-work-in-a-day-using-claude-code/
1•r0rshrk•35m ago•0 comments

Small Programming Tricks · will keleher

https://will-keleher.com/posts/small-programming-tricks-matter/
1•sharjeelsayed•35m ago•0 comments

Reddit Users Are Being Targeted by Stake's Covert Advertising Tactics

https://old.reddit.com/r/redscarepod/comments/1s3xvw6/how_reddit_users_are_being_maliciously_targ...
4•47thpresident•37m ago•1 comments

The Tmux Intro I Wish I Had Gotten – Simple Thread

https://www.simplethread.com/the-tmux-intro-i-wish-i-had-gotten/
1•sharjeelsayed•38m ago•0 comments

LLMs Do Not Grade Essays Like Humans

https://arxiv.org/abs/2603.23714
3•PretzelFisch•39m ago•2 comments

First Western Digital, now Sony: The tech giant suspends SD card sales

https://mashable.com/article/sony-sd-card-sales-suspended-memory-shortage
9•_tk_•42m ago•4 comments

Spot – Git repo code search, replace, diff and merge

https://github.com/gritzko/librdx/tree/master/spot
1•gritzko•42m ago•2 comments