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.

Honda Civics and the Evil Valet

https://juniperspring.org/posts/honda-evil-valet/
209•librick•6h ago•34 comments

Pac-Man, but you're the ghost

https://garrit.xyz/posts/2026-06-13-pac-man-but-you-re-the-ghost
51•mindracer•2h ago•23 comments

Tribblix: The retro Illumos distribution

http://tribblix.org/
17•naturalmovement•1h ago•6 comments

Noise infusion banned from statistical products published by Census Bureau

https://desfontain.es/blog/banning-noise.html
797•nl•16h ago•496 comments

Phoenix LiveView 1.2 Released

https://phoenixframework.org/blog/phoenix-liveview-1-2-released
12•ksec•1h ago•0 comments

GLM 5.2 Is Out

https://twitter.com/jietang/status/2065784751345287314
501•aloknnikhil•14h ago•268 comments

Free SQL→ER diagram tool, runs in the browser, nothing uploaded

https://sqltoerdiagram.com/
42•robhati•3h ago•11 comments

Every Frame Perfect

https://tonsky.me/blog/every-frame-perfect/
658•ravenical•19h ago•220 comments

Building a serial and VGA "everything console"

http://oldvcr.blogspot.com/2026/06/building-serial-and-vga-everything.html
21•classichasclass•4h ago•0 comments

FreeOberon – Open-Source, Cross-Platform, Free Pascal/Turbo Pascal-Like Language

https://github.com/kekcleader/FreeOberon
69•peter_d_sherman•2d ago•26 comments

Treating pancreatic tumours may have revealed cancer's master switch

https://economist.com/science-and-technology/2026/06/12/treating-pancreatic-tumours-may-have-reve...
343•andsoitis•17h ago•123 comments

(Re//Verse 2026) Taxonomy and Deobfuscation of a Real World Binary Obfuscator [pdf]

https://github.com/AnalogCyberNuke/RE-Verse-2026-Slides/blob/main/Reverse26.pdf
13•not_a9•2d ago•1 comments

Pyodide 314.0: Python packages can now publish WebAssembly wheels to PyPI

https://blog.pyodide.org/posts/314-release/
112•agriyakhetarpal•4d ago•26 comments

Python 3.14 garbage collection rigamarole

https://theconsensus.dev/p/2026/06/06/python-3-14-garbage-collection-rigamarole.html
36•eatonphil•1d ago•22 comments

Weave: Merging based on language structure and not lines

https://ataraxy-labs.github.io/weave/
20•rohanat•4h ago•9 comments

Making Claude a Chemist

https://www.anthropic.com/research/making-claude-a-chemist
23•gmays•3h ago•11 comments

Software Architecture Guide (2019)

https://martinfowler.com/architecture/
47•laxmena•2h ago•18 comments

Codex for open source

https://openai.com/form/codex-for-oss/
219•EvgeniyZh•2d ago•74 comments

LaserWriter Seeds

https://inventingthefuture.ghost.io/laserwriter-seeds/
5•frizlab•3d ago•0 comments

Consciousness likely not unique to earthlings, paper says

https://news.ucr.edu/articles/2026/06/10/consciousness-likely-not-unique-earthlings-paper-says
3•giuliomagnifico•1h ago•0 comments

Amazon CEO's talks with U.S. officials triggered crackdown on Anthropic models

https://www.wsj.com/tech/ai/amazon-ceos-talks-with-u-s-officials-triggered-crackdown-on-anthropic...
639•ls612•13h ago•468 comments

GameBoy Workboy

https://tcrf.net/Workboy
179•tosh•13h ago•62 comments

ReactOS (FOSS "Windows") achieves 3D-accelerated Half-Life on real hardware

https://www.phoronix.com/news/ReactOS-Running-Half-Life
174•jeditobe•7h ago•25 comments

The Neat Little Vehicles That Run a Cemetery

https://www.thedrive.com/news/meet-the-neat-little-vehicles-that-run-a-cemetery
6•PaulHoule•4d ago•0 comments

Running DOS on Behringers DDX3216 with a DIY x86-Bios from Scratch

https://chrisdevblog.com/2026/06/08/running-dos-on-behringers-ddx3216-using-a-diy-x86-bios/
88•rasz•12h ago•20 comments

Apt Encounters of the Third Kind

https://igor-blue.github.io/2021/03/24/apt1.html
19•ogurechny•4h ago•4 comments

A low-carbon computing platform from your retired phones

https://research.google/blog/a-low-carbon-computing-platform-from-your-retired-phones/
273•vikas-sharma•21h ago•144 comments

Appreciating Exif

https://brentfitzgerald.com/posts/appreciating-exif/
150•burnto•4d ago•33 comments

The redistribution of housing wealth caused by rent control [pdf]

https://www.rhawa.org/file/secure/shs-the-impact-of-rent-control-in-st-paul.pdf
66•luu•3h ago•93 comments

RTX 5080 and RTX 3090 Setup: 80 Tok/s on Qwen 3.6 27B Q8

https://imil.net/blog/posts/2026/rtx-5080-+-rtx-3090-setup-80+-tok-s-on-qwen-3.6-27b-q8/
229•iMil•20h ago•76 comments