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

Comments

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

What Happened to Molecular Manufacturing?

https://latecomermag.com/article/what-happened-to-molecular-manufacturing/
1•ravenical•3m ago•0 comments

Specification; communication; computation – no, programming isn't dead

https://twey.io/llm-programming/
1•Twey•5m ago•0 comments

Larry Page has moved to Florida

https://twitter.com/paulg/status/2026737030257062253
1•jmeister•6m ago•0 comments

Apple brings age verification to UK users in iOS 26.4 beta

https://www.theverge.com/tech/884306/apple-age-verification-uk-users-ios-26-4-beta
1•turrini•8m ago•0 comments

Possible AI use leads to end of senryu competition after 20 years

https://www.japantimes.co.jp/news/2026/02/24/japan/japan-ai-senryu-poetry-writing/
2•haunter•10m ago•0 comments

Show HN: Clerk – Simple invoicing for freelancers built with AI agents in 7 days

https://clerkfinance.com/
1•radolang•10m ago•1 comments

Why Your Next Electric Car Will Cost 50% Less [video]

https://www.youtube.com/watch?v=6ecV9Yu7YvA
1•zeristor•12m ago•2 comments

Show HN: Provision Stateless GPU Compute with Claude Code's Remote Control

https://github.com/theoddden/terradev-mcp
1•Facingsouth•13m ago•0 comments

Show HN: Edictum – Runtime governance for LLM agent tool calls

1•acartag7•13m ago•0 comments

Outage of Coveralls

https://status.coveralls.io
1•sega_sai•16m ago•0 comments

Getting Global Age Assurance Right: What We Got Wrong and What's Changing

https://discord.com/blog/getting-global-age-assurance-right-what-we-got-wrong-and-whats-changing
1•Alupis•18m ago•0 comments

Tldraw moves tests to closed source to avoid AI copies

https://simonwillison.net/2026/Feb/25/closed-tests/
1•jbernardo95•18m ago•0 comments

Tech firms aren't just encouraging their workers to use AI. They're enforcing it

https://www.msn.com/en-us/money/other/tech-firms-aren-t-just-encouraging-their-workers-to-use-ai-...
2•smurda•19m ago•0 comments

The first transatlantic fiber-optic cable is being ripped up

https://www.tomshardware.com/tech-industry/the-worlds-first-transatlantic-fiber-optic-cable-is-be...
2•gnfargbl•21m ago•0 comments

Live – AI that runs your company

https://polsia.com/live
1•seyz•21m ago•0 comments

Fix cron routes: POST → GET (Vercel cron sends GET)

1•nishiohiroshi•23m ago•0 comments

Show HN: OrangeWalrus, an aggregator for trivia nights (and other events) in SF

https://www.orangewalrus.com/
2•gjtrowbridge•24m ago•0 comments

Banned in California

https://www.bannedincalifornia.org/
58•pie_flavor•24m ago•24 comments

What AI can and cannot do

https://greyenlightenment.com/2026/02/23/what-ai-can-and-cannot-do/
2•paulpauper•25m ago•0 comments

Tetraethylenepentamine-Grafted Magnetic Polymer Composite for CO2 Capture

https://www.mdpi.com/2297-8739/13/2/56
1•PaulHoule•26m ago•0 comments

Anthropic and the Department of War

https://thezvi.substack.com/p/anthropic-and-the-department-of-war
5•paulpauper•27m ago•0 comments

Show HN: Unworldly – A flight recorder for AI agents (tamper-proof, HIPAA)

https://github.com/DilawarShafiq/unworldly
1•dilawargopang•27m ago•0 comments

Buying News by Metric

https://www.overcomingbias.com/p/buying-news-by-metric
1•paulpauper•28m ago•0 comments

Ask HN: What will happen with Anthropics ultimatum?

2•maniacwhat•28m ago•0 comments

Origin of the rule that swap size should be 2x of the physical memory

https://retrocomputing.stackexchange.com/questions/32492/origin-of-the-rule-that-swap-size-should...
2•SeenNotHeard•32m ago•0 comments

Microsoft CEO slams AI slop after dismissing its importance

https://www.theregister.com/2026/02/25/microsoft_boss_on_ai_content/
2•LorenDB•33m ago•0 comments

Show HN: Tesseract – 3D architecture editor with MCP for AI-assisted design

https://tesseract.infrastellar.dev
2•infrastellar•35m ago•0 comments

At Last I Am Free

https://magiconair.net/blog/2026-02-25-at-last-i-am-free
2•magiconair•37m ago•0 comments

What We Aren't Told About Osteoporosis

https://www.midwesterndoctor.com/p/what-we-arent-told-about-osteoporosis
2•bilsbie•38m ago•0 comments

First Website

https://info.cern.ch
15•shrikaranhanda•38m ago•1 comments