Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create a grid graph of any dimension with the topology of a torus
ResourceFunction["TorusGraph"][{n1,n2,…,nk}] gives the k-dimensional toroidal grid graph with n1×n2×…×nk vertices. |
Make a 10×5 toroidal grid graph:
In[1]:= | ![]() |
Out[1]= | ![]() |
Create a one-dimensional toroidal grid graph:
In[2]:= | ![]() |
Out[2]= | ![]() |
Create a three-dimensional toroidal grid graph:
In[3]:= | ![]() |
Out[3]= | ![]() |
Visualize the torus graph in 3D:
In[4]:= | ![]() |
Out[4]= | ![]() |
Use directed edges:
In[5]:= | ![]() |
Out[5]= | ![]() |
In[6]:= | ![]() |
Out[6]= | ![]() |
Compare a grid graph to a toroidal grid graph:
In[7]:= | ![]() |
Out[7]= | ![]() |
In[8]:= | ![]() |
Out[8]= | ![]() |
A grid structure becomes increasingly visible for larger toroidal grid graphs:
In[9]:= | ![]() |
Out[9]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License