We present algorithms that compute the terminal configurations for sandpile instances in $O(n \log n)$ time on trees and $O(n)$ time on paths, where $n$ is the number of vertices. The Abelian Sandpile model is a well-known model used in exploring self-organized criticality. Despite a large amount of work on other aspects of sandpiles, there have been limited results in efficiently computing the terminal state, known as the sandpile prediction problem. Our algorithm improves the previous best runtime of $O(n \log^5 n)$ on trees [Ramachandran-Schild SODA '17] and $O(n \log n)$ on paths [Moore-Nilsson '99]. To do so, we move beyond the simulation of individual events by directly computing the number of firings for each vertex. The computation is accelerated using splittable binary search trees. We also generalize our algorithm to adapt at most three sink vertices, which is the first prediction algorithm faster than mere simulation on a sandpile model with sinks. We provide a general reduction that transforms the prediction problem on an arbitrary graph into problems on its subgraphs separated by any vertex set $P$. The reduction gives a time complexity of $O(\log^{|P|} n \cdot T)$ where $T$ denotes the total time for solving on each subgraph. In addition, we give algorithms in $O(n)$ time on cliques and $O(n \log^2 n)$ time on pseudotrees.
翻译:我们提出了在树结构上以 $O(n \log n)$ 时间复杂度、在路径结构上以 $O(n)$ 时间复杂度计算沙堆实例终止构型的算法,其中 $n$ 为顶点数。阿贝尔沙堆模型是探索自组织临界性的经典模型。尽管已有大量关于沙堆其他方面的工作,但在高效计算终止态(即沙堆预测问题)方面成果有限。我们的算法改进了此前树结构上 $O(n \log^5 n)$ 的最优运行时间 [Ramachandran-Schild SODA '17] 及路径结构上 $O(n \log n)$ 的运行时间 [Moore-Nilsson '99]。为实现这一目标,我们超越了对单个事件的模拟,通过直接计算每个顶点的爆发次数。该计算借助可分裂二叉搜索树得以加速。我们还将算法泛化为最多适配三个汇点,这是首个在含汇点沙堆模型上比纯模拟更快的预测算法。我们提出一种通用约简方法,将任意图上的预测问题转化为由顶点集 $P$ 分隔的子图上的问题。该约简的时间复杂度为 $O(\log^{|P|} n \cdot T)$,其中 $T$ 表示各子图求解的总时间。此外,我们给出了团上 $O(n)$ 时间复杂度及伪树上 $O(n \log^2 n)$ 时间复杂度的算法。