Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

NewMazePaclet

Guides

  • NewMazePaclet

Tech Notes

  • NewMazePaclet

Symbols

  • EquilateralTriangleGraph
  • HexagonalGridGraph
  • MakeMaze
  • PositiveIntegerQ
  • ReduceGraph
  • SolveMaze
  • TriangularGridGraph
  • VertexCoordinateList
NewMazePaclet
Create a grid graph.
In[28]:=
gridGraph=GridGraph[{8,8}]
Out[28]=
Create a triangular grid graph.
In[29]:=
triangularGridGraph=TriangularGridGraph[{8,8}]
Out[29]=
Create a hexagonal graph.
In[30]:=
hexagonalGridGraph=HexagonalGridGraph[{8,8}]
Out[30]=
Make a maze for each type of grid.
square grid:
In[31]:=
gridMaze=MakeMaze[gridGraph]
Out[31]=
Triangular grid:
In[32]:=
triangularMaze=MakeMaze[triangularGridGraph]
Out[32]=
Hexagonal grid:
In[33]:=
hexagonalMaze=MakeMaze[hexagonalGridGraph]
Out[33]=
The main function of the paclet is SolveMaze. Solve the mazes.
Square maze solution:
In[34]:=
squareMazeSolution=SolveMaze[gridMaze]
Out[34]=
Triangular maze solution:
In[35]:=
triangularMazeSolution=SolveMaze[triangularMaze]
Out[35]=
Hexagonal maze solution:
In[36]:=
hexagonalMazeSolution=SolveMaze[hexagonalMaze]
There's also a function that will generate an equilateral triangle.
Make a maze:
Solve the maze:
The problem with this function is it doesn't regularly tile the plane. You can't specify a different width and height, which you can do with TriangularGridGraph.
You can only generate a 12 equilateral triangle or a 24 equilateral triangle.
You can represent a maze with a tree:
You can contract the edges of the tree of the graph.
A maze is an acyclic tree. Reduce the graph.

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com