Alternative techniques for cluster labelling on percolation theory

We propose a new cluster labelling algorithm as a tool for computer-aided simulation in the field of percolation theory. Due to the use of recursivity, the basic labelling algorithm only needs a few lines of code, and performs at least as well as the Hoshen-Kopelman algorithm with the small lattices that can be stored in the computer memory. Additionally, it can be extended to label the clusters, compute cluster parameters and check for percolation in a single pass over the lattice. We also detail how to deal with lattice dimensions higher than two or with lattices without complete connectivity. Huge lattices, which cannot be stored as a whole in the computer's memory, require a slight modification that permits the labelling by sublattices. In this case, a cluster association technique similar to that proposed by Hoshen and Kopelman is necessary. Nevertheless, the proposed algorithm is capable of labelling lattices of virtually any size, no matter what the memory capacity of the machine, because it does not require an entire line or hyperplane of the whole lattice to be in memory. It is only limited by the storage capacity of the devices attached to the machine. If what is needed is just percolation checking, the storage requirements are very low and processing times decrease, using the `percolation finders' suggested. Listings of C programs are available in the online edition.