An extension of the Hoshen-Kopelman algorithm to an arbitrary networks of nodes.