Introduction

Suppose that we have nn sandpiles denoted as a set VV. Each sandpile xVx\in V has a toppling threshold θ ⁣(x)R>0\fc\tht x\in\bR_{>0}, and each ordered pair of sandpiles x,xVx,x'\in V has a toppling transfer amount α ⁣(x,x)R0\fc\alp{x,x'}\in\bR_{\ge0}. The tuple (V,θ,α)\p{V,\tht,\alp} is called an abelian sandpile model.

A configuration η:xR\eta:x\to\bR is to assign an amount of sand η ⁣(x)\fc\eta x to each sandpile xVx\in V, and it is legal if η ⁣(x)0\fc\eta x\ge0 for all xVx\in V (or conveniently denoted as η0\eta\ge0). For any configuration η\eta, any yVy\in V can topple, which is a transition to a new configuration η\eta' defined as η ⁣(x)η ⁣(x)θ ⁣(y)δxy+α ⁣(y,x).\fc{\eta'}x\ceq\fc\eta x-\fc\tht y\dlt_{xy}+\fc\alp{y,x}. The toppling is legal if η ⁣(y)θ ⁣(y)\fc\eta y\ge\fc\tht y, in which case we call yy an unstable site of the configuration η\eta. Notice that a legal configuration undergoing a legal toppling must become a legal configuration. A sequence of topplings where each toppling uses the resultant configuration of the previous toppling as the initial configuration is called a toppling procedure.

In its historically original form (Dhar, 1990), VV is the lattice sites on a 2D rectangular grid, and θ ⁣(x)=4\fc\tht x=4 for all xVx\in V, and α ⁣(x,x)\fc\alp{x,x'} is 11 if xx and xx' are nearest neighbors or 00 otherwise. It is then generalized to an arbitrary directed multigraph (Holroyd et al., 2008), where VV is its vertices, and θ ⁣(x)\fc\tht x is the out-degree of vertex xx, and α ⁣(x,x)\fc\alp{x,x'} is the number of edges from xx to xx'.

A configuration where none of the sandpiles can legally topple is called a stable configuration. In other words, configuration η\eta is stable if η ⁣(x)<θ ⁣(x)\fc\eta x<\fc\tht x for all xVx\in V, or denoted as η<θ\eta<\tht in abbreviation. A toppling procedure that makes a configuration stable is called a stabilizing toppling procedure that stabilizes the configuration. A legal configuration is stabilizable if it has a finite legal stabilizing toppling procedure. Otherwise, the configuration is exploding. A natural question to ask then is how to determine whether a configuration is stabilizable or exploding.

Abelian property

One important fact to notice is that the abelian sandpile model has the so-called abelian property: if a configuration is stabilizable, then every legal toppling procedure of it is finite, and the stabilizing legal toppling procedure is unique up to the order of topplings. In other words, if we define the toppling counting function u:VNu:V\to\bN such that u ⁣(x)\fc ux is the number of times that xVx\in V topples throughout the toppling procedure, then every legal stabilizing toppling procedure of a stabilizable configuration has the same toppling counting function, which is called the odometer of the configuration. We will leave the proof of the abelian property to a later part in this section.

In order to better describe the model, we can define a function Δ:V×VR\Dlt:V\times V\to\bR (the notation comes from the notation of the Laplacian operator in vector analysis due to its direct analogy in the case of the abelian sandpile model on a grid, in which case it is called a Laplacian matrix in the language of graph theory) as follows: Δ ⁣(x,y)=θ ⁣(x)δxyα ⁣(x,y).\fc\Dlt{x,y}=\fc\tht x\dlt_{xy}-\fc\alp{x,y}. It encodes information from both θ\tht and α\alp and provides everything we need to know to find the resultant configuration given any initial configuration and the toppling counting function. Explicitly, configuration η\eta undergoing a toppling procedure with the toppling counting function uu becomes η ⁣(x)=η ⁣(x)yΔ ⁣(x,y)u ⁣(y).\fc{\eta'}x=\fc\eta x-\sum_y\fc\Dlt{x,y}\fc uy. For abbreviation, we denote xyΔ ⁣(x,y)u ⁣(y)x\mapsto\sum_y\fc\Dlt{x,y}\fc uy as Δu\Dlt u so that Δu ⁣(x)=yΔ ⁣(x,y)u ⁣(y)\fc{\Dlt u}x=\sum_y\fc\Dlt{x,y}\fc uy. Therefore, the resultant configuration of a toppling procedure can be denoted as η=ηΔu\eta'=\eta-\Dlt u. This notation is natural if we think of Δ\Dlt as an nn-dimensional matrix and think of η\eta and uu as nn-dimensional column vectors. This equation tells us that the resultant configuration of two toppling procedures is the same as long as they have the same toppling counting function.

A toppling procedure can then be expressed as a sequence of toppling counting functions where the ttth toppling counting function utu_t is that of the toppling procedure derived by truncating the full toppling procedure up to the first tt topplings. If the ttth toppling happens at site yy, then ut ⁣(x)ut1 ⁣(x)=δxy.\fc{u_t}x-\fc{u_{t-1}}x=\dlt_{xy}. We stipulate that u0u_0 is the zero function. From now on, we call a sequence {ut}t=0T\B{u_t}_{t=0}^T (where TT is either a natural number or infinity) as a toppling procedure as long as the following conditions are satisfied: u0=0u_0=0, and for all 0t<T0\le t<T, there exists yVy\in V such that ut+1 ⁣(x)=ut ⁣(x)+δxy\fc{u_{t+1}}x=\fc{u_t}x+\dlt_{xy}. It is obvious to see that xut ⁣(x)=t\sum_x\fc{u_t}x=t for all tt. Therefore, the length TT of a toppling procedure is the same as the sum xu ⁣(x)\sum_x\fc ux, where uuTu\ceq u_T is the final toppling counting function of the toppling procedure. The definition of the legality of a toppling procedure is also naturally extended to this formulation.

Because the resultant configuration of a toppling procedure is independent of the order of the topplings, for two different sites yy and yy', toppling yy and then yy' is equivalent to toppling yy' and then yy. Both toppling procedures have the same toppling counting function δxy+δxy\dlt_{xy}+\dlt_{xy'}. If both sites are unstable sites of the initial configuration, then both toppling procedures are legal. To see this, suppose that yy and yy' are two different unstable sites of the configuration η\eta. Then, the configuration η\eta' after yy topples is given by η ⁣(x)=η ⁣(x)θ ⁣(y)δxy+α ⁣(y,x)\fc{\eta'}x=\fc\eta x-\fc\tht y\dlt_{xy}+\fc\alp{y,x}. Its value at yy' is η ⁣(y)=η ⁣(y)+α ⁣(y,y)\fc{\eta'}{y'}=\fc\eta{y'}+\fc\alp{y,y'} (notice that δyy=0\dlt_{yy'}=0 because yyy\ne y'). The first term is at least θ ⁣(y)\fc\tht{y'} because yy' is an unstable site of η\eta. The second term is nonnegative by definition. We then have η ⁣(y)θ ⁣(y)\fc{\eta'}{y'}\ge\fc\tht{y'}, which means that yy' is also an unstable site of η\eta', so toppling yy and then yy' is legal. By the same logic, toppling yy' and then yy is legal.

Now, we proceed to prove the abelian property: a stabilizable configuration has a unique odometer. To prove this, it is sufficient to prove that, if a configuration is stabilizable, then you can always construct a legal stabilizing toppling procedure by choosing an arbitrary unstable site to topple at each step until the configuration becomes stable, which is guaranteed to happen in finite steps, and the resultant toppling counting function is independent of the choices of unstable sites to topple at each step.

We prove this by induction on the length of an arbitrary legal stabilizing toppling procedure. We will prove case by case for length being 00 and 11 as base cases, and then prove the inductive step for length being T+1T+1 assuming the case for length being T1T\ge1.

The base case with zero length is trivial. For the base case with length 11, suppose that the configuration η\eta has a legal stabilizing toppling procedure of length 11. We need to prove that any choice of unstable site to topple leads to a stable configuration, and the odometer is uniquely determined. Becasue the constraint on the length of the toppling procedure, we need to prove that the unstable site yy in the initial configuration that topples in the legal stabilizing toppling procedure is the only unstable site in the initial configuration (so that the odometer can only be u ⁣(x)=δxy\fc ux=\dlt_{xy}). This is obvious because we have already proven that, if there is another unstable site yy', then yy' is also an unstable site of the configuration after yy topples, which contradicts the assumption that toppling yy is stabilizing.

Then proceed with the inductive part of the proof. Suppose that, for any configuration with a legal stabilizing toppling procedure of length T1T\ge1, arbitrarily choosing an unstable site to topple at each step will always stabilize after exactly TT steps, and the toppling counting function of the resultant toppling procedure is unique. Then, we need to prove the same thing for length T+1T+1. Suppose that configuration η\eta has a legal stabilizing toppling procedure of length T+1T+1 and that its toppling counting function is uu. Denote yy as the first toppling site in this toppling procedure. Then, the configuration η\eta' after the first toppling is given by η ⁣(x)=η ⁣(x)θ ⁣(y)δxy+α ⁣(y,x)\fc{\eta'}x=\fc\eta x-\fc\tht y\dlt_{xy}+\fc\alp{y,x}, and it has a legal stabilizing toppling procedure of length TT whose toppling counting function is u ⁣(x)=u ⁣(x)δxy\fc{u'}x=\fc ux-\dlt_{xy}. By the induction assumption, η\eta' stabilizes after TT arbitrary legal topplings, and the toppling counting function must be uu'. Now, arbitrarily choose an unstable site yy' of η\eta. If y=yy'=y, then toppling yy' gives η\eta', which stabilizes after TT arbitrary legal topplings. If yyy'\ne y, then the fact that yy' is an unstable site of η\eta implies that yy' is an unstable site of η\eta', so we can construct a legal stabilizing toppling procedure of η\eta' such that the first toppling site is yy'. We then get a legal stabilizing toppling procedure of η\eta whose toppling counting function is uu such that the first two toppling sites are yy and yy'. Because both yy and yy' are unstable sites of η\eta, we can simply swap the first two toppling sites to get a toppling procedure of η\eta such that the first two toppling sites are yy' and yy. This means that toppling yy' makes η\eta become a configuration with a legal stabilizing toppling procedure of length TT with toppling counting function u ⁣(x)δxy\fc ux-\dlt_{xy'}. By the induction assumption, η\eta stabilizes after yy' topples followed by another TT arbitrary topplings. Because yy' itself is an arbitrary choice of an unstable site, η\eta stabilizes after T+1T+1 arbitrary topplings, and the toppling counting function is uu. This finishes the induction step of the proof.

Least action principle

Another property of the abelian sandpile model is the least action principle 1: assuming that uu is the odometer of a stabilizable configuration η\eta, then for any u:VNu':V\to\bN such that ηΔu<θ\eta-\Dlt u'<\tht, we have uuu'\ge u.

Here I present a proof inspired by Fey et al. (2009). Construct a legal toppling procedure starting from the configuration η\eta as follows. At each step where ut+1 ⁣(x)=ut ⁣(x)+δxy\fc{u_{t+1}}x=\fc{u_t}x+\dlt_{xy}, the toppling site yy satisfies η ⁣(y)Δut ⁣(y)θ ⁣(y)\fc\eta y-\fc{\Dlt u_t}y\ge\fc\tht y and ut ⁣(y)<u ⁣(y)\fc{u_t}y<\fc{u'}y. When there are multiple sites satisfying the conditions, arbitrarily choose one. Continue until none of the sites satisfy the conditions, which always happen after finite steps because any toppling procedure of a stabilizable configuration is finite. This is a legal toppling procedure whose toppling counting function never exceeds uu'. Suppose that the length of the toppling procedure is TT. We then prove by contradiction that this toppling procedure is stabilizing. Suppose that the final configuration η=ηΔuT\eta'=\eta-\Dlt u_T of this toppling procedure has an unstable site yy. Because the final configuration is unstable, the only reason that the toppling procedure stops is that uT ⁣(y)=u ⁣(y)\fc{u_T}y=\fc{u'}y. Define uuuTu''\ceq u'-u_T, so u ⁣(y)=0\fc{u''}y=0 and u0u''\ge0. We have η ⁣(y)Δu ⁣(y)=η ⁣(y)Δu ⁣(y)=η ⁣(y)θ ⁣(y)u ⁣(y)+xα ⁣(y,x)u ⁣(x)η ⁣(y)θ ⁣(y),\begin{align*} \fc\eta y-\fc{\Dlt u'}y &=\fc{\eta'}y-\fc{\Dlt u''}y\\ &=\fc{\eta'}y-\fc\tht y\fc{u''}y+\sum_x\fc\alp{y,x}\fc{u''}x\\ &\ge\fc{\eta'}y\ge\fc\tht y, \end{align*} which contradicts the assumption that yy is an unstable site of η\eta'.

What the least action principle tells us is that, the odemeter uu of a stabilizable configuration η\eta is the unique minimum natural number solution to the system of linear inequalities ηΔu<θ\eta-\Dlt u<\tht. The toppling procedure defined above also provides a constructive way to find the odometer once we have any natural number solution to the system of linear inequalities.

Notice that we cannot relax uu' to be a more general real-valued function. If so, in the proof above, the condition u ⁣(y)=0\fc{u''}y=0 becomes u ⁣(y)<1\fc{u''}y<1. In fact, we can easily find counterexamples where, there exists a real-valued solution uu' to the system of linear inequalities, but the configuration is exploding. This is sad news because it means that determining the stabilizability of a configuration cannot be done by linear programming.

A corollary of the least action principle is that, if ηΔu<θ\eta-\Dlt u<\tht has a natural number solution, then there exists a unique minimum solution, whose value at each site is the minimum among all natural number solutions at that site.

A related property is that, if u=u1u=u_1 and u=u2u=u_2 both satisfies ηΔu<θ\eta-\Dlt u<\tht, then u=min ⁣(u1,u2)u=\opc{min}{u_1,u_2} also satisfies ηΔu<θ\eta-\Dlt u<\tht, where min ⁣(u1,u2) ⁣(x)min ⁣(u1 ⁣(x),u2 ⁣(x))\fc{\opc{min}{u_1,u_2}}x\ceq\opc{min}{\fc{u_1}x,\fc{u_2}x} denotes the pointwise minimum. This property also applies to general real-valued solutions instead of just natural number solutions. To prove this, assuming u1 ⁣(x)u2 ⁣(x)\fc{u_1}x\le\fc{u_2}x without loss of generality, notice that Δmin ⁣(u1,u2) ⁣(x)=θ ⁣(x)u1 ⁣(x)yα ⁣(x,y)min ⁣(u1 ⁣(y),u2 ⁣(y))θ ⁣(x)u1 ⁣(x)yα ⁣(x,y)u1 ⁣(y)=Δu1 ⁣(x).\begin{align*} \fc{\Dlt\opc{min}{u_1,u_2}}x &=\fc\tht x\fc{u_1}x-\sum_y\fc\alp{x,y}\opc{min}{\fc{u_1}y,\fc{u_2}y}\\ &\ge\fc\tht x\fc{u_1}x-\sum_y\fc\alp{x,y}\fc{u_1}y\\ &=\fc{\Dlt u_1}x. \end{align*} By this property, under the binary operator min ⁣(,)\opc{min}{\cdot,\cdot}, the set P{u:VR  |  ηΔu<θ,u0}P\ceq\set{u:V\to\bR}{\eta-\Dlt u<\tht,u\ge0} forms an idempotent commutative semigroup if not empty. Its closure P{u:VR  |  ηΔuθ,u0}\overline P\ceq\set{u:V\to\bR}{\eta-\Dlt u\le\tht,u\ge0} is an idempotent commutative monoid if not empty, whose identity element is the unique minimum element of P\overline P, which obviously exists. The set PN{u:VN  |  ηΔu<θ}P_\bN\ceq\set{u:V\to\bN}{\eta-\Dlt u<\tht} is a subsemigroup of PP and also a monoid if not empty. However, notice that the identity element of PNP_\bN is always different from that of P\overline P.

Integer linear programming

As we have seen, determining the stabilizability of a configuration η\eta is equivalent to determining whether there exists a natural number solution to the system of linear inequalities ηΔu<θ\eta-\Dlt u<\tht. Such problems are called integer linear programming (ILP) problems.

The most general form of an ILP problem is, given a matrix AA and vectors bb and cc, to find natural number vector xx that minimizes cTxc^\mrm Tx subject to the constraint AxbAx\le b. There is also the feasibility version of ILP problems, which only asks whether there exists a natural number vector xx satisfying the constraint AxbAx\le b without the objective of optimizing some objective.

Now come back to the problem of determining the stabilizability of a configuration η\eta. From a computational point of view, because we cannot really store arbitrary real numbers in a computer, we are only going to consider the case where η\eta and Δ\Dlt are both rational-valued functions. Then, without loss of generality, when VV is finite, we can multiply both functions by a common multiple of denominators to make them both integer-valued functions 2. The problem of determining the stabilizability of a configuration then becomes a special case of the feasibility version of ILP problems, which is to determine whether there exists a natural number solution to Δuψ\Dlt u\ge\psi, where ψηθ+1\psi\ceq\eta-\tht+1. It is only a special case because Δ\Dlt by the definition of the abelian sandpile model can only be a Z-matrix, which is defined as a square matrix whose off-diagonal entries are all nonpositive. Because of this restriction, it may not be as hard as the general ILP problems, which are known to be NP-complete. However, because I neither have found any reference discussing the complexity of Z-matrix ILP problems nor have devised any polynomial-time algorithm to solve them or reduced any known NP-complete problems to them 3, I do not know whether the Z-matrix ILP problems are NP-complete or not.

We can design this algorithm inspired by Hochbaum et al. (1994) to solve the Z-matrix ILP problem. To find a natural number solution to Δuψ\Dlt u\ge\psi for some given Z-matrix Δ\Dlt and vector ψ\psi, first solve the linear programming relaxation of the problem to find a real-valued minimum solution uu^* or exit and report nonexistence of solutions if uu^* does not exist, and then iteratively calculate a sequence {u(k)}\B{u^{\p k}} starting from u(0)uu^{\p0}\ceq\ceil{u^*} (where \ceil{\cdot} is the componentwise ceiling function) by this procedure: for each row xx of Δ\Dlt, if the inequality yΔ ⁣(x,y)u(k) ⁣(y)ψ ⁣(x)\sum_y\fc\Dlt{x,y}\fc{u^{\p k}}y\ge\fc\psi x is violated, then exit and report nonexistence of solutions if Δ ⁣(x,x)0\fc\Dlt{x,x}\le0, or update u(k+1) ⁣(x)1Δ ⁣(x,x)(ψ ⁣(x)yxΔ ⁣(x,y)u(k) ⁣(y)),u(k+1) ⁣(yx)u(k) ⁣(y)\begin{align*} \fc{u^{\p{k+1}}}x&\ceq\ceil{\fr1{\fc\Dlt{x,x}}\p{\fc\psi x-\sum_{y\ne x}\fc\Dlt{x,y}\fc{u^{\p k}}y}},\\ \fc{u^{\p{k+1}}}{y\ne x}&\ceq\fc{u^{\p k}}y \end{align*} and start the next iteration; repeat the iteration until either all inequalities are satisfied (solution found) or any component of u(k)u^{\p k} exceed a predetermined upper bound BB.

Before we address this dubious upper bound BB, let us first prove that this algorithm finds the minimum solution if a solution exists and is within the bound BB. There are three ways in which the program ends: exceeding the bound, satisfying all inequalities, or having Δ ⁣(x,x)0\fc\Dlt{x,x}\le0 for an unsatisfied inequality.

For the case when the program ends due to exceeding the bound, we need to prove that no solution exists within the bound. It is equivalent to proving that, if a solution uTBu_T\le B exists within the bound, then u(k)u^{\p k} can never exceed the bound. Sufficiently, I will prove by induction that u(k)uTu^{\p k}\le u_T for all kk. The base case k=0k=0 is obvious because uu^* as the minimum real solution must satisfy uuTu^*\le u_T. For the inductive step, suppose that u(k)uTu^{\p k}\le u_T for some k0k\ge0. Then, if row xx of the inequalities is violated (in other words, yΔ ⁣(x,y)u(k) ⁣(y)ψ ⁣(x)\sum_y\fc\Dlt{x,y}\fc{u^{\p k}}y\le\fc\psi x), we have u(k+1) ⁣(x)=1Δ ⁣(x,x)(ψ ⁣(x)yxΔ ⁣(x,y)u(k) ⁣(y))1Δ ⁣(x,x)(ψ ⁣(x)yxΔ ⁣(x,y)uT ⁣(y))uT ⁣(x)=uT ⁣(x),\begin{align*} \fc{u^{\p{k+1}}}x&=\ceil{\fr1{\fc\Dlt{x,x}}\p{\fc\psi x-\sum_{y\ne x}\fc\Dlt{x,y}\fc{u^{\p k}}y}}\\ &\le\ceil{\fr1{\fc\Dlt{x,x}}\p{\fc\psi x-\sum_{y\ne x}\fc\Dlt{x,y}\fc{u_T}y}}\\ &\le\ceil{\fc{u_T}x}=\fc{u_T}x, \end{align*} where the first inequality is due to the induction assumption and the Z-matrix property and the second inequality is due to the assumption that uTu_T is a solution of Δuψ\Dlt u\ge\psi.

For the case when the program ends due to satisfying all inequalities, we have found a solution.

For the case when the program ends due to having Δ ⁣(x,x)0\fc\Dlt{x,x}\le0 for an unsatisfied inequality, I will prove by contradiction that no solution exists in this case. Suppose that there exists a solution uTu_T, then we have u(k)uTu^{\p k}\le u_T. We then have ψ ⁣(x)>yΔ ⁣(x,y)u(k) ⁣(y)yΔ ⁣(x,y)uT ⁣(y)ψ ⁣(x),\fc\psi x>\sum_y\fc\Dlt{x,y}\fc{u^{\p k}}y \ge\sum_y\fc\Dlt{x,y}\fc{u_T}y \ge\fc\psi x, where the first inequality is because of the violated inequality, and the second inequality is because Δ ⁣(x,x)0\fc\Dlt{x,x}\le0 and the Z-matrix property, and the third inequality is because uTu_T is a solution of Δuψ\Dlt u\ge\psi. This is a contradiction.

Finally, we address the dubious upper bound BB. In order for the algorithm to work, we need to determine a finite upper bound BB under which a solution is guaranteed to exist if any solution exists. A safe choice is B=u+nDB=u^*+nD, where DD is maximum of the absolute values of subdeterminants 4 of the matrix Δ\Dlt. I follow Cook et al. (1986) to give a proof.

Suppose that there exists a natural number solution uTu_T'. Partition elements in VV into two disjoint subsets V>V_> and V<V_< defined as V>{xV  |  ΔuT ⁣(x)Δu ⁣(x)},V<{xV  |  ΔuT ⁣(x)<Δu ⁣(x)}.\begin{align*} V_>&\ceq\set{x\in V}{\fc{\Dlt u_T'}x\ge\fc{\Dlt u^*}x},\\ V_<&\ceq\set{x\in V}{\fc{\Dlt u_T'}x<\fc{\Dlt u^*}x}. \end{align*} The set V<V_< corresponds to the rows of inequalities that are slack. To see this, notice that for xV<x\in V_<, we have Δu ⁣(x)>ΔuT ⁣(x)ψ ⁣(x)\fc{\Dlt u^*}x>\fc{\Dlt u_T'}x\ge\fc\psi x. This motivates us to use complementary slackness to get more information about Δ\Dlt. Notice that, for any zVz\in V, uu^* is an optimal solution to the linear program of minimizing u ⁣(z)\fc uz subject to Δuψ\Dlt u\ge\psi. Its dual linear program is to maximize xψ ⁣(x)v ⁣(x)\sum_x\fc\psi x\fc vx subject to the constraint xΔ ⁣(x,y)v ⁣(x)δyz\sum_x\fc\Dlt{x,y}\fc vx\le\dlt_{yz} for all yVy\in V. By complementary slackness, the optimal solution vv^* exists and satisfies v ⁣(y)=0\fc{v^*}y=0 for all yV<y\in V_<. Therefore, for any uu such that Δu ⁣(x)0\fc{\Dlt u}x\ge0 for all xV>x\in V_>, we have u ⁣(z)=yu ⁣(y)δyzyu ⁣(y)xV>Δ ⁣(x,y)v ⁣(x)=xV>v ⁣(x)Δu ⁣(x)0.\begin{align*} \fc uz=\sum_y\fc uy\dlt_{yz} &\ge\sum_y\fc uy\sum_{x\in V_>}\fc\Dlt{x,y}\fc{v^*}x\\ &=\sum_{x\in V_>}\fc{v^*}x\fc{\Dlt u}x\ge0. \end{align*} Because zz is arbitrary, this means that Δu ⁣(x)0\fc{\Dlt u}x\ge0 for all xV>x\in V_> implies u0u\ge0.

We can define a polyhedral cone C{u:VR  |  Δu0}C\ceq\set{u:V\to\bR}{\Dlt'u\ge0}, where Δ ⁣(x,y){Δ ⁣(x,y),xV>,Δ ⁣(x,y),xV<.\fc{\Dlt'}{x,y}\ceq\begin{cases} \fc\Dlt{x,y},&x\in V_>,\\ -\fc\Dlt{x,y},&x\in V_<. \end{cases} We then have that uCu\in C implies u0u\ge0. We can choose a finite set GCG\subseteq C that generates CC (in other words, CC is the nonnegative linear combination of GG) such that, for all gGg\in G, gg is integral and 0gD0\le g\le D. To see that gDg\le D is always possible, notice that gg is in the null space of some submatrix of Δ\Dlt', which is spanned by vectors whose components are subdeterminants of Δ\Dlt', which are all bounded by DD in absolute value by definition. By definition of V>V_> and V<V_<, we obviously have uTuCu_T'-u^*\in C. Therefore, by Carathéodory’s theorem, there exists dd (the dimension of CC) vectors {gi}\B{g_i} in GG and dd nonnegative real numbers {λi}\B{\lmd_i} such that uTu=iλigiu_T'-u^*=\sum_i\lmd_ig_i. Construct uTuTiλigi=u+i(λiλi)gi.u_T\ceq u_T'-\sum_i\floor{\lmd_i}g_i =u^*+\sum_i\p{\lmd_i-\floor{\lmd_i}}g_i. It is obviously integral and satisfies uTBu_T\le B. We can verify that it is a solution of Δuψ\Dlt u\ge\psi. For xV<x\in V_<, we have ΔuT ⁣(x)=ΔuT ⁣(x)iλiΔgi ⁣(x)=ΔuT ⁣(x)+iλiΔgi ⁣(x)ΔuT ⁣(x)ψ ⁣(x).\begin{align*} \fc{\Dlt u_T}x &=\fc{\Dlt u_T'}x-\sum_i\floor{\lmd_i}\fc{\Dlt g_i}x\\ &=\fc{\Dlt u_T'}x+\sum_i\floor{\lmd_i}\fc{\Dlt'g_i}x\\ &\ge\fc{\Dlt u_T'}x\ge\fc\psi x. \end{align*} For xV>x\in V_>, we have ΔuT ⁣(x)=Δu ⁣(x)+i(λiλi)Δgi ⁣(x)=Δu ⁣(x)+i(λiλi)Δgi ⁣(x)Δu ⁣(x)ψ ⁣(x).\begin{align*} \fc{\Dlt u_T}x &=\fc{\Dlt u^*}x+\sum_i\p{\lmd_i-\floor{\lmd_i}}\fc{\Dlt g_i}x\\ &=\fc{\Dlt u^*}x+\sum_i\p{\lmd_i-\floor{\lmd_i}}\fc{\Dlt'g_i}x\\ &\ge\fc{\Dlt u^*}x\ge\fc\psi x. \end{align*} We thus have found a solution uTBu_T\le B.

Therefore, B=u+nDB=u^*+nD is a valid upper bound. However, it is often hard to compute DD in practice, so we may use B=u+nDB=u^*+nD' for some DDD'\ge D that is easier to compute. Obviously a choice is D=n!ΔnD'=n!\V{\Dlt}_\infty^n, where Δmaxx,yΔ ⁣(x,y)\V{\Dlt}_\infty\ceq\max_{x,y}\v{\fc\Dlt{x,y}}.

Now that we have proven the correctness of the algorithm, we can analyze its time complexity. Because every iteration increases at least one component of u(k)u^{\p k} by at least 11, the total number of iterations is at most Bu1=n2n!Δn\V{B-u^*}_1=n^2n!\V{\Dlt}_\infty^n, where 1\V{\cdot}_1 is the sum of absolute values of components. Each iteration takes O ⁣(n2)\order{n^2} time to check all inequalities. Therefore, the total time complexity is O ⁣(n4n!Δn)\order{n^4n!\V{\Dlt}_\infty^n}. It is a pseudopolynomial time algorithm for fixed nn, but grows superexponentially by nn for fixed Δ\V{\Dlt}_\infty.

Also, notice that, in each iteration, we can update any components of u(k)u^{\p k} whose corresponding inequalities are violated in parallel instead of only updating one component at each iteration. The proof of correctness still holds.

Guaranteed stabilizability

One interesting question to ask is how to determine whether an abelian sandpile model guarantees the stabilizability of all legal configurations. If determining this is easier than solving ILP problems, then it is even useful for determining the stabilizability of particular configurations.

The answer to this question is that an abelian sandpile model guarantees the stabilizability of all legal configurations if and only if Δ\Dlt is a nonsingular M-matrix (an M-matrix is defined as a matrix that can be written in the form sIBsI-B, where II is the identity matrix, BB is a nonnegative matrix, and ss is at least as large as the spectral radius of BB; it is nonsingular when ss is strictly larger than the spectral radius of BB), which is also equivalent to saying that there exists u0u\ge0 such that Δu>0\Dlt u>0 (Plemmons, 1977). The necessity of this condition is easy to see because it is implied by the stabilizibility of any configuration η\eta such that ηθ\eta\ge\tht. To see the sufficiency, suppose that there exists u0u\ge0 such that Δu>0\Dlt u>0. Without loss of generality, we can assume that uu is rational-valued because Δ\Dlt as a linear transformation on a finite-dimensional vector space must be continuous. We can then further assume that uu is integer-valued by multiplying it by a common multiple of denominators. Now, for any configuration η\eta, we can always choose a sufficiently large constant cc such that Δ(cu)>ηθ\Dlt\p{cu}>\eta-\tht. By the least action principle, η\eta is stabilizable.

In this case, we can define an abelian group called the sandpile group. The elements are equivalent classes of configurations, where two configurations η\eta and η\eta' are equivalent if there exists some u:VZu:V\to\bZ such that ηη=Δu\eta-\eta'=\Dlt u. The group operation ++ is defined such that [η]+[η]=[η+η]\b{\eta}+\b{\eta'}=\b{\eta+\eta'}, where []\b{\cdot} denotes the equivalence class represented by a configuration. Only if all configurations are stabilizable can any equivalence class be represented by a stable legal configuration. This group has many interesting properties (Holroyd et al., 2008), but they are outside of the scope of this article.

To determine whether a Z-matrix is a nonsingular M-matrix, we can perform an LU decomposition on Δ\Dlt and check whether all diagonal entries of the two triangular matrices are positive. If they are, then Δ\Dlt is a nonsingular M-matrix. For fixed Δ\V{\Dlt}_\infty, this can be done in O ⁣(n3)\order{n^3} time using Gaussian elimination.

Implementation

Ask LLM to code for you.


  1. I was puzzled by why people made the theorem have the same name as the more famous principle in the field of classical mechanics also known as Hamilton’s principle. Apparently, people who coined the name are also phycists, who must have known Hamilton’s principle, so I think there must be a relation between those two seemingly unrelated propositions, but I cannot devise such a relation.↩︎

  2. This “without loss of generality” is actually not very obvious. Mathematically speaking, we can always reduce the rational-valued case to the integer-valued case. However, computationally speaking, we need to prove that the input size of the reduced problem is bounded by a polynomial of the input size of the original problem. Fortunately, it is easy to prove for this case if the input size of a rational number p/qp/q is defined as 1+log2 ⁣(p+1)+log2 ⁣(q+1)1+\ceil{\fc{\log_2}{\v p+1}}+\ceil{\fc{\log_2}{\v q+1}}.↩︎

  3. The main difficulty in reducing other computation problems to Z-matrix ILP problems is that Z-matrix ILP problems are “monotonic” in the sense that two solutions u1u_1 and u2u_2 imply that their componentwise minimum is also a solution. If we want to encode the answer to a computation problem into a solution to a Z-matrix ILP problem, the original problem must also have this monotonicity property.↩︎

  4. I was confused by the word “subdeterminant” as I found it in the literature because I never heard of it when I learned linear algebra. I then searched it up on Wikipedia and found that it is the title of a Czech Wikipedia article whose English version is titled “minor”. I then realized that a subdeterminant just means a minor, which is the determinant of a matrix after removing some rows and/or columns. I then think the word “subdeterminant” actually makes more sense than “minor” because the latter is overused for too many concepts.↩︎