**5. Algorithm C(Y): a node-based algorithmic variant**

s3(1) = 1 where the values s3(v) for v > 1 identify successive edges e(s) that are added in Case

After completing the Inner Loop for W = Wo (while saving this information), upon assigning

), the fact that Wnext < W(v) for v < v<sup>2</sup>

recorded as the new index s3(v\* + 1)). Then the customary Inner Loop for W > Wo can be

of the Inner Loop continue to save the same information, which is used again to create an

vious construction. We also avoid having to re-do the checks to determine that the remaining edges qualify to be added. Together this can amount to a considerable savings in computation. A possibility arises to save additional computation by using more memory. Each time a new candidate for Wnext is identified, in the process of identifying the indexes s2(1), s2(2), …,

rithm, avoiding the burden of excessive memory by overwriting the previous copy each time a new one is made. Then the latest copy will be available at the point where the edge e(s) for

However, it may not be possible to take advantage of a current copy of the saved arrays on every iteration of the Inner Loop (unless previous copies are not overwritten when new ones

again making a copy of the arrays for the next execution of the loop. But if it no new value of

Consequently, in this latter case we resort to the construction that does not rely on the copied arrays, generating the arrays instead in the process of adding edges. Thus, on the next execution of the inner loop we will again have the copies available. Hence in this fashion we will be able to take advantage of the copied arrays at least on every second execution of the loop,

As previously noted, the foregoing relationships and their implications are embodied in a format suitable for creating a computer code in Section 7, after we first describe two additional

), then the previous value W(v2

final Wnext value, and no copies of the arrays remain in memory for this value.

), will be added to the construction (although this edge was not added on

)) we can start the current construction by simply adding the edges e(s) for s = s3(1)

, E<sup>k</sup>

) is added on the current execution of the loop, making it possible to recover the arrays

implies that the algorithm

) will again be added to the current con-

) instead of s = 1. Subsequent executions

, MinCost(k) and K used by the algo-

), if now a new Wnext value is

–1) will be the new

of the previous execution) then we can proceed by

–1) (for s = s2(v<sup>2</sup>

) that were not added to the pre-

will also be unchanged. Hence, letting v\* = Max(v:

) (whose index s2(v<sup>2</sup>

), at which point the

) therefore becomes

(3) of the Inner Loop(to generate the current cluster collection C(W)).

will perform exactly the same sequence of steps until reaching s = s2(v<sup>2</sup>

W the value Wnext = W(v<sup>2</sup>

142 Recent Applications in Data Clustering

the previous execution of the inner loop).

struction, and the values s2(v) for v < v2

advanced start in the manner described.

Consequently, all edges e(s3(v)) for s3(v) < s2(v2

to s3(v\*), followed by adding the edge e(s) for s = s2(v<sup>2</sup>

executed starting with s initialized by setting s = s2(v<sup>2</sup>

By this means, we avoid examining all edges e(s) for s < s2(v<sup>2</sup>

), we can save a current copy of the arrays N<sup>k</sup>

without having to regenerate them to resume the current loop.

are made). After re-starting by recovering the arrays for s2(v<sup>2</sup>

) (referring to the v2

algorithmic variants that can be exploited by analogous relationships.

edge e(s) for s = s2(v<sup>2</sup>

s3(v) < s2(v2

s2(v2

s = s2(v<sup>2</sup>

determined for s > s2(v<sup>2</sup>

if not more frequently.

Wnext is found for s > s2(v<sup>2</sup>

It is possible to formulate a node-based variant of the C(W) algorithm which follows a closely related format and is supported by a similar rationale.

In the node-based approach, we replace the parameter W by a parameter Y which is linked to costs associated with nodes in N<sup>k</sup> rather than to costs associated with edges in E<sup>k</sup> . (More precisely, the costs associated with nodes are also derived from edges—i.e., the edges that meet these nodes—though these edges are different from those referenced in the C(W) algorithm.)

Accompanying this parameter change, we replace the value MinCost(k) associated with the sets indexed by k ∈ K with a value MinCostB(i) associated with the nodes i∈ N, and more particularly, we replace MinCost(k′) for k′ = L(i′) by MinCostB(i′), and replace MinCost(k″) for k″ = L(i″) by MinCostB(i″)).

This replacement changes the updating rule when Nk″ is absorbed into Nk′ in Case (3). Specifically, the values MinCostB(i′) and MinCostB(i″)) are updated by setting MinCostB(i): = Min(MinCostB(i),c(e(s)) for i = i′ and i″, in contrast to the update involving MinCost(k′) and MinCost(k″) (which setsMinCost(k′): = Min(MinCost(k′),MinCost(k″), c(e(s))).

The reason for these changes is as follows. In the node-based version, to permit the edge e(s) = (i′, i″) (= (p(s),q(s))) to be added and hence to join the subgraphs (Nk′, Ek′) and (Nk″, Ek″), we require that c(e(s)) ≤ Y + MinCostB(i) for both i = i′ and i″. Hence we require c(e(s)) ≤ Y + MinCostB0, for MinCostB0 = Min(MinCostB(i′), MinCostB(i″)). On the other hand, if c(e(s)) > Y + MinCostB0, we are prevented from adding edge e(s), and by the preceding relationships this causes the first part of Case (2) to retain exactly the same form as in the C(W) algorithm.

To update MinCostB(i′) and MinCostB(i″) in Case (3), we must account for the fact that each of these two values is affected only by the cost of the edge e(s), and hence will either retain its present value or become equal to c(e(s)), according to which is smaller. (It may be noted that once node i for i = i′ or i″ has been assigned an edge cost c(e(s)), then MinCostB(i) will not change thereafter, since any edge e(s) that is added later to meet node I will have a cost no less than that of the earlier edge.)

Based on these observations, we can state the form of the C(Y) algorithm as follows.
