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

Comments

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

Steve Jobs' son says he can help end cancer deaths – and he's raised $$$$

https://www.sfchronicle.com/health/article/reed-jobs-cancer-fund-21324598.php
1•aanet•1m ago•1 comments

Bill Gates asked Epstein for "antibiotics" for an STD from "Russian girls."

https://twitter.com/LeadingReport/status/2017297448197103947
5•sergiotapia•3m ago•0 comments

Wikipedia: Sandbox

https://en.wikipedia.org/wiki/Wikipedia:Sandbox
2•zaptrem•3m ago•0 comments

Nolto: Connect with Professionals Across the Fediverse

https://nolto.social/
1•walden789•3m ago•0 comments

Rover v2.0: Automating your projects with coding agents

https://endor.dev/blog/rover-2-0
1•janpio•4m ago•0 comments

Palisades Fire victims told they had to pay for new hydrant in order to rebuild

https://abc7.com/post/palisades-fire-victims-told-had-pay-new-hydrant-order-rebuild/18488114/
2•donsupreme•5m ago•0 comments

Why It Took Linus Tech Tips 4 Years to Make a USB Cable [video]

https://www.youtube.com/watch?v=OT_iyvOy0Tk
1•tristanj•5m ago•1 comments

Chainalysis: Impersonation, AI crypto scams stole $17B last year

https://www.coindesk.com/business/2026/01/14/chainalysis-report-reveals-impersonation-and-ai-cryp...
1•PaulHoule•8m ago•0 comments

Show HN: Arenas suck, here's why we just added one to Windsurf

https://windsurf.com/blog/windsurf-wave-14
3•agtestdvn•8m ago•2 comments

DHS ramps up surveillance in in immigration raids, sweeping in citizens

https://apnews.com/article/digital-crackdown-immigration-minneapolis-trump-52662450a15a7be8d9df69...
1•rawgabbit•9m ago•0 comments

The Dallas Morning News Is Hiring a Faith Reporter

https://eevd.fa.us6.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/job/2025878/
1•DoctorOW•11m ago•5 comments

F1 2026 – 3D Map: All the Tracks and Teams. Tons of Stats

https://elemap.com/f1map/
1•jkillick•12m ago•1 comments

Show HN: BlinkFund – Crowdfunding w Solana Blinks (donate directly from Twitter)

https://blinkfund.vercel.app/
1•aayushcb•15m ago•0 comments

I Test Drove a Chinese EV. Now I Don't Want to Buy American Cars Anymore

https://www.wsj.com/tech/personal-tech/chinese-ev-test-drive-xiaomi-su7-c3e59282
2•bookofjoe•15m ago•1 comments

Wyoming Introduces First-Ever Foreign Censorship Shield Bill

https://reclaimthenet.org/wyoming-introduces-first-ever-foreign-censorship-shield-bill-granite-act
1•mikece•15m ago•0 comments

Deer antler size best predicted by mother's health

https://www.youtube.com/watch?v=BORv-p7npls
1•scottndecker•18m ago•0 comments

I made a website that shows you random cultural moments with zero context

https://infinijest.com
2•hnmouse•19m ago•0 comments

Ask HN: Should a software engineer have research exposure?

2•c_daeda•20m ago•0 comments

Don Lemon interviews Elon Musk (2024) [video]

https://www.youtube.com/watch?v=hhsfjBpKiTw
3•irthomasthomas•22m ago•0 comments

AI Doubling Time Horizon v1.1

https://metr.org/blog/2026-1-29-time-horizon-1-1/
1•chriskanan•23m ago•0 comments

Major Epstein files are now publicly viewable across multiple official archives

https://twitter.com/polydao/status/2002143534800044520
4•websku•23m ago•3 comments

Chat Is Going to Eat the World

https://deadneurons.substack.com/p/chat-is-going-to-eat-the-world
2•nr378•27m ago•1 comments

A free MCU watch tracker with achievements for Avengers: Doomsday

https://doomsdayrdy.vercel.app/
1•AlonsoGP•30m ago•1 comments

Ask HN: Blocked by YouTube? (Sign in to confirm you're not a bot)

3•dv35z•31m ago•2 comments

The AI bubble has nothing to do with AI

5•AIFairy•34m ago•0 comments

Dual citizenship could be on the chopping block in America

https://qz.com/dual-citizenship-us-legislation
7•ceejayoz•35m ago•4 comments

Ollama Hosts Form Anonymous AI Network Beyond Platform Guardrails

https://www.sentinelone.com/labs/silent-brothers-ollama-hosts-form-anonymous-ai-network-beyond-pl...
2•toomuchtodo•35m ago•1 comments

Peerweb: Decentralized website hosting via WebTorrent

https://peerweb.lol/
23•dtj1123•35m ago•14 comments

OpenClaw: The Rapid Rise

https://comuniq.xyz/post?t=774
2•01-_-•37m ago•0 comments

Silver plunges 30% in worst day since 1980, gold tumbles

https://www.cnbc.com/2026/01/30/silver-gold-fall-price-usd-dollar-fed-warsh-chair-trump-metals.html
8•pera•37m ago•0 comments