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.

Does Gas Town 'steal' usage from users' LLM credits to improve itself?

https://github.com/gastownhall/gastown/issues/3649
76•rektomatic•52m ago•27 comments

Cybersecurity looks like proof of work now

https://www.dbreunig.com/2026/04/14/cybersecurity-is-proof-of-work-now.html
65•dbreunig•1d ago•30 comments

Google broke its promise to me – now ICE has my data

https://www.eff.org/deeplinks/2026/04/google-broke-its-promise-me-now-ice-has-my-data
814•Brajeshwar•3h ago•355 comments

Ask HN: Who is using OpenClaw?

73•misterchocolat•2h ago•99 comments

PiCore - Raspberry Pi Port of Tiny Core Linux

http://tinycorelinux.net/5.x/armv6/releases/README
33•gregsadetsky•1h ago•2 comments

Cal.com is going closed source

https://cal.com/blog/cal-com-goes-closed-source-why
136•Benjamin_Dobell•6h ago•121 comments

God sleeps in the minerals

https://wchambliss.wordpress.com/2026/03/03/god-sleeps-in-the-minerals/
402•speckx•8h ago•87 comments

Live Nation illegally monopolized ticketing market, jury finds

https://www.bloomberg.com/news/articles/2026-04-15/live-nation-illegally-monopolized-ticketing-ma...
219•Alex_Bond•2h ago•61 comments

Fix monitor that goes black, off or blinks due to static electricity in chair

https://aalonso.dev/blog/2023/how-to-fix-monitor-that-goes-black-off-due-to-static-electricity-in...
92•cyclopeanutopia•3d ago•43 comments

Want to write a compiler? Just read these two papers (2008)

https://prog21.dadgum.com/30.html
422•downbad_•12h ago•129 comments

Golden eagles' return to English skies

https://www.bbc.co.uk/news/articles/cje4zlxqkqdo
26•techterrier•3d ago•15 comments

Good sleep, good learning, good life (2012)

https://super-memory.com/articles/sleep.htm
330•downbad_•12h ago•160 comments

Do you even need a database?

https://www.dbpro.app/blog/do-you-even-need-a-database
159•upmostly•9h ago•220 comments

Anna's Archive loses $322M Spotify piracy case without a fight

https://torrentfreak.com/annas-archive-loses-322-million-spotify-piracy-case-without-a-fight/
267•askl•13h ago•278 comments

Adaptional (YC S25) is hiring AI engineers

https://www.ycombinator.com/companies/adaptional/jobs/k7W6ge9-founding-engineer
1•acesohc•4h ago

How can I keep from singing?

https://blog.danieljanus.pl/singing/
6•nathell•1d ago•0 comments

Show HN: GNU grep as a PHP extension

https://github.com/hparadiz/ext-gnu-grep
27•hparadiz•5d ago•4 comments

Show HN: Libretto – Making AI browser automations deterministic

https://github.com/saffron-health/libretto
63•muchael•5h ago•21 comments

Show HN: I rebuilt a 2000s browser strategy game on Cloudflare's edge

https://kampfinsel.com/
20•parzivalt•4d ago•18 comments

Kalshi CEO expects US DOJ to prosecute insider trading cases

https://www.semafor.com/article/04/15/2026/kalshi-ceo-tarek-mansour-expects-us-doj-to-prosecute-i...
89•thm•3h ago•98 comments

Why are Flock employees watching our children?

https://substack.com/home/post/p-193593234
154•enaaem•2h ago•32 comments

Forcing an inversion of control on the SaaS stack

https://www.100x.bot/a/client-side-injection-inversion-of-control-saas
62•shardullavekar•5d ago•39 comments

Costasiella kuroshimae

https://en.wikipedia.org/wiki/Costasiella_kuroshimae
133•vinnyglennon•3d ago•50 comments

The Gemini app is now on Mac

https://blog.google/innovation-and-ai/products/gemini-app/gemini-app-now-on-mac-os/
27•thm•4h ago•5 comments

How Wake-On-LAN works (2020)

https://blog.xaner.dev/post/wake-on-lan/
75•swq115•4d ago•25 comments

Wacli – WhatsApp CLI

https://github.com/steipete/wacli
222•dinakars777•14h ago•146 comments

Pretty Fish: A better mermaid diagram editor

https://pretty.fish/
148•pastelsky•6d ago•23 comments

Gemini Robotics-ER 1.6

https://deepmind.google/blog/gemini-robotics-er-1-6/
197•markerbrod•7h ago•62 comments

Metro stop is Ancient Rome's new attraction

https://www.bbc.com/travel/article/20260408-a-150-metro-ticket-to-ancient-rome
104•Stevvo•6d ago•29 comments

In the last 30 years, the number of public companies has been cut in half

https://twitter.com/ToddZywicki/status/2044167534681936085
24•MrBuddyCasino•1h ago•14 comments