Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute toppling trajectories of Abelian sandpiles on undirected finite multigraphs
ResourceFunction["SandpileTopple"][g] returns the sandpile g after toppling every unstable vertex once. | |
ResourceFunction["SandpileTopple"][g,n] returns the sandpile g after iteratively toppling g n times. | |
ResourceFunction["SandpileTopple"][g,n,"AllSteps"] returns a list of the results of toppling g 0 through n times. | |
ResourceFunction["SandpileTopple"][g,"Stabilize"] iteratively topple g until g not longer changes. | |
ResourceFunction["SandpileTopple"][g,"Stabilize","AllSteps"] returns a list of the results of toppling g until g longer changes. | |
ResourceFunction["SandpileTopple"][g,{"Stabilize",n}] iteratively topple g until g not longer changes, in up to n steps. | |
ResourceFunction["SandpileTopple"][g,{"Stabilize",n},"AllSteps"] returns a list of the results of toppling g until the result no longer changes, in at most n steps. |
Topple a sandpile once:
In[1]:= |
Out[1]= |
Topple a sandpile thrice:
In[2]:= |
Out[2]= |
Topple a sandpile four times and return the complete list of toppling steps:
In[3]:= |
Out[3]= |
Topple a sandpile until results no longer change:
In[4]:= |
Out[4]= |
Topple a sandpile until results no longer change, and return the complete list of toppling steps:
In[5]:= |
Out[5]= |
Find the fixed point of a sandpile toppling trajectory in at most n=5 toppling steps:
In[6]:= |
Out[6]= |
Compute the fixed point of the toppling trajectory of an Abelian sandpile on a rectangular grid:
In[7]:= |
Out[7]= |
Compute the fixed point of the toppling trajectory on a triangular grid:
In[8]:= |
Out[8]= |
Compute the fixed point of the toppling trajectory on a hexagonal grid:
In[9]:= |
Out[9]= |
Compute the fixed point of the toppling trajectory of an Abelian sandpile on a Sierpiński gasket graph:
In[10]:= |
Out[10]= |
Compute the fixed point of the toppling trajectory of an Abelian sandpile on a Sierpiński Carpet:
In[11]:= |
Out[11]= |
Compute steps of a toppling trajectory on a 3-ary tree:
In[12]:= |
Out[12]= |
Define a function to configure a graph sandpile's boundary conditions by connecting boundary vertices to a sink vertex.
The function below takes the following three arguments: g, the graph to be configured, a list sinkConnections of vertex→number rules specifying the number of connections to the sink for each sink-connected vertex, and sink, which specifies the sink vertex, and defaults to 0:
In[13]:= |
Configure a valid sandpile by adding and connecting a sink vertex to a graph:
In[14]:= |
Out[14]= |
Use an existing vertex as the sink:
In[15]:= |
Out[15]= |
When "StyleSandpile" is set to True, set the vertex color scheme using the ColorFunction option:
In[16]:= |
Out[16]= |
To delete the sink vertex from computed toppled sandpiles, set the "DeleteSink" option to True:
In[17]:= |
Out[17]= |
By default, SandpileTopple will style toppled sandpiles so that the vertices are colored by their weights. To disable this behavior and preserve the styling of the initial sandpile, set the "StyleSandpile" option to False:
In[18]:= |
Out[18]= |
The behaviour of the VertexShape option is modified so as to preserve vertex colors when the shape is specified as a single Graphics object:
In[19]:= |
Out[19]= |
SandpileTopple may not terminate if the sink vertex of the provided sandpile is not connected to at least one non-sink vertex:
In[21]:= |
Out[21]= |
Animate a toppling trajectory on a fully unstable scale-free graph sandpile:
In[22]:= |
Out[22]= |
Topple arbitrary mesh graphs such as this grounded triceratops:
In[23]:= |
Out[24]= |
In[25]:= |
Out[25]= |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License