The algorithm labels a lattice point r by criticality p iff
.
Proof:
The correctness follows from the definitions and the fact that the algorithm labels all points in a highest value first order. Thus, the algorithm maintains the invariant that at each step, if all points q satisfyinghave been labeled, these points are precisely the set
. Since points labeled by a criticality p are in the same connected component of
as p, it follows that they are in
. The algorithm maintains the invariant that no other criticality is labeled by p. Each criticality q is thus removed from the priority queue when precisely all vertices of
have been removed from the queue and labeled. If q is adjacent to a vertex labeled by p, then at this point q is made the parent of p and the labeling of the zone of p halts. Thus for any
, q must thus be in the same component of
as p, by adjacency. Thus
and so the algorithm conforms to the definitions of the criticality graph and zones, establishing the result.
In a sense, if we wish to view the evolution of the level sets as threshold is varied, we can view the data points as they are being labeled (employing, of course, the methods of so-called volume imaging).