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

Comments

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

Building more with GPT-5.1-Codex-Max

https://openai.com/index/gpt-5-1-codex-max/
86•hansonw•1h ago•57 comments

Europe is scaling back GDPR and relaxing AI laws

https://www.theverge.com/news/823750/european-union-ai-act-gdpr-changes
133•ksec•4h ago•149 comments

Launch HN: Mosaic (YC W25) – Agentic Video Editing

https://mosaic.so
69•adishj•3h ago•52 comments

Show HN: DNS Benchmark Tool – Compare and monitor resolvers

https://github.com/frankovo/dns-benchmark-tool
14•ovo101•1h ago•10 comments

Cypherpunks Hall of Fame

https://github.com/cypherpunkshall/cypherpunkshall.github.io
10•kiray•35m ago•4 comments

Adventures in upgrading Proxmox

https://blog.vasi.li/adventures-in-upgrading-proxmox/
36•speckx•2h ago•25 comments

Control LLM Spend and Access with any-LLM-gateway

https://blog.mozilla.ai/control-llm-spend-and-access-with-any-llm-gateway/
11•aittalam•1w ago•1 comments

A $1k AWS mistake

https://www.geocod.io/code-and-coordinates/2025-11-18-the-1000-aws-mistake/
219•thecodemonkey•9h ago•187 comments

The Future of Programming (2013) [video]

https://www.youtube.com/watch?v=8pTEmbeENF4
115•jackdoe•6d ago•74 comments

Thunderbird adds native Microsoft Exchange email support

https://blog.thunderbird.net/2025/11/thunderbird-adds-native-microsoft-exchange-email-support/
133•babolivier•7h ago•30 comments

Show HN: I made a down detector for down detector

https://downdetectorsdowndetector.com
470•gusowen•18h ago•144 comments

The peaceful transfer of power in open source projects

https://shkspr.mobi/blog/2025/11/the-peaceful-transfer-of-power-in-open-source-projects/
165•edent•5h ago•111 comments

Netherlands returns control of Nexperia to Chinese owner

https://www.bloomberg.com/news/articles/2025-11-19/dutch-hand-back-control-of-chinese-owned-chipm...
21•boovic•46m ago•6 comments

Multimodal Diffusion Language Models for Thinking-Aware Editing and Generation

https://github.com/tyfeld/MMaDA-Parallel
104•lnyan•9h ago•12 comments

What Killed Perl?

https://entropicthoughts.com/what-killed-perl
51•speckx•8h ago•100 comments

Outdated Samsung handset linked to fatal emergency call failure in Australia

https://www.theregister.com/2025/11/18/samsung_emergency_call_failure/
53•doener•2h ago•35 comments

I just want working RCS messaging

https://wt.gd/i-just-want-my-rcs-messaging-to-work
255•joecool1029•17h ago•239 comments

How two photographers transformed RAW photo support on Mac

https://petapixel.com/2025/11/14/how-two-photographers-transformed-raw-photo-support-on-mac/
29•gbugniot•4d ago•11 comments

To launch something new, you need "social dandelions"

https://www.actiondigest.com/p/to-launch-something-new-you-need-social-dandelions
11•curiouska•49m ago•0 comments

Show HN: Vibe Prolog

https://github.com/nlothian/Vibe-Prolog
9•nl•3h ago•0 comments

Your smartphone, their rules: App stores enable corporate-government censorship

https://www.aclu.org/news/free-speech/app-store-oligopoly
371•pabs3•5h ago•186 comments

Programming the Commodore 64 with .NET

https://retroc64.github.io/
97•mariuz•5d ago•30 comments

Emoji evidence errors don’t undo a murder conviction

https://blog.ericgoldman.org/archives/2025/11/emoji-evidence-errors-dont-undo-a-murder-conviction...
60•hn_acker•3h ago•61 comments

Pebble, Rebble, and a path forward

https://ericmigi.com/blog/pebble-rebble-and-a-path-forward/
449•phoronixrly•1d ago•231 comments

Reproducible C++ builds by logging Git hashes

https://jgarby.uk/posts/git_repr/
8•j4cobgarby•5d ago•7 comments

Ultima VII Revisited

https://github.com/ViridianGames/U7Revisited
202•erickhill•1w ago•74 comments

Build vs. Buy: What This Week's Outages Should Teach You

https://www.toddhgardner.com/blog/build-vs-buy-outages
26•toddgardner•2h ago•23 comments

Show HN: Browser-based interactive 3D Three-Body problem simulator

https://trisolarchaos.com/?pr=O_8(0.6)&n=3&s=5.0&so=0.00&im=rk4&dt=1.00e-4&rt=1.0e-6&at=1.0e-8&bs...
207•jgchaos•1d ago•96 comments

Itiner-e: A high-resolution dataset of roads of the Roman Empire

https://www.nature.com/articles/s41597-025-06140-z
36•benbreen•1w ago•6 comments

Learning to Boot from PXE

https://blog.imraniqbal.org/learning-to-boot-from-pxe/
51•speckx•7h ago•29 comments