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.

Security Review Scope for Daml: Coverage, Methods, and EVM Comparison

https://hacken.io/discover/daml-vs-solidity-smart-contract-audits-3-scope-decisions-for-researchers/
1•Dron_Rick•3m ago•0 comments

Auto approve pull requests with Jev

https://github.com/metalbear-co/jev-auto-approve
1•infiniteregrets•9m ago•0 comments

How ISIL is using Big Tech's AI to build bombs

https://www.aljazeera.com/news/2026/9/18/just-ask-grok-how-isil-is-using-big-techs-ai-to-build-bombs
1•smallerize•9m ago•0 comments

Migrating the GitHub Copilot Runtime to Rust, Using Copilot

https://github.blog/ai-and-ml/generative-ai/migrating-the-github-copilot-runtime-to-rust-using-co...
1•saikatsg•11m ago•0 comments

RoboHarm: Do Frontier Robot Policies Refuse Unsafe Instructions?

https://robocurve.org/roboharm/
1•fittingopposite•11m ago•0 comments

Chat-based Large Language Models replicate the mechanisms of a psychic's con

https://softwarecrisis.dev/letters/llmentalist/
2•jalev•12m ago•0 comments

An Ode to the Owl: The Inside Story of Psygnosis

https://www.timeextension.com/features/an-ode-to-the-owl-the-inside-story-of-psygnosis
1•Bluestein•13m ago•0 comments

The Millennium Problems for Biology

https://millenniumproblems.bio/
2•artninja1988•15m ago•0 comments

Outer Billiards on the Penrose Kite: Compactification and Renormalizaiton

https://arxiv.org/abs/1102.4635
1•vismit2000•17m ago•0 comments

WrathBench − an Agent Workbench for World of Warcraft

https://wrathbench.shard.page/
2•stymaar•20m ago•0 comments

Big Tech uses guarantees to keep $300B AI exposure off balance sheets

https://www.ft.com/content/7f11afae-c4e3-4054-a65b-873f3647f563
6•sbulaev•25m ago•0 comments

Densha de Go

https://en.wikipedia.org/wiki/Densha_de_Go!
4•tosh•26m ago•0 comments

The First Nolan Movie: The Odyssey and the world after men change it

https://www.firstrand.co.za/perspectives/article.html?article=the-first-nolan-movie
3•theDillinger•30m ago•0 comments

The Shaky Evidence That Flock Cameras Reduce Crime Rates

https://reason.com/2026/09/18/the-shaky-evidence-that-flock-cameras-reduce-crime-rates/
3•pseudolus•34m ago•0 comments

Claude Code is getting native AGENTS.md support

https://github.com/anthropics/claude-code/tree/main/mods/agents-md
4•thisisfatih•34m ago•0 comments

Open-source AI PR reviewer that helps you ship

https://nitpicker.dev/
3•Bluestein•36m ago•0 comments

An Agent's Breath. The Heart Beats by Itself, Breathing Is a Choice

https://piotrzientara.pl/agent-breath/
4•piotrzientara•39m ago•0 comments

The Cornetto Ice Cream Cone Framework for Prompting

https://hazn.com/cornetto
2•hazn•43m ago•0 comments

Ternary-Bonsai-8B-Gguf

https://huggingface.co/prism-ml/Ternary-Bonsai-8B-gguf
2•Bluestein•44m ago•0 comments

How Efficient Is Each Type of EV Charger? (2024)

https://insideevs.com/features/711659/ev-charger-efficiency-losses/
2•cisc•44m ago•0 comments

Show Your Work

https://jagasantagostino.com/blog/show-your-work
2•andsoitis•46m ago•0 comments

Tactile controls in a digital world (2024)

https://jenson.org/airpod/
2•andsoitis•51m ago•0 comments

Ask HN: What to focus on in this age of AI

2•yernarak•55m ago•2 comments

If AI coding is lowering your code quality, you're not managing quality right

https://www.i-kh.net/p/if-ai-coding-is-lowering-your-code
27•bucket2015•55m ago•29 comments

Humans Are the Only Real Agents

https://aboard.com/humans-are-the-only-real-agents/
3•k1m•57m ago•0 comments

velocity content marketing

https://www.briefiq.io/blog/what-is-content-velocity-in-seo-and-why-it-matters/
2•infofusioninnov•58m ago•0 comments

The Ma of a New Machine

https://jenson.org/ma/
2•andsoitis•1h ago•0 comments

Germany's green developers hit a wall: Insolvencies, tighter credit

https://www.briefs.co/news/germany-s-green-developers-hit-a-wall-insolvencies-tighter-c/
2•leonidasrup•1h ago•0 comments

Apache Cassandra 6 Accord transactions: What you need to know

https://www.instaclustr.com/blog/apache-cassandra-6-accord-transactions-what-you-need-to-know/
3•lewisl9029•1h ago•0 comments

Underclass: An OpenAI-compatible pooling proxy that pins sessions to one account

https://github.com/ghuntley/underclass
2•ghuntley•1h ago•0 comments