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

Comments

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

Mermaid as a programming language for AI agents

https://twitter.com/xiaoxxchan/status/2011825791408226618
1•xxchan22•3m ago•0 comments

Show HN: N.codes – Let users generated mini-apps in your app

1•yungookim•6m ago•0 comments

Show HN: PixelMotion:AI video generation with Sora 2, Veo 3.1, and 9 more models

https://www.pixelmotion.io/
1•anotherbuilder•9m ago•0 comments

Tesla investigates whether its self-driving technology caused traffic violations

https://www.latimes.com/business/story/2026-01-16/tesla-is-probing-if-its-self-driving-technology...
1•MilnerRoute•9m ago•0 comments

I built a proper UI for e-com product image generation (chat doesn't scale)

https://aimockupgenerator.co/
1•dairis•9m ago•1 comments

Ask HN: Could we replace Job Descriptions with actual Git Issues?

1•A1aM0•10m ago•0 comments

Gemini Research MCP Server

https://github.com/fortaine/gemini-research-mcp
1•gfortaine•13m ago•0 comments

New Framework Proposes Spacetime as an Emergent Irreversible Information Process

https://zenodo.org/records/17911993
1•emsti•18m ago•2 comments

Show HN: Webship.dev – custom web systems, legacy code and performance

https://webship.dev/
1•pragidi•19m ago•0 comments

Disqus but Using GitHub. Cool Idea

https://giscus.app/
2•razodactyl•22m ago•0 comments

High-speed train crash in southern Spain leaves at least 21 dead

https://www.theguardian.com/world/2026/jan/18/high-speed-train-crash-in-adamuz-cordoba-southern-s...
2•perihelions•22m ago•0 comments

Show HN: Shared Device Group – scheduler-level GPU sharing for Kubernetes

https://github.com/sceneryback/shared-device-group
1•ChuangLabs•24m ago•0 comments

Clip to Siglip > Migrating Our 200M+ MultiModal Embeddings

https://huggingface.co/vulturelabs/vector-rosetta-clip-vit-base-patch32-to-siglip-vit-base-patch1...
1•teocalin37•29m ago•1 comments

Bring Back Ops Pride

https://substack.com/home/post/p-184825970
3•gpi•31m ago•0 comments

Your Problem framing is sabotaging your strategy

https://productpicnic.beehiiv.com/p/your-problem-framing-is-sabotaging-your-strategy
3•gpi•32m ago•0 comments

SFU prof launches legal-AI collaboration with Caseway to improve justice

https://www.sfu.ca/fas/computing/news-events/news/2026/january/sfu-launches-legal-ai-collaboratio...
1•ClearwayLaw•35m ago•1 comments

Semihemidemisemiquaver

https://en.wikipedia.org/wiki/Hundred_twenty-eighth_note
1•petethomas•40m ago•0 comments

Ask HN: How many local logins do you have on your computer?

2•bahmboo•43m ago•3 comments

Show HN: I quit coding years ago. AI brought me back

https://calquio.com
17•ivcatcher•53m ago•13 comments

Repo: Language Models with Context Re-Positioning

https://pub.sakana.ai/repo/
1•hardmaru•54m ago•0 comments

The Paper

https://zenodo.org/records/18294248
2•KaoruAK•55m ago•0 comments

Metro MCP: MCP Server for DC and NYC Metro

https://metro-mcp.anuragd.me/
2•Aarekaz•55m ago•0 comments

Claude Is Taking the AI World by Storm, and Even Non-Nerds Are Blown Away

https://www.wsj.com/tech/ai/anthropic-claude-code-ai-7a46460e
3•alhazrod•58m ago•4 comments

YouTube is silently deleting uploaded SRV3 (styled) subtitles

https://old.reddit.com/r/youtube/comments/1qdvgmc/uploading_srv3_subtitles_got_brokendisabled/
6•slowdog•1h ago•1 comments

Show HN: Why I forked Gemini CLI - a FOSS Cowork alt that *is* the OS

https://github.com/Prof-Harita/terminaI
1•ProfHarita•1h ago•1 comments

Utopian.Build – Getting Developers Paid

https://soundcloud.com/ludwig-schubert-372424919/utopianbuild-getting-developers-paid
1•ludwigschubi•1h ago•0 comments

Show HN: I made Claude play Minecraft using Agent SDK

https://github.com/haksndot/haksnbot-agent
3•haksndot•1h ago•0 comments

Chinese app 'Are You Dead' sparks debate on social isolation – DW News [video]

https://www.youtube.com/watch?v=ReLMRNkywsA
2•alamortsubite•1h ago•0 comments

TestIQ – Find duplicate tests using coverage analysis

https://github.com/pydevtools/TestIQ
1•kirankotari•1h ago•1 comments

Oldest Arrow Poison Discovered on 60k-Year-Old Stone Age Weapons

https://scitechdaily.com/worlds-oldest-arrow-poison-discovered-on-60000-year-old-stone-age-weapons/
1•Gaishan•1h ago•1 comments