Real Time GH Progress

Very late night (or early morning) madness here.

This is what I was referring to with offsets:
If we are talking about a maze with all the walls connected to the external perimeter, following the right/left hand rule will always lead to the exit, because somehow the 2 points (start and exit) are already “connected”.

maze2
If you make an offset of all the paths and join the regions together, we’ll get a single closed curve passing near both the 2 points.
Then we can simply shatter that curve to get the 2 full paths, being now the right and left hand rule solutions.

Even better…

By doing the offset “back” to the middle, and many, MANY “cleanings”, we can remove duplicate segments, where we are “passing 2 times on the same path”… so this means removing all the dead ends.
(this method is easy on rhino only if the maze have orthogonal, integer-long paths)
maze
maze_left-right_hand_rule.gh (56.1 KB)

This is a non-iterative, direct solution for a maze with: orthogonal and integer-long paths and with walls connected to external perimeter.

Note: An obvious thing, in a maze with some “island” wall (not connected to the perimeter), if the exit and start point are one inside and the other outside (or vice-versa) you’ll never solve the maze with right-left hand rule.

15 Likes