frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Generating Mazes with Inductive Graphs (2017)

https://jelv.is/blog/Generating-Mazes-with-Inductive-Graphs/
20•todsacerdoti•1y ago

Comments

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

AI Influencers Now Indistinguishable from Real Creators

https://www.techbuzz.ai/articles/ai-influencers-now-indistinguishable-from-real-creators
1•Vaslo•32s ago•0 comments

White House sends Blanche's Attorney General nomination to Congress

https://www.politico.com/live-updates/2026/06/08/congress/todd-blanche-attorney-general-nominatio...
1•embedding-shape•38s ago•0 comments

I built a local TypeScript guardrail for AI agent cost failures

https://github.com/salimassili62-afk/ai-costguard
1•salim2006•2m ago•0 comments

Beyond Dexterity: Why Contact May Define the Next Era of Robotics

https://spectrum.ieee.org/agilink-contact-intelligence-robot-manipulation
1•Brajeshwar•3m ago•0 comments

Apple's New AI Models Contain 'None' of Google's Gemini Assistant

https://www.macrumors.com/2026/06/09/apples-new-ai-contains-no-gemini/
1•bound008•4m ago•0 comments

React Native Windows v0.83 is here

https://devblogs.microsoft.com/react-native/%f0%9f%9a%80react-native-windows-v0-83-is-here/
2•soheilpro•5m ago•0 comments

Two Types of Bureaucracy: Enabling and Coercive

https://lozeve.com/posts/types-of-bureaucracy-enabling-and-coercive
1•mooreds•6m ago•0 comments

An open-source tool helping cities, states, and regions understand climate risks

https://cdp-action-explorer.net/
1•mooreds•6m ago•0 comments

Why are we still arguing about the industrial revolution?

https://www.ft.com/content/f8379b23-f029-4274-b508-5452d965ad28
1•mmarian•7m ago•1 comments

What about OpenCL and CUDA C++ alternatives?

https://www.modular.com/blog/democratizing-ai-compute-part-5-what-about-cuda-c-alternatives
2•eatonphil•10m ago•0 comments

Kahan Summation Algorithm

https://en.wikipedia.org/wiki/Kahan_summation_algorithm
2•tosh•14m ago•0 comments

AAuth Protocol

https://datatracker.ietf.org/doc/draft-hardt-oauth-aauth-protocol/
1•mooreds•14m ago•0 comments

Loop Engineering

https://addyosmani.com/blog/loop-engineering/
1•vinhnx•16m ago•0 comments

TokkeyCC – OpenAI-compatible API for 100 AI models, $0.22 per 1M tokens

https://tokkeycc.com
1•wangyixiang•16m ago•0 comments

Show HN: Local-first history, search, and analytics for Claude Code and Codex

https://github.com/sudomichael/agentgraphed
1•ushercakes•16m ago•0 comments

Start Small: The key to successful software projects

https://keystonebit.com/blog/start-small
1•gatinsama•17m ago•0 comments

Google patches new Chrome zero-day flaw exploited in the wild

https://www.bleepingcomputer.com/news/security/google-patches-fifth-chrome-zero-day-bug-exploited...
2•Brajeshwar•17m ago•0 comments

Everything You Wanted to Know About a Kids' Social Media Ban

https://www.michaelgeist.ca/2026/06/everything-you-wanted-to-know-about-a-kids-social-media-ban-b...
2•goalieca•19m ago•0 comments

Deep Work Timer

https://www.deepworkdepot.com/
1•jimsojim•19m ago•0 comments

Why are people pumping their bodies with fat from corpses?

https://www.theguardian.com/commentisfree/2026/apr/26/alloclae-cadaver-fat-filler
1•PaulHoule•20m ago•1 comments

Nango runs untrusted customer code at scale

https://nango.dev/blog/how-nango-runs-untrusted-customer-code-at-scale/
2•rguldener•20m ago•0 comments

Fabrice Bellard's Home Page

https://bellard.org/
2•janisz•21m ago•0 comments

Judge Learns Both Sides Used AI, Cancels Trial, Kicks Everyone Off the Case

https://www.404media.co/judge-learns-lawyers-on-both-sides-of-case-used-ai-cancels-trial-kicks-ev...
7•arto•21m ago•0 comments

Scissors vs. Swiping: The Hidden Cost of Touchscreens and How Designers Can Help

https://caseorganic.substack.com/p/when-swiping-supplants-scissors
1•SLHamlet•22m ago•0 comments

Universities Expand R&D Efforts in GAN, Sic, GaO

https://marklapedus.substack.com/p/universities-expand-r-and-d-efforts
2•ChipNode•24m ago•0 comments

Latest In Lithography: JSR up for sale?; FEL; forecasts–chips, memory, EUV

https://marklapedus.substack.com/p/the-latest-news-in-lithography-2ef
3•ChipNode•25m ago•0 comments

Show HN: ChromiumFish – Open-source fingerprint-hardened Browser for Scraping

https://github.com/arman-bd/chromiumfish
6•armanified•26m ago•1 comments

Show HN: Proquiro – Land acquisition software for Indian real estate teams

https://proquiro.com
3•nvignesh•26m ago•0 comments

Show HN: Terra – Off-market real estate sourcing, with research and AI modelling

https://terraconsole.com
2•vampiregrey•28m ago•0 comments

Or Equivalent Experience: Lazy Mistakes in Hiring and the Truth Behind Jobs Data

https://substack.norabble.com/p/or-equivalent-experience
2•nedruod•29m ago•0 comments