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.

Premier league bans gambling sponsors

https://www.footyheadlines.com/2646571793/betting-ban-takes-effect-no-more-gambling-sponsors-in-t...
1•paoliniluis•2m ago•1 comments

Save and restore may be coming to GNOME

https://lwn.net/Articles/1083750/
1•signa11•3m ago•0 comments

Show HN: Play SNES, gba, in your terminal, even in tmux

https://github.com/jhickner/rom
1•jhickner•4m ago•0 comments

Specula: Scaling formal specs for autonomous model checking of system code

https://arxiv.org/abs/2607.25333
1•matt_d•4m ago•0 comments

Memory-level parallelism: AMD is the king

https://lemire.me/blog/2026/07/25/memory-level-parallelism-amd-is-the-king/
1•signa11•8m ago•0 comments

LLVM AI Tool Use Policy

https://llvm.org/docs/AIToolPolicy.html
1•compiler-guy•9m ago•0 comments

Inkling Small is the highest-scoring open-weight model evaluated by ARC Prize

https://twitter.com/arcprize/status/2082925303601459347
1•thebricklayr•11m ago•0 comments

Hugging Face Incident Initial Post-Mortem

https://cloudsecurityalliance.org/artifacts/hugging-face-ciso-post-mortem
1•hentrep•11m ago•0 comments

Gemini Robotics

https://deepmind.google/models/gemini-robotics/
2•jonbaer•12m ago•0 comments

DeepSeek Founder Liang Wenfeng in His Own Words

https://www.geopolitechs.org/p/deepseek-founder-liang-wenfeng-in
1•gmays•13m ago•0 comments

WTF per Minute – An Actual Measurement for Code Quality

https://muhammad-rahmatullah.medium.com/wtf-per-minute-an-actual-measurement-for-code-quality-780...
1•compiler-guy•13m ago•0 comments

NVIDIA-labs OO Agents: Native Python Object-Oriented Agents

https://github.com/NVIDIA-NeMo/labs-OO-Agents
1•matt_d•14m ago•0 comments

Anthropic AI Models Hacked Three Companies During Tests

https://www.wsj.com/tech/ai/anthropic-ai-models-hacked-three-companies-during-tests-bd752c86
5•bmulholland•19m ago•3 comments

The AI Aesthetic

https://blog.jim-nielsen.com/2026/ai-aesthetic/
2•montroser•21m ago•0 comments

The Absurdity of Albert Camus

https://www.historytoday.com/archive/portrait-author-historian/absurdity-albert-camus
1•apollinaire•22m ago•0 comments

Cross-Vendor Semantic Void Matrix: Zero-Byte Outputs in GPT/Claude/Gemini/Kimi

https://zenodo.org/records/21696066
1•rayanpal_•23m ago•0 comments

Satyress

https://www.satyress.com/#mission
2•tomcam•24m ago•0 comments

Data Science Weekly – Issue 662

https://datascienceweekly.substack.com/p/data-science-weekly-issue-662
1•sebg•25m ago•0 comments

At-the-Roofline Sparse Tensor Contractions on Vector Processors for Inference

https://arxiv.org/abs/2607.25504
1•matt_d•25m ago•0 comments

COLDCARD Mk3 Security Advisory

https://blog.coinkite.com/coldcard-mk3-seed-generation-warning/
1•ParentiSoundSys•25m ago•0 comments

Index 01 Is in Mass Production

https://repebble.com/blog/index-01-is-in-mass-production
1•mellosouls•27m ago•0 comments

I fucking love this; you don't

https://graybeard.ing/i-fucking-love-this-you-dont/
3•rglover•27m ago•1 comments

Banks in Talks to Lend $15B for Anthropic Data Center Backed by Google

https://www.wsj.com/tech/banks-in-talks-to-lend-15-billion-for-anthropic-data-center-backed-by-go...
2•Palmik•28m ago•0 comments

Public Records Requests Are Surging. The Government Is Falling Behind

https://www.nytimes.com/2026/07/29/us/politics/foia-public-document-requests.html
1•doener•29m ago•0 comments

A Leaked Memo Ties Cyberattacks on Minnesota Water Utilities to Iran

https://www.wired.com/story/a-leaked-memo-ties-cyberattacks-on-minnesota-water-utilities-to-iran/
1•justworks•31m ago•0 comments

Quantum advantage through trusted quantum computation – IBM Quantum

https://www.ibm.com/quantum/blog/quantum-advantage
1•unprovable•32m ago•1 comments

Reinventing rewards for the AI multiverse [pdf]

https://www.mercer.com/assets/us/en_us/shared-assets/local/attachments/pdf-reinventing-rewards-fo...
1•zuhayeer•33m ago•0 comments

Ellison Empire Beseiged on All Fronts

https://www.nakedcapitalism.com/2026/07/oracle-paramount-wbd-ellison-empire-beseiged-bonds-stocks...
1•JumpCrisscross•34m ago•0 comments

Investors love AI, as long as you're a cloud host

https://techcrunch.com/2026/07/30/investors-love-ai-as-long-as-youre-a-cloud-host/
1•toomuchtodo•35m ago•0 comments

If technology got better, why did everything get worse?

https://www.sammystraus.com/#if-technology-got-better-why-did-everything-get-worse
1•sammy0910•36m ago•0 comments