Mat_Invert Demo - Hampton Court Maze
Attached is a demo of my new mat_invert node. It uses the new matrix data structure described here:
http://support.nodebox.net/discussions/show-your-work/1050-matrix-n...
This demo shows a diagram of the famous Hampton Court Maze and a matrix which allows us to answer the following question:
How long does it take to get to the center of the Hampton Court Maze?
On average: 88 moves, where a move is a walk from one decision point to another. At each point the wanderer rolls a dice to see which choice to take (unless they are at a dead end).
The Hampton Court Maze has 12 decision points, labeled A to L. The matrix shows the expected number of movements spent in column y starting from row x. The row sums show the total expected time to get to the center (M).
Incidentally, it was surprisingly easy to create this diagram in Nodebox. I imported the SVG of the maze from Wikipedia Commons (https://commons.wikimedia.org/wiki/File:Hampton_court_maze.svg). I then made 13 circular labels using my labelmaker node, and placed them using a freehand node filtered by my distinct_pts node with sensitivity set to 20. To place each label I just selected the freehand node, held down the mouse over the first position dragging slightly to get the placement just right, then repeated for the other 12 positions. The whole operation took only about a minute. This is a fabulous use of Nodebox's freehand node.
The calculations are made using an Absorbing Markov chain, described here:
https://en.wikipedia.org/wiki/Absorbing_Markov_chain
This technique requires a transition matrix showing the odds of moving between any two decision points in the maze. I did this by feeding a list of connected points (made with a simple make_string node) into a Markov subnetwork which uses that list to create the transition matrix, then subtracts it from the identity matrix. This was easy using my matrix nodes.
The final step is to invert this matrix, which I did using my mat_invert node. I then used mat_rowSum to determine the total number of moves to get to the center starting from any point.
This demo shows just one possible use of my mat_invert node. It would be easy to modify this demo for any other maze.
Enjoy!
-
Hampton_Maze_Screenshot.png
735 KB
- hampton_court_mat_invert_demo.zip 177 KB
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac