**Begin Inner Loop**

While s < sLast

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

*Initialization(C) for* Z = Zo:

nTrack + n<sup>k</sup>

*Modification of Inner Loop for* Z = Zo:

also be moved to precede Case (1).)

Inner Loop (following Z = Znext).

*Modifications for all Z values*:

before the Outer Loop.

s2(1), s2(2), …, s2(v<sup>2</sup>

Similarly, s3(1), s3(2), …, s3(v<sup>3</sup>

We therefore have Z(1) > Z(2) > … > Z(v<sup>2</sup>

In Case (3) (when Nk″ is absorbed into Nk′): Set nk′: = nk′ + n<sup>k</sup>

*For early termination of the last execution of the Inner Loop*:

**7.2. Advanced updating for successive Z values**

Set n<sup>k</sup> = 1, k ∈ K \ {k′}, and nk′ = 2 (hence n<sup>k</sup> = |N<sup>k</sup>

t(i′) = t(i″) = 1 (hence t(i) identifies the number of edges e(s) = (i,j) for all s currently examined in the Inner Loop (and its initialization). Finally, set nTrack = 0 and set FirstTime(k) = True, k ∈ K (to identify the sets that have not been prevented from having an edge added to them).

In the prelude to Case (1): Execute the following for i = i′ and i″: If i = L(i) then set t(i): = t(i) + 1 and if (now) t(i) = tMax(i) then set nTrack: = nTrack +1 and if (now) nTrack = n terminate the

Re-organize Case (2) to become as follows: Execute the following for k = k′ and k = k″: If FirstTime(k) = True, then if c(e(s)) > Z + MinCostC(k): set FirstTime(k) = False, set nTrack: =

nate the Inner Loop.After performing the preceding for both k′ and k″: If FirstTime(k) = False for k = k′ or k = k″, then continue to the next iteration of the Inner Loop. (Note: Case (2) could

Set sEnd = s at the end of Case (3) and set sLast = sEnd immediately after the conclusion of the

Set n<sup>e</sup> = 1 in Initialization(B). Then at the end of Case (3) set n<sup>e</sup> = n<sup>e</sup> + 1 and if n<sup>e</sup> = n – 1 terminate the Inner Loop. (The Outer Loop will automatically terminate as well, by the condition Z = Large.)

Because of the special modifications for Z = Zo that do not apply for Z > Zo, it is convenient to insert the portion of the algorithm for Z = Zo at the very beginning of the C(Z) Algorithm,

We draw on the relationships of Section 4.2 to create the instructions for updating C(Z) to reduce the amount of computation required on successive iterations of the Inner Loop.

We adopt the following notation of Section 4.2, re-expressed in terms of the C(Z) algorithm:

of Znext is identified in Case (2) of the Inner Loop, beginning with the initialized value s2(1) = 1.

Case (3), beginning with the initialized value s3(1) = 1. (In the re-organized Case (2) for Z = Zo in Section 7.1, the value Znext may be reduced twice for a given edge e(s) and we only consider the

tion Z(1) = Large, denotes the corresponding candidate values for Znext generated in Case (2).

last (smaller) Znext value produced for e(s).) The sequence Z(1), Z(2), …, Z(v<sup>2</sup>

)identifies the successive s indexes that occur each time a new (smaller) value

)identifies the s indexes of successive edges e(s) that are added in

), where the final Znext is given by Znext = Z(v<sup>2</sup>

) with the initializa-

).

, compute Znext = Min(Znext, c(e(s)) – MinCostC(k) and if (now) nTrack = n, termi-

″.

Inner Loop. (tMax(i) denotes the number of nodes adjacent to i in the graph G.)


A Class of Parametric Tree-Based Clustering Methods http://dx.doi.org/10.5772/intechopen.76406 147


Ek″: = Ek′∪ Ek″ ∪ {e(s)}.

Correspondingly, update L(i) by setting L(i) = k′ for all i∈ Nk″, and set MinCostA(k′): = Min(MinCostA(k′),MinCostA(k″), c(e(s)); MinCostB(i): = Min(MinCostB(i),c(e(s)) for i = i′ and i″ (thus yielding MinCostC(i) by the definitions above).Finally, set K: = K \ {k″}.

Endwhile

Z = Znext

Endwhile
