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.

We Replaced MMAP with Io_uring in Our Rust Query Engine. It Got Slower

https://www.conviva.ai/resource/we-replaced-mmap-with-io_uring-in-our-rust-query-engine-it-got-sl...
1•rzk•2m ago•0 comments

Racing to solve maths problems now 'pointless'

https://www.abc.net.au/news/2026-09-11/racing-to-solve-maths-problems-pointless-tristan-buckmaste...
1•elahieh•5m ago•0 comments

Astra marks the Claude 3.7 moment for knowledge work

https://fundaai.substack.com/p/deepllm-gpt-6-astra-opens-new-markets
2•deepmem•8m ago•0 comments

Show HN: Interactive history of Earth and human civilization

https://earth.ethanplus.ai/
1•freakynit•13m ago•0 comments

Apple Watch can grab snippets of conversation without both speakers' consent

https://www.theregister.com/security/2026/09/10/watch-out-apple-timepiece-can-grab-snippets-of-co...
1•signa11•14m ago•0 comments

Optimizing a Spin-Lock

https://david.alvarezrosa.com/posts/optimizing-a-spin-lock/
2•signa11•17m ago•0 comments

Ask HN: What Can We Do?

2•silexia•18m ago•1 comments

Fugu Max and Fugu Ultra v2: Orchestrating the Pareto Frontier

https://sakana.ai/fugu-max-release/
4•hardmaru•18m ago•0 comments

Show HN: Swiftime - time tracking you can talk to, with an API for AI agents

https://swiftime.ai/
1•tomazaria•24m ago•0 comments

The Branch and the Wish – On mathematics, machines and what the proof never held

https://nisheethvishnoi.substack.com/p/the-branch-and-the-wish
1•vismit2000•28m ago•0 comments

A jank percentage doesn't say where the frame went

https://github.com/timkrest/FrameHUD/blob/main/docs/article-frame-phases.md
1•timkrest•29m ago•0 comments

The Telescope NASA Launched Sunday Was Built to Look at You

https://galratner.substack.com/p/the-telescope-nasa-launched-sunday
2•blartpaul•32m ago•0 comments

The Gemini app is now available for Windows

https://blog.google/innovation-and-ai/products/gemini-app/gemini-app-now-on-windows/
3•quysala12•36m ago•1 comments

Thinking with Looped Flows

https://arxiv.org/abs/2609.11801
1•E-Reverance•38m ago•0 comments

Metamorphosis: Transformations in the Early Modern Flap Book (19th Century)

https://publicdomainreview.org/collection/metamorphosis-early-modern-flap-book/
1•benbreen•38m ago•0 comments

One company that steals accuses another company that steals [pdf]

https://www-cdn.anthropic.com/e50be2e51e7695dc4b1366a37a245a597377d3b5/Anthropic-Detecting-and-co...
2•iamsyr•40m ago•1 comments

Show HN: Hekla, an event sourcing runtime with its own language

https://hekla.tqwewe.com/
1•tqwewe•46m ago•0 comments

DeepSeek Harness

https://www.deepseek.com/harness/en/
3•dotmanish•48m ago•0 comments

It Breaks a Village: Bevy's 6th Birthday

https://blog.fallible.net/it-breaks-a-village/
2•RohanAdwankar•49m ago•1 comments

GPT Image 2.5 for Consulting Presentations: Faster Slides and Smarter Control

https://medium.com/@2315610426/gpt-image-2-5-f36976cf7632
2•chenxi030826•51m ago•0 comments

The Bayeux Tapestry: Woven by the Victors

https://www.historytoday.com/archive/out-margins/bayeux-tapestry-woven-victors
2•prismatic•52m ago•0 comments

How to Make a PwC-Style PowerPoint with AI (2): 5 More Consulting Frameworks

https://medium.com/@2315610426/how-to-make-a-pwc-style-powerpoint-with-ai-2-5-more-consulting-fra...
1•chenxi030826•52m ago•1 comments

Trial Testing Out-of-Body Experiences Produces Unexpected Twist

https://www.uvahealth.com/news/trial-testing-out-of-body-experiences-yields-unexpected-twist
1•geox•58m ago•0 comments

Dioxus Labs is joining Cognition

https://dioxuslabs.com/blog/joining-cognition/
2•antimora•59m ago•0 comments

9/11 in Realtime (synced globally for 9/11)

https://911realtime.org
2•robbiebyrd•59m ago•1 comments

Günther Anders, the Philosopher at the End of the World

https://www.compactmag.com/article/gunther-anders-the-philosopher-at-the-end-of-the-world/
2•Caiero•1h ago•0 comments

Outflow connects directly to inverters, mints solar electricity records

1•OutflowLabsInc•1h ago•1 comments

Show HN: CertArena – Free AI certification simulator (zero deps, native Node 24)

https://aicertarena.com/
1•pennylaw946•1h ago•0 comments

Reconstructing Concurrency Invariants Through Medieval East Asian Logic

https://oborona.zip/post/a-middle-period-engine-reconstructing-concurrency-invariants-through-eas...
1•gg582•1h ago•0 comments

LiteLLM Alternatives?

1•leanroute_ai•1h ago•1 comments