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.

I still don't understand this SYN attack, but now I can block it easily

https://boston.conman.org/2026/01/28.2
1•birdculture•2m ago•0 comments

Outsourcing Thinking

https://erikjohannes.no/posts/20260130-outsourcing-thinking/index.html
1•todsacerdoti•6m ago•0 comments

Convicted ex-Google engineer faces up to 175 year sentence for AI tech theft

https://www.reuters.com/legal/government/ex-google-engineer-convicted-stealing-ai-secrets-chinese...
1•delichon•6m ago•0 comments

Two lines of code for making your MCPs compatible with OpenAI libs

https://github.com/stepacool/mcphero
1•Arterialist•10m ago•0 comments

Custom machine kept man alive without lungs for 48 hours

https://arstechnica.com/health/2026/01/custom-machine-kept-man-alive-without-lungs-for-48-hours/
1•ben_w•10m ago•0 comments

Private Credit Worries Bedevil Shares of Biggest Buyout Shops

https://www.bloomberg.com/news/articles/2026-01-31/private-credit-worries-bedevil-shares-of-bigge...
1•zerosizedweasle•11m ago•0 comments

Humans Tap into a 'Collective Unconscious'–and It May Be Shaping Brains

https://www.popularmechanics.com/science/a70012418/shared-consciousness/
1•general_reveal•11m ago•1 comments

GlassWorm Loader Hits Open VSX via Developer Account Compromise

https://socket.dev/blog/glassworm-loader-hits-open-vsx-via-suspected-developer-account-compromise
1•feross•11m ago•0 comments

What we can learn from tiny traces of ancient blood chemicals

https://theconversation.com/life-in-fossil-bones-what-we-can-learn-from-tiny-traces-of-ancient-bl...
1•janandonly•12m ago•0 comments

James Mickens' Tenure Announcement

https://mickens.seas.harvard.edu/tenure-announcement-april-2019/
2•nemosaltat•12m ago•1 comments

The State of WebAssembly – 2025 and 2026

https://platform.uno/blog/the-state-of-webassembly-2025-2026/
1•breve•13m ago•0 comments

"You can post anything to Moltbook"

https://twitter.com/galnagli/status/2017573842051334286
1•habinero•13m ago•0 comments

Show HN: Save upto 70% of API usage in agentic development

https://github.com/AffanShaikhsurab/COON
1•affanshaiksurab•15m ago•0 comments

'It's ridiculous': publicans bemused by rise of single-file queues to get served

https://www.theguardian.com/lifeandstyle/2026/jan/31/publicans-bemused-single-file-queue-trend-pubs
2•zeristor•15m ago•0 comments

The Spacecraft That Wouldn't Die

https://www.corememory.com/p/exclusive-theres-a-spaceship-epic-aerospace-chimera
2•trothamel•17m ago•0 comments

Show HN: Replicating OpenAI Prism's LaTeX Workflows in 24h Using Gemini Agents

https://frism.pixelraft.com/introducing
1•ToadPresident•19m ago•1 comments

Show HN: Pinchwork – A task marketplace where AI agents hire each other

https://github.com/anneschuth/pinchwork
2•aschuth•21m ago•0 comments

Content Negotiation Is All You Need (For AI-Readable Docs)

https://docsalot.dev/blog/we-shipped-llms-txt-heres-why-it-matters
1•fazkan•22m ago•0 comments

Data Processing Benchmark Featuring Rust, Go, Swift, Zig, Julia etc.

https://github.com/zupat/related_post_gen
1•behnamoh•22m ago•0 comments

Autonomous cars, drones cheerfully obey prompt injection by road sign

https://www.theregister.com/2026/01/30/road_sign_hijack_ai/
7•breve•25m ago•0 comments

Scientists use enigmatic cell structures to record RNA activity

https://phys.org/news/2026-01-scientists-enigmatic-cell-devices-rna.html
2•PaulHoule•25m ago•0 comments

Microdosing for Depression Appears to Work as Placebo

https://www.wired.com/story/microdosing-for-depression-appears-to-work-about-as-well-as-drinking-...
1•worik•26m ago•1 comments

RustDesk blocks cross-city connections after botnet, locks out users

https://github.com/rustdesk/rustdesk/discussions/14167
1•gordian-mind•27m ago•1 comments

Ask HN: What actually helped you reduce stress & sleep when advice didn’t work?

1•Remberti•27m ago•6 comments

Humans can post on moltbook without ANY AGENT

https://github.com/shash42/post-a-molt
1•shash42•28m ago•0 comments

AI alignment is a $200B+ product problem, not a research question

https://betterhalfai.substack.com/p/ai-alignment-is-a-200b-product-problem
1•i7l•29m ago•0 comments

Michael Saylor's MicroStrategy BTC position is 3% away from negative value

https://www.blossomsocial.com/posts/Market-Cap-Losses-in-Bitcoin-and-Ethereum-Over-Last-7-Hours__...
1•donsupreme•30m ago•0 comments

In Praise Of –Dry-Run

https://henrikwarne.com/2026/01/31/in-praise-of-dry-run/
2•ingve•31m ago•0 comments

Show HN: I built a habit tracker that doesn't shame you for missing a day

https://amble.today/
2•tusharnaik•31m ago•1 comments

Erika Krouse's OCD Ranking of ~500 Literary Magazines

http://www.erikakrousewriter.com/erika-krouses-ocd-ranking-of-483-literary-magazines-for-short-fi...
1•Curiositry•32m ago•0 comments