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.

Revealing the details of how OpenAI agents hacked Hugging Face

https://swarmtraces.org/
272•specked-citrus•6h ago•164 comments

Ollaya – Ollama for open-source, Jev-style decision models

https://ollaya.dev/
361•Ardakilic•8h ago•103 comments

Plan mode is dead

https://www.aymannadeem.com/artificial/intelligence,/developer/tools/2026/09/24/plan-mode-is-dead...
146•jmvldz•23h ago•150 comments

Show HN: Jev Plays Pokémon Red

https://jev-pokemon.vercel.app/
168•pancomplex•13h ago•72 comments

What even is an OS now?

https://sockpuppet.org/blog/2026/09/25/what-even-is-an-os-now/
108•fratellobigio•5h ago•188 comments

Jury finds Facebook liable for deceiving users in Cambridge Analytica case

https://www.cbsnews.com/news/facebook-liable-deceiving-users-cambridge-analytica/
81•pseudolus•1h ago•10 comments

Postgres SELECT DISTINCT Does Not Scale

https://www.dbos.dev/blog/postgres-select-distinct-does-not-scale
16•KraftyOne•1d ago•3 comments

Platform-independent SIMD in Go

https://go.dev/blog/simd-experiment
369•yurivish•15h ago•136 comments

Git-bug: Distributed, offline-first bug tracker embedded in Git

https://github.com/git-bug/git-bug
322•alentred•15h ago•106 comments

Excel now supports multiple values in a single cell

https://techcommunity.microsoft.com/blog/microsoft365insiderblog/put-multiple-values-in-one-cell-...
119•luispa•6h ago•89 comments

One Piece of Flock Camera Data Put This Innocent Woman in Jail for 13 Days

https://www.jezebel.com/flock-cameras-data-innocent-woman-arrested-lindsey-isaacs-palm-beach-flor...
66•HotGarbage•2h ago•21 comments

Show HN: Hacker Atlas - A map of what Hacker News talks about

https://hackeratlas.com/
22•andrearitossa•13h ago•6 comments

Gravity seems holographic. What does that mean for reality?

https://www.quantamagazine.org/gravity-seems-holographic-what-does-that-mean-for-reality-20260925/
132•ibobev•12h ago•140 comments

Remembering Johannes Doerfert

https://blog.llvm.org/posts/2026-09-24-rememberingjohannesdoerfert/
65•sdko•1d ago•2 comments

I wrote a ray tracer in Brainfuck

https://epestr.com/blog/writing-a-ray-tracer-in-brainfuck/
43•epestr•17h ago•12 comments

First Principles Thinking

https://sunilsadasivan.com/writing/first-principles-thinking/
231•sunils34•13h ago•102 comments

U.S. appeals court upholds designation of Anthropic as supply chain risk

https://www.cnbc.com/2026/09/25/pentagon-anthropic-ai-risk-appeals-court.html
408•cramer4next•12h ago•717 comments

Fourier Analysis: Drawing Llamas with Circles

https://adekau.github.io/posts/2020/llamas.html
8•cebert•1d ago•0 comments

Lab on a Contact Lens Can Measure Stress Through Serotonin

https://spectrum.ieee.org/serotonin-stress-smart-contact-lens
17•marc__1•5h ago•4 comments

Two and a half years without a gallbladder

https://tracydurnell.com/2026/09/16/two-and-a-half-years-without-a-gallbladder/
3•surprisetalk•1d ago•1 comments

Why didn't anybody tell me about Redis hash slots?

https://blog.verygoodsoftwarenotvirus.dev/posts/2026/09/23/why-didnt-anybody-tell-me-about-hash-s...
28•badrequest•2d ago•7 comments

Show HN: A game about fake news and memes

https://unspin.app/
9•azermite•3h ago•7 comments

How video games inspire great UX (2019)

https://jenson.org/games/
104•andsoitis•5d ago•16 comments

How we learned to stop worrying and love campus surveillance

https://fnl.mit.edu/how-we-learned-to-stop-worrying-and-love-campus-surveillance/
140•cdrnsf•7h ago•85 comments

TiddlyInstall: A universal, reusable, install system

https://robertsdotpm.github.io/_static/tiddlyinstall.html
5•Uptrenda•3h ago•5 comments

Show HN: Make math automatic with Mathy

https://gmays.com/making-math-automatic-with-mathy/
78•gmays•4d ago•21 comments

An airport cooled by natural ventilation

https://www.theguardian.com/environment/2026/sep/25/didnt-need-air-conditioning-airport-cooled-na...
54•Geekette•17h ago•30 comments

Show HN: Ekselio – Loveable for finance workflows (local first)

https://www.gptbeyond.com/try?home=1
9•kdautaj•6h ago•2 comments

What happens when you analyze your favorite college football team like the CIA?

https://www.cultivatelabs.com/posts/what-happens-when-you-analyze-college-football-like-the-cia
46•adam•13h ago•25 comments

Microsoft abandons personal AI chatbot race with Copilot reboot

https://www.bloomberg.com/news/articles/2026-09-25/microsoft-abandons-personal-ai-chatbot-race-wi...
91•sbulaev•13h ago•85 comments