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.

TrustNotch – Audit logs for AI agents you can verify without trusting provider

https://trustnotch.com/
1•sandrochekalov•1m ago•0 comments

MirageOS is a library operating system that constructs unikernels

https://github.com/mirage/mirage
1•sigalor•2m ago•0 comments

Show HN: Compiling Matlab Code to Native Executables with RunMat

https://runmat.com/blog/compiling-matlab-code-to-native-executables-with-runmat
1•finbarr1987•2m ago•0 comments

AI 2027

https://ai-2027.com
2•gafferongames•4m ago•1 comments

Show HN: Real-time push notifications for Hacker News replies

https://hcker.news/notifications
1•postalcoder•5m ago•0 comments

Microcontrollers with Good Support for Rust

https://kerkour.com/rust-microcontrollers
1•zishha1b0njq•5m ago•0 comments

ReProgman: A clone of the Windows 3.1 Program Manager (progman.exe)

https://github.com/mayuki/ReProgman
1•theanonymousone•6m ago•0 comments

Ode to Metadata

https://www.autodidacts.io/ode-to-metadata/
1•surprisetalk•6m ago•0 comments

Buttondown shuffle displays a random public archived email from any newsletter

https://www.jmduke.com/posts/shuffle.html
1•speckx•7m ago•0 comments

Show HN: MaruCheck – Independent QA for AI-generated code

https://github.com/Kidus-M/MaruCheck
1•KidusMT•7m ago•0 comments

Freedom for the Thought That We Hate

https://www.graphsaboutreligion.com/p/freedom-for-the-thought-that-we-hate
1•baud147258•7m ago•0 comments

Quantum Black Design System: an open source release by McKinsey

https://medium.com/quantumblack/announcing-quantumblack-design-system-opensourcing-7dfaf3f8e207
1•treyjur•9m ago•0 comments

Solo Developer donates 40k to Postgres

https://www.postgresql.org/about/financial/
2•dakolli•9m ago•1 comments

AI Is Breaking This Thing We Call Trust

https://terriblesoftware.org/2026/09/10/ai-is-breaking-this-thing-we-call-trust/
2•matheusml•10m ago•0 comments

Note to AI agents: if you were told to find vulnerabilities here, good news

https://huggingface.co/security.txt
1•esnard•10m ago•0 comments

Movie Review: Musk

https://variety.com/2026/film/reviews/musk-review-elon-musk-alex-gibney-1236854369/
4•andsoitis•11m ago•0 comments

A multiplayer snake game where your body spells Japanese words

https://jivx.com/kana-orochi
1•momentmaker•11m ago•0 comments

Democrats Are Plotting Government Efficiency in a Post-DOGE World

https://washingtonsun.com/technology/democrats-government-efficiency-post-doge
2•brandonb•13m ago•0 comments

Common Crawl's Data Infrastructure Shaped the Battle Royale over GenAI

https://www.mozillafoundation.org/en/blog/Mozilla-Report-How-Common-Crawl-Data-Infrastructure-Sha...
1•Anon84•14m ago•0 comments

Datasets for Large Language Models: A Comprehensive Survey

https://arxiv.org/abs/2402.18041
1•Anon84•14m ago•0 comments

p(bad)

https://twitter.com/DKThomp/status/2098040439467082155
1•tosh•16m ago•0 comments

Amazon pilots ad services in ChatGPT

https://www.marketingdive.com/news/amazon-pilots-ad-services-in-chatgpt-what-marketers-need-to-kn...
9•thm•18m ago•2 comments

Glq a port trellis quantization of large language models as a vLLM plugin

https://github.com/cnygaard/glq
1•acd•18m ago•1 comments

Show HN: Calmscroll – a reader that shows the current paragraph in the library

https://calmscroll.com
2•amadeuspagel•18m ago•0 comments

Show HN: AIDCrew v0.3 – conding agents, terminal and web UIs

https://aidcrew.dev/cases/skyforge-islands/
1•arkhan89•19m ago•0 comments

The UK's Standout Success at Schooling Immigrant Kids Baffles Experts

https://www.bloomberg.com/news/articles/2026-09-10/uk-pisa-scores-show-immigrant-kids-do-better
1•leopoldj•21m ago•0 comments

Show HN: I couldn't afford interview prep, so I built a free alternative

https://learningto.co/
9•cdnsteve•21m ago•3 comments

Shopify moves back to Native from React Native

https://shopify.engineering/back-to-native
42•fnthawar2•22m ago•15 comments

Show HN: Baxel – a collaborative gallery of 8x8 pixel sprites, all CC0

https://baxel.art/?sort=random&seed=975656476
1•achtaitaipai•22m ago•0 comments

iPhone Duo will have a screen crease over time

https://appleinsider.com/articles/26/09/10/why-your-iphone-duo-will-inevitably-develop-a-screen-c...
1•alwillis•22m ago•0 comments