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

Comments

tomfly•7mo ago
where is the entrance and exit?
Jaxan•7mo ago
Doesn’t matter, because all positions are reachable. So just pick any two positions at the border and remove a wall.
kazinator•7mo 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•7mo 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•7mo 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•7mo 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 YC support startups paying the 100K$ H1B fee to import talents?

1•blobembassay•1m ago•0 comments

Linux Kernel Version Numbers

http://www.kroah.com/log/blog/2025/12/09/linux-kernel-version-numbers/
1•JNRowe•5m ago•0 comments

Cashfree Payments Powers High-Scale, Speed-First Support

https://tech.cashfree.com/4-ways-cashfree-payments-powers-high-scale-speed-first-support-d93ac85e...
1•manishajayson•5m ago•0 comments

Why are there so many react developers?

1•blobembassay•5m ago•0 comments

Google Maps allocates survival across London's restaurants

https://laurenleek.substack.com/p/how-google-maps-quietly-allocates
1•justincormack•5m ago•0 comments

I'm Not AI, I'm Just Autistic

https://www.latoyarachelle.com/im-not-ai-im-just-autistic/
2•sodic•6m ago•0 comments

Building a Databricks Jobs Error Monitoring Dashboard

https://medium.com/dev-genius/building-a-databricks-jobs-error-monitoring-dashboard-a72f90650c87
1•protmaks•7m ago•0 comments

The Invisible Iceberg of AI Technical Debt

https://old.reddit.com/r/AIQuality/comments/1m83846/the_invisible_iceberg_of_ai_technical_debt/
1•PranayBatta•9m ago•1 comments

Show HN: I revived Spotify-TUI (now Spotatui) with native streaming and updates

https://github.com/LargeModGames/spotatui
1•LargeModGames•10m ago•1 comments

Show HN: Vieta Space, a visual LaTeX math editor

https://docs.vietaspace.com/guide/features
3•liamhawtin•14m ago•1 comments

'Alan's Universe' Shows What It Might Look Like to Win at YouTube

https://www.nytimes.com/2025/12/09/arts/television/youtube-alans-universe.html
1•fleahunter•18m ago•0 comments

Bascetta Star

https://mathematische-basteleien.de/bascettastar.htm
1•coolius•20m ago•0 comments

Spied: BMW's First Electric M Car

https://www.thedrive.com/news/2027-bmw-ix3-m-spy-shots
1•PaulHoule•21m ago•0 comments

Show HN: Bifrost – open-source LLM Gateway (50x lower latency than LiteLLM)

https://github.com/maximhq/bifrost
3•dskuldeep•22m ago•0 comments

Springer Nature retracts ~40 publications that trained ANNs on 'bonkers' dataset

https://www.thetransmitter.org/retraction/exclusive-springer-nature-retracts-removes-nearly-40-pu...
2•sundarurfriend•23m ago•0 comments

Show HN: A Werewolf-style puzzle with zero lying

https://www.cluesofwho.com/
1•soasme•24m ago•0 comments

Apple will not let me join the Developer Program – and will not say why

https://yomuapp.kulman.sk/support
2•tectiv3•26m ago•1 comments

PeerTube V8: manage your videos with your team

https://framablog.org/2025/12/09/peertube-v8-manage-your-videos-with-your-team/
3•tcit•26m ago•0 comments

Whitehall rejects £1.8B digital ID price tag – but won't say what it will cost

https://www.theregister.com/2025/12/09/uk_digital_id_costs/
1•jjgreen•27m ago•0 comments

Compiler Engineering in Practice – Part 1: What Is a Compiler?

https://chisophugis.github.io/2025/12/08/compiler-engineering-in-practice-part-1-what-is-a-compil...
1•todsacerdoti•28m ago•0 comments

OpenAI paused a focus on AGI for 8 weeks to quickly improve ChatGPT

https://www.wsj.com/tech/ai/openai-sam-altman-google-code-red-c3a312ad
2•Hyeonjong•28m ago•0 comments

DynamoDB: Resilience and lessons from the Oct 2025 service disruption

https://www.youtube.com/watch?v=YZUNNzLDWb8
1•belter•31m ago•0 comments

The Joel Test: 12 Steps to Better Code (2000)

https://www.joelonsoftware.com/2000/08/09/the-joel-test-12-steps-to-better-code/
1•tamnd•31m ago•0 comments

Velocity-Bridge: Copy on iPhone. Paste on Linux. No Cloud, No macOS Required

https://github.com/Trex099/Velocity-Bridge
1•thunderbong•34m ago•0 comments

Nano Banana

https://imgeditor.co/
1•bellamoon544•36m ago•1 comments

The Joy of Playing Grandia, on Sega Saturn

https://www.segasaturnshiro.com/2025/11/27/the-joy-of-playing-grandia-on-sega-saturn/
3•tosh•36m ago•2 comments

What Is a Codec and Why Is It Important for Video Streaming?

https://www.red5.net/blog/what-is-a-codec/
1•mondainx•41m ago•0 comments

SGML Syntax Reference

http://sgmljs.sgml.net/docs/sgmlrefman.html
1•fanf2•43m ago•0 comments

UN environment report 'hijacked' by US and others over fossil fuels

https://www.bbc.com/news/articles/c1w9ge93w9po
2•defrost•47m ago•0 comments

Embracing the Improbable

https://kevinkelly.substack.com/p/embracing-the-improbable
2•thm•50m ago•0 comments