frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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.

Embedded Rust or C Firmware? Lessons from an Industrial Microcontroller Use Case

https://arxiv.org/abs/2604.25679
34•mrtz•2d ago•12 comments

Show HN: Apple's Sharp Running in the Browser via ONNX Runtime Web

https://github.com/bring-shrubbery/ml-sharp-web
80•bring-shrubbery•4h ago•10 comments

Group averages obscure how an individual's brain controls behavior: study

https://med.stanford.edu/news/all-news/2026/04/brain-scans-individual-versus-group.html
53•hhs•2d ago•8 comments

A couple million lines of Haskell: Production engineering at Mercury

https://blog.haskell.org/a-couple-million-lines-of-haskell/
310•unignorant•14h ago•143 comments

All Four Sentinel-1 Satellites Are Now Live

https://orbitaltoday.com/2026/05/03/all-four-sentinel-1-satellites-are-now-live-and-europes-earth...
11•cgeier•2h ago•4 comments

This Month in Ladybird – April 2026

https://ladybird.org/newsletter/2026-04-30/
410•richardboegli•17h ago•101 comments

Utilyze measures how efficiently your GPU is doing useful work

https://github.com/systalyze/utilyze
24•nateb2022•2d ago•3 comments

Dav2d

https://code.videolan.org/videolan/dav2d
535•dabinat•20h ago•150 comments

Six Years Perfecting Maps on WatchOS

https://www.david-smith.org/blog/2026/04/29/maps-on-watchos/
371•valzevul•16h ago•87 comments

Windows quality update: Progress we've made since March

https://blogs.windows.com/windows-insider/2026/05/01/windows-quality-update-progress-weve-made-si...
92•jovial_cavalier•1d ago•262 comments

Do_not_track

https://donottrack.sh/
409•RubyGuy•20h ago•126 comments

Neanderthals ran 'fat factories' 125,000 years ago (2025)

https://www.universiteitleiden.nl/en/news/2025/07/neanderthals-ran-fat-factories-125000-years-ago
233•andsoitis•17h ago•121 comments

Unverified Evaluations in Dusk's PLONK

https://osec.io/blog/2026-04-30-unverified-evaluations-dusk-plonk/
28•deut-erium•2d ago•4 comments

Care homes and hotels in Japan shut as expansion strategy unravels

https://www.newsonjapan.com/article/149075.php
68•mikhael•12h ago•21 comments

Specsmaxxing – On overcoming AI psychosis, and why I write specs in YAML

https://acai.sh/blog/specsmaxxing
178•brendanmc6•7h ago•201 comments

Inventions for battery reuse and recycling increase seven-fold in last decade

https://www.epo.org/en/news-events/news/inventions-battery-reuse-and-recycling-increase-more-seve...
210•JeanKage•3d ago•22 comments

VS Code inserting 'Co-Authored-by Copilot' into commits regardless of usage

https://github.com/microsoft/vscode/pull/310226
1320•indrora•18h ago•702 comments

Systemd-manager-TUI: A TUI application for managing systemd services

https://github.com/Matheus-git/systemd-manager-tui
41•thunderbong•3h ago•11 comments

Investors pile into clean energy as Iran war drives push for energy security

https://www.ft.com/content/9921f2b5-c910-4cec-a50f-cad453935a1a
78•JumpCrisscross•4h ago•78 comments

The agent harness belongs outside the sandbox

https://www.mendral.com/blog/agent-harness-belongs-outside-sandbox
123•shad42•16h ago•90 comments

A more efficient implementation of Shor's algorithm

https://lwn.net/Articles/1066156/
96•signa11•2d ago•25 comments

Clojurists Together – Q2 2026 Open Source Funding Announcement

https://www.clojuriststogether.org/news/q2-2026-funding-announcement/
119•dragandj•16h ago•14 comments

How fast is a macOS VM, and how small could it be?

https://eclecticlight.co/2026/05/02/how-fast-is-a-macos-vm-and-how-small-could-it-be/
255•moosia•1d ago•95 comments

Because it doesn't have to

https://blog.computationalcomplexity.org/2026/04/because-it-doesnt-have-to.html
64•zdw•3d ago•13 comments

A physics engine with incremental rollback for multiplayer games

https://easel.games/blog/2026-rollback-physics
103•BSTRhino•1d ago•37 comments

Show HN: State of the Art of Coding Models, According to Hacker News Commenters

https://hnup.date/hn-sota
129•yunusabd•16h ago•73 comments

Maryland to ban A.I.-driven price increases in grocery stores

https://www.nytimes.com/2026/05/01/business/surveillance-pricing-groceries-maryland.html
195•doener•12h ago•169 comments

Benchmarking a Bug Scanner

https://blog.detail.dev/posts/bug-scanner/
7•drob•2d ago•5 comments

DeepSeek V4 – almost on the frontier

https://simonwillison.net/2026/Apr/24/deepseek-v4/
570•indigodaddy•1d ago•343 comments

The USB Situation

https://randsinrepose.com/archives/the-usb-situation/
140•herbertl•3d ago•188 comments