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.

wireplug.org – roaming and NAT traversal for WireGuard, written in Rust

https://wireplug.org
1•alpn•1m ago•0 comments

Show HN: Nous – give GTM agents one context graph across your tools

https://github.com/NousC/opennous
1•sethiaakash04•2m ago•1 comments

Inkling Benchmark Results

https://artificialanalysis.ai/articles/thinking-machines-has-released-inkling-the-new-leading-u-s...
1•theanonymousone•2m ago•0 comments

Cosmic DE's First Seven Months

https://system76.com/blog/post/cosmic-de-first-seven-months
2•speckx•2m ago•0 comments

Why opposite sides of a debate share the same mistake

https://www.thesignalist.io/s/under-the-same-umbrella/
1•kodesko•4m ago•0 comments

Show HN: QBasic Gorillas (Repeeled)

https://gameswithtony.com/gorillas/
1•TonyAlicea10•4m ago•0 comments

Kimi K3 is live on kimi code

https://twitter.com/i/status/2077751108114551034
3•poorvsahu•4m ago•0 comments

US-style tipping culture came to London

https://www.londoncentric.media/p/how-us-style-tipping-culture-came
2•BerislavLopac•4m ago•0 comments

Show HN: Algotrek – Algorithms visualized, problem shape shifting and a tutor

https://app.algotrek.io
1•nyggy•5m ago•0 comments

Show HN: I built a Clojure runtime on top of Chez Scheme

https://yogthos.net/posts/2026-07-02-jolt.html
1•yogthos•7m ago•0 comments

Show HN: Ramsford – AI butler for travel, cruise planning, and daily tasks

https://ramsford.ai/
1•ramsford1000•7m ago•0 comments

Eric S. Raymond take on AI

https://twitter.com/esrtweet/status/2074889702381953222
1•lobo_tuerto•8m ago•0 comments

Reading a 3k-Year-Old Poem (Odyssey) to a 3-Year-Old Boy

https://www.theatlantic.com/family/2026/07/odyssey-read-father-son/687914/
1•theanonymousone•9m ago•0 comments

A Short History of Cinema(2020)

https://www.scienceandmediamuseum.org.uk/objects-and-stories/very-short-history-of-cinema
1•hopelessluca•10m ago•0 comments

Why a model that explains 95% of variance only compresses 18%

https://thefarsightedzipper.substack.com/p/lossy-vs-lossless-how-the-compression
2•alessino•10m ago•0 comments

Kimi K3 to beat Opus 4.8

https://twitter.com/zijing_wu/status/2077699476194771064
2•WithinReason•11m ago•0 comments

Show HN: I've built tldraw for HTML and Markdown pages (with encryption)

https://pastehex.dev/
1•pandrre•12m ago•0 comments

Starlink from 1984 – By Nemanja Trifunovic

https://nemanjatrifunovic.substack.com/p/starlink-from-1984
1•rbanffy•13m ago•0 comments

Will there be any more bugs to find after AI has fixed them all?

https://insertchaos.bearblog.dev/when-ai-has-fixed-all-the-bugs/
2•snorbleck•14m ago•0 comments

Show HN: An MCP server that frames screen recordings and shots in Apple bezels

https://github.com/cwooddgr/bezelbub/tree/main/bezelbub-mcp
2•igneous_rocker•17m ago•1 comments

Show HN: Termaxa – I found my AI-agent gate had silently stopped gating Cursor

https://github.com/termaxa/termaxa
1•devdoc83•17m ago•1 comments

Should you be paying to get insights of your own money?

https://cardneuro.com/
1•AmiPatel•18m ago•0 comments

AI agents write PostgreSQL like Python

https://vvka-141.github.io/pgmi/articles/ai-agents-write-postgresql-like-python/
1•aevlampiev•18m ago•0 comments

Eli Lilly to buy psychedelics maker AtaiBeckley for $2.8B

https://www.cnbc.com/2026/07/16/eli-lilly-to-buy-psychedelics-maker-ataibeckley-2point8-billion.html
2•ulrikrasmussen•18m ago•0 comments

Compatibility regressions with anti-tampering SDKs used by apps are resolved

https://discuss.grapheneos.org/d/40383-compatibility-regressions-with-anti-tampering-sdks-used-by...
1•Cider9986•18m ago•0 comments

The $110/month self-improving pipeline

https://andywidjaja.com/blog/110-pipeline
1•digitallogic•19m ago•0 comments

Show HN: A Python script that parses sheet music and plays it on a drum machine

https://hankthemason.com/projects/fugue-for-my-drum-machine
1•hankthemason•19m ago•0 comments

End of Line: Replacing MCP with Standard Filesystem Tools

https://www.sicpers.info/2026/07/end-of-line-replacing-mcp-with-standard-filesystem-tools/
1•grahamlee•20m ago•0 comments

WHO calls for action as new cancer cases are projected to nearly double by 2050

https://www.who.int/news/item/08-07-2026-who-calls-for-urgent-action-as-new-cancer-cases-are-proj...
1•gmays•21m ago•0 comments

64% of recent Show HN launches are invisible to AI search (I audited 45)

https://ai-visibility-report.surge.sh/
1•miguelaudits•23m ago•0 comments