*3.3. Refinement Method*

The refinement method as shown in Algorithm 5 is used to examine the neighbors of the best solutions that have been found so far and return with the better solution if it exists in their neighborhood. It may call the trial solution (Algorithm 4) in order to find the neighbors of the current solution. If a better solution is found, it will call the trial solution (Algorithm 4) again for a new solution; otherwise, it will break. Algorithm 5 states formally the steps of the refinement method.

\$

**Algorithm 5:** Refinement Method (C, μ, ASMv, ASMu, EL, d)


#### *3.4. The Proposed MHTSASM Algorithm*

The MHTSASM cluster algorithm is proposed in this paper. It is an advanced TS that uses responsive and intelligent memory, and it uses multiple memory elements, such as the EL memory element of TS, in order to store the best solutions, and the ASM in order to store information about features of each solution. It may use two important TS strategies: intensification and diversification. It starts with initial random centers and then applies the trail solutions (Algorithm 4) in order to generate trial solutions near initial centers. The parameter variables are used to determine if intensification or diversification is needed.

If the intensification strategy is needed, the intensification (Algorithm 2) is applied to enhance the set of centers using ASM and EL. If the centers are stuck and gain no improvement, diversification (Algorithm 3) is used to make exploration for regions that have not been visited yet. However, if termination conditions are satisfied, then refinement is carried out (Algorithm 5), where the refinement method examines the neighbors of the best solution that has been found so far. If there is no improvement, then the process is terminated. Algorithm 6 states formally the steps of the advanced MHTSASM algorithm.

#### **Algorithm 6:** MHTSASM Algorithm

	- 4.1. Generate μ trail solutions <sup>C</sup>\$(j), j = 1, . . . , μ applying Algorithm 4.
	- 4.2. Repeat the following steps (4.2.1–4.2.2) for j = 1, . . . , μ.
		- 4.2.1. Adjust set of centers C\$(j) applying Algorithm 1; compute the objective function f( C\$(j)) applying Equation (2).
		- 4.2.2. If objective function of f( C\$(j)) is not better than f(C), then go to Step 4.2.1; otherwise set C equal to C\$(j) and update ASMu.
	- 4.3. Update the memory elements TL and EL.
