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.

Turn n8n workflows into AI agent skills (OpenClaw-compatible)

https://github.com/just-claw-it/n8n-to-claw
1•just-claw-it•34s ago•1 comments

Mozilla and Mila announce strategic research partnership

https://blog.mozilla.org/en/mozilla/mila-open-source-sovereign-ai/
1•mcookly•4m ago•0 comments

Embraer Unveils First Saab F-39E Gripen Assembled in Brazil

https://aviationweek.com/defense/budget-policy-operations/embraer-unveils-first-f-39e-gripen-asse...
1•wslh•5m ago•0 comments

Apple discontinues the Mac Pro with no plans for future hardware

https://9to5mac.com/2026/03/26/apple-discontinues-the-mac-pro/
3•bentocorp•7m ago•1 comments

Show HN: A Kanban board where AI agents are first-class team members

https://agent-kanban.dev/
2•saltbo•10m ago•0 comments

Show HN: Zitrus – A 3DS SDK written in pure Zig

https://codeberg.org/GasInfinity/zitrus
1•gasinfinity•10m ago•0 comments

Workers who fall for 'corporate bullshit' may be worse at their jobs

https://www.theguardian.com/business/2026/mar/23/corporate-speak-study
2•mykowebhn•13m ago•0 comments

Show HN: Fio: 3D World editor/game engine – inspired by Radiant and Hammer

https://github.com/ViciousSquid/Fio
1•vicioussquid•13m ago•0 comments

The End

https://www.focalcurve.com/journal/the-end/
2•shminge•14m ago•0 comments

Deploytarot.com – tarot card reading for deployments

https://deploytarot.com/setup
5•rembish•18m ago•2 comments

Harness design for long-running application development

https://www.anthropic.com/engineering/harness-design-long-running-apps
1•rmuchall•18m ago•0 comments

Cloudflare's new Dynamic Workers ditch containers, run AI agent code 100x faster

https://venturebeat.com/infrastructure/cloudflares-new-dynamic-workers-ditch-containers-to-run-ai...
1•CharlesW•18m ago•0 comments

JCal – Jeffrey Epstein's Activities Recreated in Google Calendar

https://jmail.world/calendar
8•ilamont•20m ago•1 comments

Future Vision X Prize: One of the Largest SCI-FI Film Competitions

https://futurevisionxprize.com/
2•andersource•20m ago•0 comments

Ask HN: Personalized mRNA cancer vaccines, how real is the pipeline today?

3•imnotlost•22m ago•2 comments

How Much of AI Labs' Research Is Safety?

https://fi-le.net/safety-blogs/
2•mottiden•24m ago•0 comments

Tutorial: Analyzing Shell Scripts

https://blog.greenberg.science/posts/popl2026-tutorial/
2•vagozino•27m ago•0 comments

Global ocean heat content over the past 3M years

https://www.nature.com/articles/s41586-026-10116-3
2•CGMthrowaway•29m ago•0 comments

3-d genome reorganization foreshadows zygotic genome activation in Drosophila

https://www.nature.com/articles/s41588-026-02503-3
1•PaulHoule•29m ago•0 comments

Claude connects the dots on sleep apnea diagnosis

https://old.reddit.com/r/ClaudeAI/comments/1s41fny/25_years_multiple_specialists_zero_answers_one/
1•dnw•30m ago•0 comments

U.S. Stocks Have Their Biggest Drop Since Start of Iran War

https://www.nytimes.com/2026/03/26/business/oil-stock-gas-prices-iran.html
1•doener•31m ago•0 comments

I Put a Full JVM Inside a Browser Tab

https://bmarti44.substack.com/p/i-put-a-full-jvm-inside-a-browser
1•PaulHoule•33m ago•0 comments

The Little Book of C

https://little-book-of.github.io/c/books/en-US/book.html
1•ghostrss•36m ago•0 comments

New York City hospitals drop Palantir as controversial AI firm expands in UK

https://www.theguardian.com/technology/2026/mar/26/new-york-hospitals-palantir-ai
26•chrisjj•36m ago•6 comments

The Many Roots of Our Suffering: Reflections on Robert Trivers (1943–2026)

https://quillette.com/2026/03/25/the-many-roots-of-our-suffering-reflections-on-robert-trivers-19...
1•Petiver•37m ago•0 comments

Ask HN: Leaving Notion, Codebase as a Wiki?

2•kthaker1224•37m ago•1 comments

Engineers do get promoted for writing simple code

https://www.seangoedecke.com/simple-work-gets-rewarded/
1•dondraper36•39m ago•0 comments

AI comments drove Paul Graham off X notifications

https://twitter.com/gostroverhov/status/2037263858390147535
2•gostroverhov•41m ago•1 comments

Show HN: Photo Triager – Cull Raw Photos on iPhone/iPad with XMP Sidecars

https://photo-triager.junle.li/
2•lijunle•41m ago•0 comments

Show HN: Breakwater

https://www.breakwaterapp.com
2•stympy•41m ago•0 comments