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.

Voyager 1 Is About to Reach One Light-Day from Earth

https://scienceclock.com/voyager-1-is-about-to-reach-one-light-day-from-earth/
418•ashishgupta2209•4h ago•139 comments

Scaleway turns Mac minis into high‑density, Raspberry Pi–managed servers

https://www.scaleway.com/en/blog/how-we-turn-apples-mac-mini-into-high-performance-dedicated-serv...
44•Lwrless•1h ago•38 comments

Investors expect AI use to soar. That's not happening

https://www.economist.com/finance-and-economics/2025/11/26/investors-expect-ai-use-to-soar-thats-...
33•gaius_baltar•52m ago•27 comments

A Fast 64-Bit Date Algorithm (30–40% faster by counting dates backwards)

https://www.benjoffe.com/fast-date-64
60•benjoffe•3d ago•12 comments

From blood sugar to brain relief: GLP-1 therapy slashes migraine frequency

https://www.medlink.com/news/from-blood-sugar-to-brain-relief-glp-1-therapy-slashes-migraine-freq...
35•Anon84•3h ago•21 comments

A Vibe Coded SaaS Killed My Team

https://cendyne.dev/posts/2025-11-26-a-vibe-coded-saas-killed-my-team.html
19•speckx•1h ago•4 comments

A cell so minimal that it challenges definitions of life

https://www.quantamagazine.org/a-cell-so-minimal-that-it-challenges-definitions-of-life-20251124/
174•ibobev•8h ago•77 comments

Show HN: I turned algae into a bio-altimeter and put it on a weather balloon

https://radi8.dev/blog/stratospore/
43•radeeyate•4d ago•4 comments

OpenAI needs to raise at least $207B by 2030

https://ft.com/content/23e54a28-6f63-4533-ab96-3756d9c88bad
415•akira_067•3h ago•346 comments

Optery (YC W22) Hiring CISO, Release Manager, Tech Lead (Node), Full Stack Eng

https://www.optery.com/careers/
1•beyondd•1h ago

Statistical Process Control in Python

https://timothyfraser.com/sigma/statistical-process-control-in-python.html
155•lifeisstillgood•10h ago•49 comments

JOPA: Java compiler in C++, Jikes modernized to Java 6 with Claude

https://github.com/7mind/jopa
26•pshirshov•3d ago•22 comments

DRAM prices are spiking, but I don't trust the industry's why

https://www.xda-developers.com/dram-prices-spiking-dont-trust-industry-reasons/
46•binarycrusader•1h ago•12 comments

Show HN: KiDoom – Running DOOM on PCB Traces

https://www.mikeayles.com/#kidoom
303•mikeayles•20h ago•41 comments

Surprisingly, Emacs on Android is pretty good

https://kristofferbalintona.me/posts/202505291438/
205•harryday•3d ago•106 comments

Copyparty, the FOSS file server [video]

https://www.youtube.com/watch?v=15_-hgsX2V0
177•franczesko•6d ago•48 comments

Slop Detective – Fight the Slop Syndicate

https://slopdetective.kagi.com/
28•speckx•2h ago•9 comments

Is DWPD Still a Useful SSD Spec?

https://klarasystems.com/articles/is-dwpd-still-useful-ssd-spec/
38•zdw•5d ago•20 comments

Qiskit open-source SDK for working with quantum computers

https://github.com/Qiskit/qiskit
27•thinkingemote•6h ago•1 comments

Image Diffusion Models Exhibit Emergent Temporal Propagation in Videos

https://arxiv.org/abs/2511.19936
86•50kIters•10h ago•12 comments

Cloudflare outage should not have happened

https://ebellani.github.io/blog/2025/cloudflare-outage-should-not-have-happened-and-they-seem-to-...
95•b-man•2h ago•116 comments

Trillions spent and big software projects are still failing

https://spectrum.ieee.org/it-management-software-failures
578•pseudolus•1d ago•533 comments

Jakarta is now the biggest city in the world

https://www.axios.com/2025/11/24/jakarta-tokyo-worlds-biggest-city-population
410•skx001•1d ago•317 comments

CS234: Reinforcement Learning Winter 2025

https://web.stanford.edu/class/cs234/
173•jonbaer•18h ago•38 comments

Show HN: We built an open source, zero webhooks payment processor

https://github.com/flowglad/flowglad
347•agreeahmed•1d ago•200 comments

How to repurpose your old phone into a web server

https://far.computer/how-to/
299•louismerlin•4d ago•105 comments

1,700-year-old Roman sarcophagus is unearthed in Budapest

https://apnews.com/article/hungary-roman-sarcophagus-discovery-budapest-77a41fe190bbcc167b43d0514...
126•gmays•1d ago•71 comments

A new bridge links the math of infinity to computer science

https://www.quantamagazine.org/a-new-bridge-links-the-strange-math-of-infinity-to-computer-scienc...
223•digital55•22h ago•127 comments

Launch HN: Onyx (YC W24) – Open-source chat UI

219•Weves•1d ago•143 comments

FLUX.2: Frontier Visual Intelligence

https://bfl.ai/blog/flux-2
345•meetpateltech•1d ago•102 comments