Maze Generation

Dear Everyone,

I would like to create a maze using the following algorithm without plugins. However, I have no clue how to continue from where I am now. Currently, I have created a grid of points (parametric).

I would like to know how I can start with my textual algorithm now.

  1. Given a current node as a parameter
  2. Mark the current node as visited
  3. While the current node has any unvisited neighbour nodes a. Choose one of the unvisited neighbours b. Select the vertex between the current node and the chosen node.
  4. If there are no unvisited bordering nodes, move back to the last node with unvisited bordering nodes.
  5. Repeat steps untill all nodes are visited.
  6. Remove all unused vertices

Thank you so much!

that looks like DFS?

the points you have created are the graph nodes, but you’ll also need some connections between points -edges- to move along

I believe is doable with GH components + Anemone (plugin, sorry) because you’ll need to loop (point 5: Repeat steps until all nodes are visited)

but you might get there much more asily with code (GH Python/C# components, you can find basic algorithms by just googling those, like: Depth First Search or DFS for a Graph - GeeksforGeeks )

1 Like

@inno

Is recursive looping possible with anemone?

yes

1 Like

Hello
I have done some tools for Maze, I really don’t think Anemone is a good way to handle this. Using Python or C# is the better way.
2nd thing is the use of a Topology, meaning you have Points, relation between points (segments), Face/or cell.
Mesh is a good way to have this kind of topology but not the only one.

The beginning !

2 Likes

Thanks all,
Good to know. I have never tried grasshopper before so maybe this is a bit too far. I’ll try and see what I can make! Thanks for all the help!

I do have another question, although it is maybe not the right place.

Why can I not union these two crosses to create one cross?