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•8mo ago

Comments

tomfly•8mo ago
where is the entrance and exit?
Jaxan•8mo ago
Doesn’t matter, because all positions are reachable. So just pick any two positions at the border and remove a wall.
kazinator•8mo 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•8mo 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•8mo 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•8mo 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.

Happy Public Domain Day 2026

https://publicdomainreview.org/blog/2026/01/public-domain-day-2026/
116•apetresc•2h ago•14 comments

A website to destroy all websites

https://henry.codes/writing/a-website-to-destroy-all-websites/
411•g0xA52A2A•7h ago•242 comments

Why users cannot create Issues directly

https://github.com/ghostty-org/ghostty/issues/3558
73•xpe•3h ago•26 comments

Marmot – A distributed SQLite server with MySQL wire compatible interface

https://github.com/maxpert/marmot
32•zX41ZdbW•2h ago•5 comments

Can Bundler be as fast as uv?

https://tenderlovemaking.com/2025/12/29/can-bundler-be-as-fast-as-uv/
185•ibobev•6h ago•64 comments

Cameras and Lenses (2020)

https://ciechanow.ski/cameras-and-lenses/
378•sebg•11h ago•46 comments

Show HN: Enroll, a tool to reverse-engineer servers into Ansible config mgmt

https://enroll.sh
96•_mig5•1d ago•20 comments

Linux is good now

https://www.pcgamer.com/software/linux/im-brave-enough-to-say-it-linux-is-good-now-and-if-you-wan...
564•Vinnl•7h ago•487 comments

Extensibility: The "100% Lisp" Fallacy

https://kyo.iroiro.party/en/posts/100-percent-lisp/
17•todsacerdoti•2h ago•3 comments

WebAssembly as a Python Extension Platform

https://nullprogram.com/blog/2026/01/01/
55•ArmageddonIt•6h ago•1 comments

Show HN: OpenWorkers – Self-hosted Cloudflare workers in Rust

https://openworkers.com/introducing-openworkers
388•max_lt•13h ago•116 comments

California Delete Request and Opt-out Platform (DROP)

https://privacy.ca.gov/DROP/
20•8organicbits•3h ago•1 comments

Dell's version of the DGX Spark fixes pain points

https://www.jeffgeerling.com/blog/2025/dells-version-dgx-spark-fixes-pain-points
113•thomasjb•9h ago•57 comments

BYD Sells 4.6M Vehicles in 2025, Meets Revised Sales Goal

https://www.bloomberg.com/news/articles/2026-01-01/byd-sells-4-6-million-vehicles-in-2025-meets-r...
201•toomuchtodo•12h ago•315 comments

2025 Letter

https://danwang.co/2025-letter/
278•Amorymeltzer•13h ago•178 comments

Python numbers every programmer should know

https://mkennedy.codes/posts/python-numbers-every-programmer-should-know/
302•WoodenChair•13h ago•137 comments

Bluetooth Headphone Jacking: A Key to Your Phone [video]

https://media.ccc.de/v/39c3-bluetooth-headphone-jacking-a-key-to-your-phone
444•AndrewDucker•17h ago•164 comments

Finland detains ship and its crew after critical undersea cable damaged

https://www.cnn.com/2025/12/31/europe/finland-estonia-undersea-cable-ship-detained-intl
350•wslh•9h ago•306 comments

50% of U.S. vinyl buyers don't own a record player

https://lightcapai.medium.com/the-great-return-from-digital-abundance-to-analog-meaning-cfda9e428752
147•ResisBey•12h ago•160 comments

DENT: A network operating system (NOS) for everyone else

https://dent.dev/
7•teleforce•1h ago•2 comments

Gaming on a Receipt Printer [video]

https://www.youtube.com/watch?v=oEqvYXYI56s
9•zdw•5d ago•1 comments

China's BYD set to overtake Tesla as top EV seller

https://www.bbc.com/news/articles/cj9rjwpvmpzo
24•decimalenough•1h ago•10 comments

I was wrong about TypeScript part 1

https://chefama.blog/blog/posts/i-was-wrong-about-typescript-1
17•todsacerdoti•4d ago•1 comments

I rebooted my social life

https://takes.jamesomalley.co.uk/p/this-might-be-oversharing
360•edent•17h ago•290 comments

Quickemu: Quickly create and run optimised Windows, macOS and Linux VMs

https://github.com/quickemu-project/quickemu
124•teekert•2d ago•26 comments

Moving Images Related to the Apollo Missions, 1967–1969

https://catalog.archives.gov/id/133360601
39•handfuloflight•1w ago•3 comments

Straussian Memes

https://www.lesswrong.com/posts/CAwnnKoFdcQucq4hG/straussian-memes-a-lens-on-techniques-for-mass-...
27•kp1197•7h ago•34 comments

C-events, yet another event loop, simpler, smaller, faster, safer

https://zelang-dev.github.io/c-events/
66•thetechstech•6d ago•11 comments

If you care about security you might want to move the iPhone Camera app

https://blog.jgc.org/2025/12/if-you-care-about-security-you-might.html
167•jgrahamc•4d ago•73 comments

All my Deutschlandtickets gone: Fraud at an industrial scale [video]

https://media.ccc.de/v/39c3-all-my-deutschlandtickets-gone-fraud-at-an-industrial-scale
107•Kyro38•4d ago•46 comments