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

Comments

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

Qwen3.6-Max-Preview: Smarter, Sharper, Still Evolving

https://qwen.ai/blog?id=qwen3.6-max-preview
284•mfiguiere•3h ago•163 comments

ggsql: A Grammar of Graphics for SQL

https://opensource.posit.co/blog/2026-04-20_ggsql_alpha_release/
216•thomasp85•5h ago•51 comments

GitHub's Fake Star Economy

https://awesomeagents.ai/news/github-fake-stars-investigation/
532•Liriel•9h ago•288 comments

At long last, InfoWars is ours

https://theonion.com/at-long-last-infowars-is-ours/
74•HotGarbage•34m ago•26 comments

We accepted surveillance as default

https://vivianvoss.net/blog/why-we-accepted-surveillance
103•speckx•1h ago•30 comments

The Theory of Interstellar Trade [pdf]

https://www.princeton.edu/~pkrugman/interstellar.pdf
20•AFF87•1h ago•1 comments

Deezer says 44% of songs uploaded to its platform daily are AI-generated

https://techcrunch.com/2026/04/20/deezer-says-44-of-songs-uploaded-to-its-platform-daily-are-ai-g...
123•FiddlerClamp•2h ago•135 comments

Bloom (YC P26) Is Hiring

https://www.ycombinator.com/companies/trybloom/jobs
1•RayFitzgerald•57m ago

10 years ago, someone wrote a test for Servo that included an expiry in 2026

https://mastodon.social/@jdm_/116429380667467307
111•luu•22h ago•69 comments

M 7.4 earthquake – 100 km ENE of Miyako, Japan

https://earthquake.usgs.gov/earthquakes/eventpage/us6000sri7/
198•Someone•7h ago•83 comments

Kimi K2.6: Advancing Open-Source Coding

https://www.kimi.com/blog/kimi-k2-6
260•meetpateltech•2h ago•124 comments

At Long Last, InfoWars Is Ours

https://theonion.info/
103•xnx•33m ago•1 comments

Chernobyl's last wedding

https://www.bbc.com/news/articles/c0q92lx8q75o
27•1659447091•1d ago•5 comments

Sauna effect on heart rate

https://tryterra.co/research/sauna-effect-on-heart-rate
259•kyriakosel•4h ago•153 comments

Atlassian enables default data collection to train AI

https://letsdatascience.com/news/atlassian-enables-default-data-collection-to-train-ai-f71343d8
311•kevcampb•5h ago•75 comments

Larry Tesler: A Personal History of Modeless Text Editing and Cut/Copy-Paste (2012)

https://dl.acm.org/doi/epdf/10.1145/2212877.2212896
18•aragonite•3d ago•4 comments

WebUSB Extension for Firefox

https://github.com/ArcaneNibble/awawausb
106•tuananh•6h ago•87 comments

All phones sold in the EU to have replaceable batteries from 2027

https://www.theolivepress.es/spain-news/2026/04/20/eu-to-force-replaceable-batteries-in-phones-an...
608•ramonga•4h ago•486 comments

Show HN: Alien – Self-hosting with remote management (written in Rust)

32•alongub•2h ago•6 comments

OpenClaw isn't fooling me. I remember MS-DOS

https://www.flyingpenguin.com/build-an-openclaw-free-secure-always-on-local-ai-agent/
196•feigewalnuss•10h ago•241 comments

I'm never buying another Kindle

https://www.androidauthority.com/amazon-kindle-2026-3657863/
107•mikhael•2h ago•90 comments

Focused microwaves allow 3D printers to fuse circuits onto almost anything

https://newatlas.com/electronics/meta-nfc-focused-microwaves-circuits/
121•breve•2d ago•23 comments

I prompted ChatGPT, Claude, Perplexity, and Gemini and watched my Nginx logs

https://surfacedby.com/blog/nginx-logs-ai-traffic-vs-referral-traffic
96•startages•2h ago•18 comments

Ask HN: How to solve the cold start problem for a two-sided marketplace?

92•alegd•4h ago•96 comments

NSA is using Anthropic's Mythos despite blacklist

https://www.axios.com/2026/04/19/nsa-anthropic-mythos-pentagon
359•Palmik•7h ago•262 comments

Up to 8M Bees Are Living in an Underground Network Beneath This Cemetery

https://www.discovermagazine.com/up-to-8-million-bees-are-living-in-an-underground-network-beneat...
145•janandonly•2d ago•23 comments

IPC medley: message-queue peeking, io_uring, and bus1

https://lwn.net/Articles/1065490/
30•signa11•3d ago•0 comments

AI chatbots could be making you stupider

https://www.bbc.com/future/article/20260417-ai-chatbots-could-be-making-you-stupider
17•1vuio0pswjnm7•4h ago•11 comments

I Made the "Next-Level" Camera and I love it

https://thelibre.news/i-made-the-next-level-camera-and-i-love-it/
192•ndr•3d ago•66 comments

SDF Public Access Unix System

https://sdf.org/?ssh
155•neehao•1d ago•75 comments