COMPUTER GRAPHICS AND IMAGE PROCESSING 4, 120-132 (1975)
Order Independence in Local Clustering Algorithms ' G. CORAY D@artement de Math~matiques Ecole Polytechnique Ft~d~'rale Lausanne, Switzerland
A. NOETZEL Department of Computer Science, The University of Texas tit Austin, Austin, Texas AND
S. M. SELKOW D~partement d'In.fbrmattque, Universit(' de Montr6al, MontrEal, P.Q., Canada Commttnicated by .4. Rosetfeld Received November I, 1974 Algorithms are introduced which recursively merge neighboring vertices or" a graph, conditional upon a test performed on the labels of the vertices and the arc between them. A characterization is given of the class of algorithms which produce a tmique result, independent of the order in which the graph is scanned. Examples and motivation are drawn fi'om picture processing.
1. INTRODUCTION In a typical digital picture processing algorithm, the objects or regions of interest may occupy a large number of neighboring cells. Simple efficiency considerations will usually preclude performing, for instance, template matches all around the picture, even if a small number of templates could be found to characterize the objects or regions of interest. An alternative approach consists of growing regions of more or less uniform texture and then applying special purpose semantic routines to combine the regions into identifiable composite objects. Too much merging would result in the irrevocable loss of necessary information whereas too little merging would present too much information to the semantic routines, thus making their application prohibitively expensive. We are concerned with domain-aggregation processes in which the iterative application of a local merge routine is determined by some arbitrary criterion of similarity between adjacent regions. There is a natural relation between this class of techniques and those used in cluster analysis [3,5]. We will investigate the class of picture decomposition algorithms which decide at every step whether or not to merge two neig~hboring regions of a picture solely * This work was performed at the Universit6 de Montr6al, Montreal, Canada, and was partially supported by the National Research Council of Canada. 120 Copyright© 1975by AcademicPress,Inc. All rightsof r~produetionin any formreserved.
ORDER INDEPENDENCE IN CLUSTERING
121
on the basis of current computed characteristics of these regions. We thus define local clustering algorithms (LCA). The restriction that the operators considered be local or "context-free," while assuring more efficient operations, precludes the possibility of stating "merge two regions if no other bordering regions are more mergeable." The underlying motivation for this study is the hope that efficient local operators may be found, which, although applied in any order around the picture, will give a unique response. In other words, since we often have no reason to expect certain objects to appear in a fixed region, it is desirable that a decomposition should be independent of the order in which regions are scanned. We introduce two definitions of order independence. These seemingly disparate definitions are seen to be similar with respect to the classes of LCA which satisfy them. Order independence is not a prime consideration in cluster analysis since the algorithms usually merge the two most similar clusters (a global criterion). The algorithms usually differ with respect to the definition of the similarity of newly merged clusters to all the other clusters. Our results are of interest for the case where a large number of clusters precludes testing the global property of whether two arbitrary clusters are more similar than any other two clusters. The remainder of this paper is organized as follows. Section 2 contains a definition of a graph representing digitized pictures, and the definition of a general L C A that produces new representations of the picture by a sequence of merging operations on the graph. Specific examples of the general LCA, taken from the literature, are presented. In Section 3, it is shown that a simplified picture-graph, with data on the arcs only, is equivalent to the more general representation with respect to the operations of the LCA. This section is not required for the proofs in the sequel. In Section 4, LCA's whose results are independent of the order in which the regions of the picture are selected for merging are defined, and theorems characterizing the capabilities of such LCA's are proved. In Section 5, an LCA with a simplified scanning sequence, called a one-pass LCA, is defined, and it is shown that for each order-independent LCA, a one-pass LCA that has the same result can be constructed. Section 6 contains conclusions. 2. DEFINITIONS
A digital picture may be represented as a set of disjoint regions and a set of arcs connecting adjacent regions. The regions are initially elementary cells of the picture and are grown by the merging of adjacent regions. Associated with each region is a set of attributes or descriptors, such as the average gray level of the region or possibly even the first n terms of the Fourier series expansion of the picture in the region, or the location of an arbitrary cell in the region. Likewise, associated with each arc is a set of attributes or descriptors, such as the length of the border between the regions and the number of segments of which it is composed. A graph G is a quadruple (V, A, L, a), V is a finite set of vertices (or regions), A C_ V X V is a set of nondirected arcs (or edges),
122
CORAV, NOETZEL AND SELKOW L is a set o f labels, a: V U A --~ L is a function that assigns a label to each arc and vertex of G.
Notation Vertices of a graph will be denoted b y indices, such as i, j, k, or b y indices b o u n d by the symbol U. F o r example, i U j represents the vertex formed by c o m b i n i n g vertices i and j o f another graph. T h e name j U i is the same as the n a m e i U j. A r c s of a graph will be denoted by the pair (i,j). H o w e v e r , since a graph is not directed, (i,j) is equivalent to (j,i). T h e following notational equivalence for t~ will be used. o~t = c~(i) = label of v e r t e x i,
~ = c~((i,j)) = label o f arc (i,j), tZ~u~k= a ( ( i U j , k ) ) = label of arc (i U j,k).
Definition o f the Merge Operation The MERGE a n o t h e r graph.
function constructs a new graph by merging two vertices o f
D E F I N I T I O N . M(i,j,G) is a function from all arcs o f graphs onto graphs. T h e v a l u e of M(i,j,G) is a graph having a v e r t e x i U j, and otherwise having all vert i c e s o f G e x c e p t i and j ; and in which all arcs (i,k) and (j,k) are merged into the single arc (i U j,k) and otherwisehaving all arcs of G. T h e label o f vertex i U j is c o m p u t e d f r o m labels local to i and j ; namely, O~u~=fv(a~,aj,ao). F o r any o t h e r vertex k of M(i,j,G), the label of arc (i U j,k) is c o m p u t e d from labels local to i,j and k o f G. a~u~k = f.~ ( ai,Oq,Ctk,Ot~j,ai~,otjk) . T h e function f~ has a label value if either o f its last two parameters are defined. A s i d e from these changes which are local to i a n d L M(i,j,G) will be the same g r a p h as G. T h e M E R G E operation is established more formally in the following program, w h i c h does not specify the order in which the arcs o f G are scanned (it is arbitrary).
Definition o f M(i,j,G) V: = V + {i U j } -
{i,j},
F O R A L L k ~ V, I F ((i,k) ~ A OR (l",k) U A) T H E N D O BEGIN A: = A + {(i U j , k ) } -
{(i,k),(j,k)}, aiujk: = f , j (a~,a~,ak,ao,ate,ot~k), END
ORDER INDEPENDENCE IN CLUSTERING
0
6
2
4
(1,~,2) ( 1 , ~ , 4 )
Ca)
, ~
2
123
)
( i ' ~
'4)
FIG. 1. (a) A digitalpicture, where each numbersignifiesgray level. (b) Graph G 1 extracted from the picture. (c) Graph G2 = MERGE (a,c,G1). (d) Graph G3 = MERGE (b,d,G2). Example of the Merge Operation Consider the graph G1 of Fig. lb, extracted from the picture of Fig. la. We may interpret the arc labels, a~ = (nn,au) by letting no signify the number of points on the border between i and j, and a~ signify the average absolute difference in gray level of the pairs o f neighboring points which constitute the border between i and j. There are no vertex labels. The definition of the M E R G E operation is completed by specifying [ (n~k,atk)
=
(nj~,ajk)
if ajk not defined, if aik not defined,
(nix + n~k, aiknik + a~l~njk.~ n~k + n~k /
otherwise.
Figures lc and ld indicate the result of two calls upon M E R G E .
Definition of the Decision Function A decision function determines whether two regions should be merged. The decision is based on data local to the two regions under consideration. DEFINITION. Let U be the universe of vertices, and H the set of all graphs. The decision function D(i,j,G) is a function from U × U × H into {T,F}, which has value F if (i,j) f~ A, and otherwise computes T or F referencing only the labels of G local to (i,j), that is, ~t,o~j, and a~.
124
CORAY, NOETZEL AND SELKOW
With the M and D functions defined, a general outline of picture processing algorithms will be specified, and examples provided from the literature. D E F I N I T I O N . A Local Cluster Analysis algorithm (LCA) is a nondeterministic algorithm which accepts as input a graph G, and is of the following form. GI: = G
FOR ALL (i,j) ~ A DO IF D(i,j, G1) T H E N G~: = M(i,j, GO. As before, the order in which arcs are selected is arbitrary. Notice that the M operation modifies the bounds of the loop in which the operation takes place. The termination condition for the LCA is that it processes all the arcs of a particular instance of G~ without creating a new G j. In practice, however, those arcs that have been tested in one version of G~ and still exist in the next version (arcs whose vertices are not involved in the merge) need not be retested in Ga.
Example of an LCA Barrow and Popplestone [1] propose synthesizing regions according to the heuristic: merge adjacent regions if the average contrast across the common boundary is less than some threshold. The merging operation was presented in the section titled "Example of the Merge Operation." The function D (i,./,G) tests the second component of a~: = (n~;,a~.j) against a threshold 0, and returns T i f f a~j < 0.
Example of an LCA Muerle [4] defines a picture processing algorithm in which a picture is initially divided into elementary regions, each characterized by the entire distribution of gray-level values of points within the region. A region is grown by merging adjacent regions into it and the merge takes place if the average absolute difference between the gray levels of the two regions is less than some threshold value. Specifically, suppose that each point of the picture may have one of n gray-level values. The distribution of gray-level values in region i is specified by the ndimensional vector a~ = ( g~l,g~ . . . . .
g~n).
The function D that decides mergeability is defined as follows. Let
~i = ~ guc 1¢=1
and
= E D has value Tiff 8~; < 0.
Ig,k/ , -
ORDER I N D E P E N D E N C E IN CLUSTERING
125
The Merge operation is specified by = (gil + g J1, g~ + gj.,-. . . . .
g~,~ + gj,)
The function .f.~ need not be specified since data on the arcs are not needed in this LCA. E x a m p l e o f an L C A
Brice and Fenema [2] present two picture decomposition algorithms which are easily expressed in terms of an LCA. Each (~ contains the perimeter P~ of the region that vertex i represents. For each arc, o~;j= (L~,W~.i), where LIj is the length of the border between i and j, and W,j is the number of points along the border for which the gradient across the border is below some threshold. The Merge operation is defined by oLiu.j = f,(ai,aj,a~j) = e~ + Pj - L~,
if a~k not defined, if ~,,. not defined, L (L,~ + LjI~,Wil~ + W.jl~) otherwise. [ (Li/,,, Wu~)
= ] (L,,., Wjl()
The first LCA (the phagocyte heuristic) specifies D ( i , j , G ) = T i f f min(Pi,Pj)/W~.l < O.
The second LCA (the weakness heuristic) specifies D ( i , j , G ) = T iff (Lij -- Wi.j)/Lt~ < O.
3. A SIMPLIFIED REPRESENTATION OF PICTURE GRAPHS The labeling function oz labels both vertices and arcs of a graph, because region synthesizing programs in general maintain data about both the regions and the borders between regions. However, from the point of view of making local merging decisions and local merges, data on the vertices are unnecessary. This can be demonstrated by showing that a simple transformation which maps a graph with data on arcs and vertices to a graph with data on the arcs only is an isomorphism with respect to the M and D operations. The transformation pushes data on the vertices back to the edges, making the label of each edge a triple. In order to effect this transformation, it will be necessary to assume that vertices of the graph are strongly ordered, and that therefore the arcs are implicitly oriented. The ordering of vertices is maintained under the merge operation by assuming that i U j of graph M ( i , j , G ) holds the same position in the ordering of the vertices of this graph as min(i,j) does in the ordering of the vertices of G, and the ordering is otherwise identical'in the two graphs. Throughout the remainder of this section, the arc notation (i,j) will signify that i is less t h a n j in the ordering of vertices. DEFINITION. P is a transformation on graphs such that for G --- (V,A,L,o~) with an ordering upon V, P ( G ) = ( V , A , L x L x L,¢), where/3 is a mapping
126
CORAY, NOETZEL AND SELKOW
f r o m the arc s of P ( G ) into L x L × L, such that/3u - fl ( ( i , j ) ) = (~i,%,au)./3 is not designated for vertices. It is clear f r o m the definition that P does not modify the structure of graph G; if v e r t e x i, or arc (i,j) exists in G, it exists in P(G). It will be clear from the context whether the arc or vertex of G or of P(G) is intended. T h e functions M(i,j,G) and D(i,j,G) will be written as operators M~ and Du. T H E O R E M . The transformation P is an isomorphism preserving the M~j and Du operations. PROOF. It is clear from the definition that P is a o n e - o n e mapping. T h e transformation P assigns the label /3iusk = (oqUj,o~k,a~ujk) to e v e r y arc (i U j,k) and B,q = (a~,,o~q,apq) to every arc (p,q), p,q ~ i,j of P(M~j(G)). Suppose the vertices i,j of P (G) are merged according to a transformed operation PM~j. This merge operation has the same definition as M~, except
gA ((xl,x~,xa), (Yl,y2,y~), (zl,z.,,z3) ) = (fv (xl,x2,xa) ,Y2,f~l(xl,y2,z~,x3,ya,za) ). T h e n the label o f e v e r y arc (i U j,k) of graph PM~j(P(G)) is
fi~uJ~
gA (/3/j,/3..Bjk)
=
g,l ((m,aj,a~),(at,ak,a~k),(a~,ak,o~jk))
=
= (f, (a,,ai,aij) ,~k,f~, (ai,aj,oo.cq j,aik,aj,,) ) T h e label of e v e r y arc (p,q), p,q ~ i,j o f P ( M u ( G ) ) is the same as that of P f G ) , ~,,~ = ( ~ , , , ~ , ~ , , ~ )
.
T h e s e are the same labels as those of arcs (i U j,k) and (p,q) o f P(M~(G)). PMo is the isomorphic image of Mu under P. A n y function D~(G) which computes a value {T,F} only from ch,e~,~u of G can be easily rewritten PD~ to compute the same value from the single parameter /3~= (~,o~,oq~) o f P ( G ) . PDu i s the isomorphic image of Du under P.
4, ORDER INDEPENDENCE T h e analysis o f L C A ' s operation can be restricted to the case in which data are maintained o n the arcs only. T h e concept of order independence of an L C A will now be formalized, and constraints o n the D and M functions of the L C A that are implied b y the property of order independence will be derived. D E F I N I T I O N . A D-sequence is a sequence of arcs teated b y the L C A in processing a graph G such that D(i,j,G') = F for all arcs (i,j) of the graph G ' p r o d u c e d b y the L C A . D E F I N I T I O N . Graphs Gt and G2, each derived from graph G by a sequence o f merge operations, are equivalent ff they have the same sets of vertices and arcs. In particular, graph G1 has a vertex i~ U & • • • & derived from merges of vertices ii, " • • , i, of G , if and only if G2 has such a vertex, although not necessarily f o r m e d in the same order. D E F I N I T I O N . A n L C A is terminally order-independent ( T O I ) if for any graph G, all D - s e q u e n c e s lead to equivalent final graphs.
ORDER INDEPENDENCE IN CLUSTERING
127
T H E O R E M 1. If an LCA is TOI, then for any graph G having vertices i,j,k, if the LCA tests arc (i,j) of G in one step and produces graph G1 for the next test, or else terminates with G1 ---- G, then V(i,j,G) A ( V ( j , k , G ) V D(i,k,G)) ----D(i U j,k,G1). PROOF. If an L C A is TOI, then it must produce a unique result in operating on any subgraph Go of G, consisting of i,j,k and the arcs among them. If D(i,j,Go)-=D(i,k,Go) = T and (i,j) is tested and merged first, resulting in D(i U j,k,G,) = F, the LCA finally produces agraph with vertices {itA j,k}. But if (i,k) is tested and merged first, the resultant graph either has vertices {i U k,j} i f D ( i U k,j, G1) = F, or {i U j U k} i f D ( i U k,j, G1) = T. This contradicts the LCA's being TOI. Hence D(i,j, Go) A D(j,k,Go) ~ D(i U j,k, Gt). A symmetrical argument holds for D (i,j, Go) = D (j,k,Go) = T and hence
D(i,j, Go) A (D(i,k,Go) V D(j,k, Go)) ~ D(i U j,k,G~). The three-vertex graph Go cannot be used for a counterexample showing that the reverse implication holds as well, because if D (i,j,Go) = T, there is only one D-sequence. Hence, assume graph G has at least four vertices, and consider the LCA's operation on the subgraph Go, having vertices i,j,k, and p, such that
D(i,j,Go) = D(k,p,Go) = T, and
a(i,k,Go) = V(j,k,Go) = D(i,p,Go) = V(k,p,Go) = F. If the LCA first tests (i,j), and i f D ( i U j,k,G1)= T, then the second step of the L C A may merge i U j and k, resulting in a graph that includes vertex i U j U k. But if (k,p) is tested first, then it is possible that D(k (A p,i,G,)= D ( k U p,j,G~) = F and then D(k U p,i U j, G2) -~ F after i a n d j are merged. In this resultant graph, k is not merged with i U j, therefore the LCA could not be TOI. Therefore,
D(i U j,k,G,) ~ D(i,j,6o) A (D(i,k,Go) V D(j,k,Go)). Theorem 1 may be paraphrased by saying that is not possible to convert an arc from value T to value F by any single merge operation involving one of the vertices of the arc. The following theorems relate to the graphs that an L C A produces in its complete (multiple-step) operation. The notation i' will be used to indicate the vertex in any graph that an LCA produces from graph G that is either the same vertex as i in G, or the descendent of i through one or more merge operations. In any graph G' produced from G possibly i' = j ' even though i e j ; for example i U j = i ' = j '. T H E O R E M 2. If an LCA is TOI, then from any graph G, the LCA produces a final graph G' such that, for any vertices i,j,k of G,
D(i,j,G) h (D(i,k,G) V D(j,k,G)) ~ D(i' U j ' , k ' , G ' ) .
128
CORAY, N O E T Z E L AND SELKOW
PROOF. Theorem 1 states that this theorem is true if G ' is the graph produced upon testing arc (i,j) of G. It remains to be shown that no merging steps before or after the test of (i',j') change D(i' U j ' , G ' ) . The theorem is trivially true for all graphs of one or two vertices. F o r graphs of three vertices, application of Theorem 1 to every D-sequence shows that, if any two of the three arcs evaluate to T, the final graph will be a single vertex. Consider this case to be the basis of an inductive argument, and assume the theorem holds for all graphs of less than n vertices. If G is an n-vertex graph and a TOI L C A first tests and merges (i,j) to produce graph G1, then by Theorem 1, for all k such that D(j,k,G) V D(i,k,G) = T, D(i U j,k,G~) = r. But then G1 is an n - 1 vertex graph, and the inductive hypothesis in the form
D ( i U j,k, G1) A D(i U j, k,G1) ~ V ( (i U j ) ' U k',k',G') = D ( i ' U j ' , k ' , G ' ) holds for the final graph G '. Similarly, if vertices i and k are tested and merged first to produce graph G~, then
D(i,k,G) A D(i,j,G) ~ D(i U k,j, G1). But G1 is an n -- l vertex graph, and so
D(i U k,j,G~) A D(i U k,k,G~) ~ D((i U k)' U j',k',G') = D(i' U j',k',G') for the final graph G ' by the inductive hypothesis. A parallel argument shows the theorem to hold when (j,k) is tested and merged first. I f vertices i and p, p # i,j,k, are merged first to produce G1, then for all vertices k of G,
D(i,p,G) A D(i,k,G) ~ D(i U p,k, G1). But then by the inductive hypothesis
D ( i U p,j,G,) A (D(i U p,k,G~) V D(j,k,G~)) D( (i U p)' U j ' , k ' , G ' ) = D ( i ' U j ' , k ' , G ' ) . The same argument can be used for the case in which vertices j and p are first merged. I f vertices k and p, p ~ i,j,k, are merged first to produce G~, then D(i,k,G) V D ( j , k , G ) = T must be assumed to show the implication holds. If D(i,k,G) = T, then D(k,p,G) A D(i,k,G) ~ D(k U p,i,G~) by T h e o r e m 1, and if D ( j , k , G ) = T, then
D(k,p,G) A D(j,k,G) ~ D(k U p,j, G1) by Theorem 1. Therefore
D ( i , j , G ) A (D(i,k,G) V D ( j , k , G ) ) D(i,j, Ga) A (D(i,k U p,G~) V D ( j , k U p,G~) ), and D(i' U j ' , ( k U p)',G') is implied by the inductive hypothesis.
129
ORDER INDEPENDENCE IN CLUSTERING
Last, if vertices p and q, {p,q} f3 { i , j , k } - ~b are first merged, graph G is reduced to an n - 1 vertex graph with none of the values on arcs among i,j,k modified. H e n c e the theorem holds by the inductive hypothesis. T H E O R E M 3. If an L C A is T O I , then for any graph G in which there exists a sequence of vertices k, • • • k,. such that D(k~,k~+l,G) = T for 1 ~< i < r, the L C A will produce a graph G ' such that D ( k l , k ~ , G ' ) = T. P R O O F . T h e theorem is obvious for r = 2. Assume it is true for any sequence of less than r vertices of a graph G, and let kl • • • kr be a sequence o f vertices such that D(ki,k~+l,G) = T f o r 1 ~< i < r. T h e n for any k~-l,k~,ki+~, 1 < i < r, the L C A must, at some point in its operation, produce a graph G ' such that
D(k[-1 U kl, kl+,,G') = D(k~_l,kl+~,G') = T by Theorem 2. If this G ' is not the final graph, the L C A will continue to operate on it; but the sequence of vertices in G ' is less than r, and the inductive hypothesis holds. THEOREM 4. If an L C A is T O I , then for every graph G in which there exists a sequence of vertices ki • • ' kr, and e v e r y graph G' that the L C A produces fi'om G, r--1
D ( k ~ , k L G ' ) ~ 1-I D ( k , k ~ + , , G ) . ~=1
P R O O F . Suppose a T O I L C A operating on graph G produces graph G', with D (k~,k~.,G') = T and yet there is no sequence of mergeable vertices from k~ to k,. in G. Then let G., be the first graph within which the sequence of vertices k', . . . . . k~. (not necessarily distinct) is such that r--J.
1 [ D(k[,k~+a,G2) = T i=1
and let graph G, be the graph immediately preceding G2 in the L C A ' s operation. Some vertex kf of the sequence k[ . . . . . k~. of G, was involved in this merge; then in order for the sequence not to be entirely mergeable in G1, either D(k~,ki+~,G~) = F o r D(k~_~,k~,G~) = F. Assume D ( k ~ , k ~ + l , G 1 ) = F . If vertex p is merged with k~, obviously D(p,k~,G~) = T and, for the chain not to exist, D ( p , k I + I , G O = F. But D(k[,p,GO
A (D(k~,k~+~,G~) V D ( p , k ~ + ~ , G O ) = D ( k ~
tO p,k~+a,G2)
contradicting that the L C A is T O I by T h e o r e m 1. A similar argument holds if D ( k ~ _ a , k ~ , G ~ ) = F is assumed. H e n c e , the sequence of mergeable vertices in G must exist if D (k~,kr,G') = T. COROLLARY 1. If an L C A is T O I , then for any graph G with vertices k~ and k,., the L C A produces a graph G ' such that D(k~,k:.,G') = T if and only if there is a sequence of vertices k, . . . . . k,. in G, such that I'--I
]-[ D(k~,kt+l,G) = T. i=1
P R O O F . A direct result of Theorems 3 and 4.
130
CORAY, NOETZEL AND SELKOW
But the existence of a sequence of immediately mergeable vertices connecting any two vertices of G, as a necessary and sufficient condition for the final merging of the two vertices, is a criterion for merging that is independent of the order in which arcs are tested and merged. Hence, it is a sufficient condition for any LCA to be TOI. C O R O L L A R Y 2. An LCA is TOI if and only if for any graph G, with vertices k~ and kr, the LCA produces a final graph with k~ and k,. merged if and only if there is a sequence of vertices kl . . . . . kr in G, such that
H D(ki,kt+l,G) = T. i=1
5. ONE-PASS ORDER INDEPENDENCE The preceding theorems characterizing the operation of a TOI LCA suggest a possible economy in the number of tests that must be made on the arcs of the graph being processed by the LCA. A 0ne-Pass LCA will be defined, and shown to be equivalent to an LCA. D E F I N I T I O N . A One-Pass LCA (OPLCA) is a nondeterministic algorithm of the form G~: = G; B: = A ; FOR A L L (i,j) ~ B DO BEGIN B: = B - {(i,j)}; IF D(i,j, G1) =- T T H E N BEGIN FOR A L L k E V DO 1F ((i,j) ~ B OR (j,k) ~ B) T H E N DO B: = B U {(i U j,k) } - { (i,k),(j,k) }; GI: = M(i,j, GO END; END. The D and M operations are defined as they were previously. An O P L C A will be said to be equivalent to an L C A if from any given graph G and each result G' that the LCA produces from G, the O P L C A can produce from G a graph equivalent to G'. Since the set B from which arcs are chosen for testing in an O P L C A is always a subset of the arcs of the graph the LCA is operating on, each Dsequence of an OPLCA is a subsequence of a D-sequence of an LCA that has the same M and D operations. Hence if an OPLCA is equivalent to a T O I LCA with the same M and D operations, the O P L C A is TOI. To show that there is an OPLCA equivalent to any TOI LCA, the following lemma is proven. LEMMA. If an OPLCA whose M and D operations are those of a TOI L C A produces any graph G' from G, and at that point in the LCA's operation B' is the value of the set variable B, then A ' - B ' contains only arcs ( i ' , j ' ) =
ORDER INDEPENDENCE IN CLUSTERING
]3l
(il U i2 U . . . LJ it,j1 U J2 U . . . U L) such that D ( i v , j q , G ) = F for all 1 ~p~r, 1 ~ q~s. P R O O F . The set A ' - B ' is defined by the operation of the O P L C A as follows• 1. If ( i ' , j ' ) of any graph G ' is tested by the O P L C A , and D ( i ' , j ' , G ' ) = F, then ( i ' , j ' ) ~ A ' -- B'. 2. If the O P L C A performs the merge G ' = M ( i ' , j ' , G " ) , then (i' U j ' , k ) ~ A ' - - B' if { ( i ' , k ) , ( j ' , k ) } f? A ~ cb and { ( i ' , k ) , ( j ' , k ) } fl B " = 4~, where B " is the value of set variable B just before the merge. The arcs that enter the set A' - - B ' by means of (1), above, have the property required in the lemma. An O P L C A has the single-step property of Theorem 1 because this property is independent of the order in which the arcs are selected for merging. H e n c e D ( i,j, G ) A ( D ( i,k, G ) V D ( j , k , G ) ) = D ( i U j,k, G ' ) . As a basis of an induction on the number of vertices of G' represented by i' and j ' , where ( i ' , j ' ) ~ A' -- B' by means of (1), above, notice that if i' = i a n d j ' = j , then D ( i , j , G ) = F trivially satisfies the property of the lemma. F o r all i ' = i j U i., U ' ' "U ir, j ' = j l U j., U . . . Uj~, and k ' - - k l U k2 U U kt such that r + t < m and s + t < m , assume D ( i ' , k ' , G ' ) = F implies D ( i v , k q , G ) = F for I ~ < p < r , 1 ~q~
. "
132
CORAY, NOETZEL AND SELKOW
of each of the arcs of G', but then, by Corollary 2, no further merges will take place. Thus, a TOI LCA can produce as a final graph the same graph as was produced by the O P L C A with the same M and D operations; because of the TOI property, this is only one graph. The O P L C A is equivalent to the TOI LCA, and also TOI. 6. CONCLUSIONS
The characterization of the LCA presented here is general enough to represent several implemented picture-processing algorithms reported in the literature [1,2,4]. These are the algorithms that operate on data local to a region. The results that any such algorithm produces depends on the region of the picture at which the algorithm begins processing. It follows from Corollary 2 of Section 4 that the class of local clustering algorithms that produce unique results is equivalent to the parallel algorithm that works as follows. Starting with the graph G representing the original picture, remove all arcs (i,j), such that D(i,j,G) = F. The connected components of this new graph are the regions that should be merged to produce the final graph. This represents a severe limitation on the merging strategies or heuristics that may be used if a unique result is required. It means that no matter what statistics are collected and combined to represent an aggregated region, the decision to merge two aggregated regions will be the same as the decision to merge the most mergeable, or closest elementary regions of each aggregate region. The result of Section 5 is that if an L C A is to be order independent, and the parallel algorithm cannot be implemented, an efficient serial algorithm producing the same result can be designed, in which no more tests are required than the number of arcs of the original graph, and possibly many less. REFERENCES 1. H. O. Barrow and R. J. Popplestone, Relational descriptions in picture processing, in Machine Intelligence (B. Meltzer and D. Michie, Eds.), Vol. 6, pp. 377-396, Edinburgh University Press, Edinburgh. 1971. 2. C. R. Brice and C. L. Fenema, Scene analysis using regions, Artificial Intelligence 1, 1970, 205-226. 3. N. Jardin and R. Sibson, Mathematical Taxonomy, Wiley, New York, 1971. 4. J. L. Muerle, Some thoughts on texture discrimination by computer, in Picture Processing and Psychopictorics (B. S. Lipkin and A. Rosenfeld, Eds), pp. 371-379, Academic Press, New York, 1970, 5. R. R. Sokal and P. H. A. Sneath, Principles of Numerical Taxonomy, Freeman, San Francisco, 1963.