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.

OpenRouter is joining Stripe

https://openrouter.ai/blog/announcements/openrouter-is-joining-stripe/
773•rvz•12h ago•387 comments

Turns are Better than Radians (2022)

https://www.computerenhance.com/p/turns-are-better-than-radians
114•mayoff•4h ago•53 comments

Go 1.27

https://go.dev/blog/go1.27
561•database64128•11h ago•141 comments

Why Microsoft Entertainment Pack had a sticker announcing that it had Tetris?

https://devblogs.microsoft.com/oldnewthing/20260818-00/?p=112621
16•tybulewicz•1h ago•4 comments

A faster way to calculate the day of the week

https://www.benjoffe.com/fast-day-of-week
87•gavide•3d ago•10 comments

Google replaced Git tags for certain source code with obtaining via Google Drive

https://grapheneos.social/@GrapheneOS/117057099753905023
413•Animux•12h ago•168 comments

Manabu Kosaka's Handmade Paper Sculptures

https://coca11272000.wixsite.com/manabukosaka
96•surprisetalk•15h ago•12 comments

Asana cleared 5 years of engineering work in 2 weeks with Codex

https://openai.com/index/asana/
3•tosh•17m ago•0 comments

Unlocking a locked/deactivated e-waste Cricut Maker

https://sprocketfox.io/xssfox/2026/07/01/cricut-unlock/
182•1e1a•11h ago•43 comments

A joke domain purchase turned in geopolitical warfare

https://sprocketfox.io/xssfox/2026/08/19/sondehub-and-war/
828•kareiva•18h ago•131 comments

Unsloth Dynamic 3.0 GGUFs

https://unsloth.ai/docs/basics/dynamic-3.0-ggufs
227•jonesy827•11h ago•85 comments

Feature Request: Support AGENTS.md

https://github.com/anthropics/claude-code/issues/6235
195•fg137•8h ago•108 comments

Sol loves to cheat

https://jumploops.com/blog/sol-loves-to-cheat/
122•jumploops•1d ago•79 comments

Casio F-B100W-1A

https://www.casio.com/uk/watches/casio/product.F-B100W-1A/
330•__fst__•14h ago•268 comments

Os8088.com: IBM XT OS now has a Browser, CP/M 2.2 with Z80 core and MS Word 1.1a

https://os8088.com/spotlight/
72•jggonz•9h ago•37 comments

Geolocating a random island using geometry and CUDA programming

https://yassa9.github.io/osint/gralhix-004/
449•yassa9•17h ago•77 comments

Sectorforth is a 16-bit x86 Forth that fits in a 512-byte boot sector

https://github.com/cesarblum/sectorforth
14•sigalor•3d ago•2 comments

Pixel 11 Pro Fold feels like the end of an era

https://www.theverge.com/tech/981956/google-pixel-11-pro-fold-review
52•animalcule•10h ago•104 comments

Simulacra and Simulation

https://en.wikipedia.org/wiki/Simulacra_and_Simulation
55•soupspaces•1w ago•21 comments

fx :Tiny, open, native coding agent.

https://fx.sh
228•handfuloflight•1d ago•96 comments

Launch HN: OneCLI (YC S26) – OSS sandboxed agent harness for teams

https://github.com/onecli/onecli
73•guyb3•13h ago•20 comments

The little-known winstart.bat batch file

https://devblogs.microsoft.com/oldnewthing/20260811-00/?p=112605
101•ingve•4d ago•26 comments

Mathematics in the age of AI

https://arxiv.org/abs/2608.16753
145•jonbaer•14h ago•179 comments

PostgreSQL for Everything

https://www.raphaelbauer.com:443/posts/postgresql-everything/
335•karlmush•16h ago•209 comments

Zuckerberg encouraged growth over child safety, ex-Meta executive testifies

https://www.reuters.com/legal/litigation/former-meta-engineer-resumes-testimony-landmark-trial-ov...
38•thm•2h ago•0 comments

Extensible Software in the age of LLMs

https://jeremymorrell.dev/blog/extensible-software-in-the-age-of-llms/
140•coloneltcb•13h ago•53 comments

Xorshift Generators

https://www.alanzucconi.com/2026/08/15/xorshift-generators/
67•tobr•4d ago•39 comments

Air Theremin – A browser theremin you play by waving at your webcam

https://theremin.bizibah.com/
266•gurov•19h ago•89 comments

Ornith-1.5: From Self-Scaffolding to Self-Improvement

https://ornith.ai/ornith_1_5.html
187•CommonGuy•15h ago•61 comments

Pacing model development in an era of cyber-critical capabilities

https://openai.com/index/pacing-model-development-cyber-capabilities/
146•j4mie•1d ago•213 comments