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.

Back to the Future of Handwriting Recognition

https://jackschaedler.github.io/handwriting-recognition/
1•at1as•1m ago•0 comments

Historical Discoveries That Reshaped Modern Historical Understanding

https://thehistoricalinsights.page/2026/08/historical-discoveries.html
1•historical1234•3m ago•0 comments

A macOS app for customizing which browser to start

https://github.com/johnste/finicky
1•mooreds•4m ago•0 comments

The Tragedy of the Cognitive Commons

https://arxiv.org/abs/2607.29380
1•jmintz•4m ago•0 comments

Show HN: Bio Tools – install drug design tools easily

https://github.com/David-OConnor/bio_tools
1•the__alchemist•4m ago•0 comments

Midlife Vascular Risk Burden and Dementia-Free Survival Years

https://www.neurology.org/doi/10.1212/WN9.0000000000000152
1•bookofjoe•4m ago•0 comments

Automatia Update: Next of Kin

https://libriscv.no/blog/next-of-kin/
1•fwsgonzo•4m ago•0 comments

A California Program Is Bringing Down the Cost of Heat Pumps by Buying Bulk

https://www.wired.com/story/california-group-buy-bringing-down-heat-pump-costs/
1•Brajeshwar•5m ago•0 comments

4 Hours and 37 minutes of serving nothing

https://koleslaw.ai/blog/running-a-30b-model-on-spot-gpus
1•murphman•6m ago•0 comments

The Great Chinese Oil Mystery

https://www.theatlantic.com/economy/2026/07/china-iran-usa-oil-prices/688086/
1•alphabetatango•6m ago•1 comments

Show HN: MergeImage – merge and stitch images locally in the browser

https://mergeimage.app/
1•lby910722•6m ago•0 comments

Extreme 220GHz+Broadband Silicon Capacitor X2SC 0201M 22nF BV11

https://pim.murata.com/asset/pim4/siliconCapacitor/SICAP_X2SC422522_PDF_SILICONCAPACITOR
1•peter_d_sherman•6m ago•0 comments

Why Open Source Matters for AI: Models should be infrastructure, not appliances

https://oreillyradar.substack.com/p/why-open-source-matters-for-ai
1•dbreunig•8m ago•0 comments

Japan and the US Supported the Yen Last Week

https://www.emergingtrajectories.com/lh/us-japan-yen-intervention/
1•cl42•8m ago•1 comments

We Got Better at Keeping You Alive. Not at Keeping You Healthy

https://julienreszka.com/blog/we-got-better-at-keeping-you-alive-not-at-keeping-healthy/
1•julienreszka•8m ago•0 comments

Controversial Bitcoin fork BIP-110 mines two blocks, then stops

https://www.coindesk.com/tech/2026/08/09/controversial-bitcoin-fork-bip-110-mines-two-blocks-then...
1•HardwareLust•8m ago•0 comments

China-Free Batteries Made from Salt Are Finally Here

https://www.wsj.com/business/energy-oil/china-free-batteries-made-from-salt-are-finally-here-cc1c...
2•inferhaven•8m ago•2 comments

Magnitude 7.4 Earthquake – 5 km S of San José del Palmar, Colombia

https://earthquake.usgs.gov/earthquakes/eventpage/us6000tjl2/executive
2•Bender•9m ago•0 comments

Show HN: Slashscore, an open developer graph built from public GitHub activity

https://www.slashscore.com
1•wingravity•14m ago•0 comments

Flight Is Canceled After a Child Refuses to Be Seated

https://www.nytimes.com/2026/08/09/travel/flight-canceled-child-seatbelt-porter-canada.html
1•elo2000•15m ago•0 comments

Google is making it harder to build custom ROMs for Pixel phones

https://www.androidauthority.com/google-pixel-kernel-code-forms-3696441/
1•Markoff•15m ago•0 comments

Claude Refund Policy: Why Anthropic Denied My Request

https://tobyonfitnesstech.com/blog/anthropic-refund-scam/
1•cube00•16m ago•0 comments

Show HN: PrivateRedact – Offline PII redaction with a local LLM, no cloud

https://github.com/monjurulkarim/privateredact
1•rajubuet24•16m ago•0 comments

Show HN: My math notes for anything that touches ML

https://github.com/publications-and-more/pub
3•Amlal•16m ago•0 comments

Beltrunner: Game Design Postmortem

https://blog.gingerbeardman.com/2026/07/30/beltrunner-game-design-postmortem/
2•surprisetalk•19m ago•0 comments

Xirp: The Agentic Development Environment Built by Spotify

https://portal.spotify.com/blog/introducing-xirp
1•KitN•19m ago•0 comments

Next year's iPhone redesign with all-glass look might be canceled

https://9to5mac.com/2026/08/10/next-years-iphone-redesign-with-all-glass-look-might-be-canceled-r...
2•mgh2•20m ago•0 comments

OpenAI's New Device Will Be Hockey Puck-Sized and Cost over $300

https://www.bloomberg.com/news/articles/2026-08-06/what-is-openai-s-device-a-doughnut-shaped-spea...
19•simonebrunozzi•24m ago•15 comments

Mars Bar from 1991 found – and it's 20g bigger than today's

https://www.bbc.com/news/articles/c1j1kjy7gewo
44•RickJWagner•27m ago•29 comments

Show HN: Vocal Slice – cut audio by selecting text, fully on-device

https://vocalslice.com/
2•terranivium•27m ago•0 comments