**6. Algorithm C(Z): a combination of C(W) and C(Y)**

Each of the C(W) and C(Y) algorithms has features lacking in the other. However, the C(Y) algorithm has a potential deficiency, which resides in the fact that it is subject to "drift"—a phenomenon where the costs of edges in an edge set E<sup>k</sup> can grow along a chain, where each new edge added to E<sup>k</sup> has a higher cost than the previous one. Such an eventuality can arise because the cost of an edge in a chain is limited only by the cost of the previous edge.

It is possible to combat drift and also take advantage of the different features of the C(W) and C(Y) algorithms by joining these algorithms to create an algorithm C(Z) that incorporates the MinCost evaluation criteria of both C(W) and C(Y) simultaneously.

Let α be a nonnegative weight applied to the edge selection criterion of C(W) and let β = 1 – αbe a nonnegative weight applied to the edge selection criterion of C(Y). We construct Algorithm C(Z) so that it will be the same as C(W) if α = 1 and will be the same as C(Y) if α = 0 (β = 1).

For notational convenience, we refer to the value MinCost(k) of the C(W) algorithm as MinCostA(k). Then the MinCost evaluation criterion of C(Z) is given by.

MinCostC(i) = α∙MinCostA(k) + β∙MinCostB(i), for k = L(i).

To apply this criterion, we create values MinCostC(i′) and MinCostC(i″) for nodes i′ = p(s) and i″ = q(s), and for k′ = L(i′) and k″ = L(i″), given by

 MinCostC(i′ ) = α ∙ MinCostA(k′ ) + β ∙ MinCostB(i′ )

MinCostC(i″) = α ∙ MinCostA(k″) + β ∙ MinCostB(i″)

Associated with the foregoing values, we define

 MinCostC0 = Min(MinCostC(i′ ), MinCostC(i″))

We state the C(Z) algorithm by reference to these definitions.

#### **C(Z) Algorithm.**

*Initialization(A)*. Set Ynext = Large, K = {1, …, n}, and for each k ∈ K let L(k) = k,

and k″ = L(i″) and absorbing Nk″ into Nk′ to create the cluster Nk′: = Nk′∪ N<sup>k</sup>

continue to the next iteration of the Inner Loop.

*Initialization(B)*. Let i′ = p(1) and i″ = q(1) and select e(1) (= (i′, i″)) by identifying k′ = L(i′)

edge set Ek′ = e(1). Set MinCostB(k′) = c(e(1)) and set K: = K \ {k″}. Finally, initialize the

Set s: = s + 1 and identify edge e(s) = (p(s), q(s)). Let i′ = p(s), i″ = q(s) and let k′ =

Case (1): If k′ = k″ (i′ and i″ belong to the same cluster), then continue to the next

Case (2): If c(e(s)) > Y + MinCostB0, for MinCostB0 = Min(MinCostB(i′), MinCostB(i″)), then compute Ynext = Min(Ynext, c(e(s)) – MinCostB0) and

Case (3) (If (1) and (2) do not apply): Absorb Nk″ into Nk′ to create Nk′: = Nk′∪ Nk″ with its associated edge set Ek″: = Ek′∪ Ek″ ∪ {e(s)}. Set L(i) = k′ for all i∈ N<sup>k</sup>

The Remarks concerning the C(W) algorithm in Section 3 can be applied as well to the C(Y)

Each of the C(W) and C(Y) algorithms has features lacking in the other. However, the C(Y) algorithm has a potential deficiency, which resides in the fact that it is subject to "drift"—a

because the cost of an edge in a chain is limited only by the cost of the previous edge.

has a higher cost than the previous one. Such an eventuality can arise

can grow along a chain, where each

and setMinCostB(i): = Min(MinCostB(i), c(e(s)) for i = i′ and i″. Finally, set K:

″= {i′, i″} with

″,

= ∅, and MinCostB(k) = Large.

iteration of the Inner Loop.

Nk = {k}, E<sup>k</sup>

144 Recent Applications in Data Clustering

edge index s by setting s = 1.

L(i′) and k″ = L(i″).

= K \ {k″}.

Now we show how to join the C(W) and C(Y) algorithms.

phenomenon where the costs of edges in an edge set E<sup>k</sup>

**6. Algorithm C(Z): a combination of C(W) and C(Y)**

Endwhile. Y = Ynext.

**End of C(Y) Algorithm**

new edge added to E<sup>k</sup>

Endwhile.

algorithm.

**Begin Inner Loop** While s < sLast|

*Inputs*: The graph G(N, E), cost vector c(e), e ∈ E, initial Zo value for Z.

Edges are ordered so that the costs satisfy c(e(1)) ≤ c(e(2)) ≤ … ≤ c(e(|E|)).

Set Z = Zo and sLast = |E|

#### **Begin Outer Loop**

While Z < Large

*Initialization(A)*. Set Znext = Large, K = N (= {1, …, n}), and for each k ∈ K let.

L(k) = k, N<sup>k</sup> = {k}, E<sup>k</sup> = ∅, and MinCostA(k) = MinCostB(k) = MinCostC(k) = Large.

*Initialization(B)*. Let i′ = p(1) and i″ = q(1) and select e(1) (= (i′, i″)).Set k′ = L(i′) and k″ = L(i″) and absorb Nk″ into Nk′ to create the cluster Nk′: = Nk′∪ N<sup>k</sup> ″= {i′, i″} with edge set Ek′ = e(1). Set MinCostA(k′) = c(e(1)) and MinCostB(i) = c(e(1)) for i = i′ and i″. Set.

K: = K \ {k″} and s = 1.
