How this calculation works
Stabilize a connected graph sandpile, report its firing odometer and absorbed grains, and compute the critical group’s invariant factors from the reduced graph Laplacian.
Stable c_v<degree(v) for v≠sink; firing v sends one grain to each neighbor. Critical group=Z^(n−1)/L_reduced Z^(n−1).A worked example
For the triangle with sink0 and initial grains[0,4,0], vertex1 fires twice and vertex2 fires once. The stable state is[0,1,0], three grains reach the sink, and the reduced Laplacian[[2,−1],[−1,2]] has Smith factors1,3. The critical group has order3.
Good to know
Connected simple undirected graph2–12 vertices;one sink;0–100000 integer grains per vertex,sink entry0. Stabilization cap1000000 firings. Exact integer Smith reduction cap20000 operations and100-digit entries. Edge-closure and odometer conservation checks;no recurrent-identity configuration output.
An unstable vertex fires to every neighbor
A nonsink vertex becomes unstable when its grain count is at least its graph degree. Firing removes that many grains from the vertex and sends one grain along each incident edge. Grains arriving at the sink are absorbed.
A stable configuration has fewer grains than degree at every nonsink vertex. Connectivity to the sink matters: without a route for eventual dissipation, a finite stabilization guarantee would fail for some configurations. The calculator therefore requires a connected graph.
Compare this with the Spanning tree count calculator using a graph Laplacian. A tree count gives only the group order,not stabilization,odometers or invariant factors.
The sink occupies a declared vertex label
Enter counts for all declared vertices, including a zero at the sink’s position. The sink is not treated as an ordinary unstable vertex and never fires back into the graph. Its absorbed total is tracked separately.
The entered counts must be nonnegative integers. This is a configuration model, not a signed chip-firing divisor with possible debt. Loops, parallel edges and directed weights would change the Laplacian convention and are excluded here.
The odometer records the stabilization certificate
The odometer gives how many times each nonsink vertex fired. Applying those counts to the original configuration through the graph Laplacian reconstructs the final stable configuration, independently of the particular firing order.
The implementation batches repeated legal firings to reduce work, then checks the balance equation at every nonsink vertex. Initial grains must equal remaining grains plus absorbed grains. These checks expose a stabilization bug more clearly than comparing only the final total.
The triangle loses three grains to its sink
Begin with four grains on vertex1, whose degree is two. Two firings move two grains to the sink and two to vertex2. Vertex2 then fires once, returning one grain to1 and sending another to the sink.
The final nonsink counts are one and zero, both below degree two. Three grains were absorbed and one remains. The firing counts[0,2,1] reproduce the same result through the reduced Laplacian balance equation.
The critical group is more than its size
Deleting the sink row and column gives an invertible integer reduced Laplacian. Its cokernel is a finite abelian group, and Smith invariant factors describe that group’s cyclic decomposition, including trivial factors equal to one.
The product of the factors equals the group order, which also equals the number of spanning trees for this connected undirected graph. Merely counting trees would not determine the individual invariant factors or perform stabilization of a submitted configuration.
Integer reduction has explicit resource limits
The Smith calculation uses exact integer row and column operations with Euclidean reductions, avoiding a floating-point singular-value interpretation of integer divisibility. Divisibility between adjacent diagonal factors is checked before reporting them.
Very large grain totals can exceed the firing cap, and difficult exact reductions can exceed operation or coefficient-growth caps. Such cases produce errors rather than partially stabilized configurations or rounded group invariants labeled exact.
Do not confuse the group identity with zero grains
The all-zero stable configuration is a simple starting configuration, but the identity among recurrent stable sandpiles need not be that configuration. The abstract quotient group’s zero class and a chosen recurrent representative are different presentations.
This page returns invariant factors and stabilizes the entered nonnegative grains; it does not compute the recurrent identity configuration or classify every recurrent state. Use the output for the stated algebraic and dynamical questions without inferring those extra constructions.
A few questions, answered
Does the sink fire?
No. It absorbs arriving grains, which are counted separately.
Why is the sink’s initial count zero?
The input convention lists only active grains while retaining a placeholder at the sink label.
What is an odometer?
It lists the number of firings at each vertex during stabilization.
Is the critical-group order the tree count?
Yes for this connected undirected graph, but invariant factors carry more group information.