## 5 Proposed Work
### Load Balancing
#### 5.3.1 VM Clustering  
The MSC algorithm is used to cluster VMs, and unnecessary VM migration in the process is consequently reduced. This nonparametric clustering technique does not require prior knowledge and shape of clusters, locates the maximum density function, and is consequently known as a mode-seeking algorithm. It is based on the sliding window algorithm, which aims to find the dense area of data points. The MSC algorithm is a centroid-based algorithm with the primary objective of locating the center points of each group. It works by updating candidate center points within the sliding window. Nearby duplicates of candidate windows are eliminated by filtering, and the final set of center points and their parallel groups are then formed. Input is considered data points in the MSC algorithm.  
Given \"n\" data points di, where i = 0,..., n on a d-dimensional space, a multivariate kernel density function is estimated with kernel _K(x)_ as  
\[\text{F}(x)=\frac{1}{nr^{d}}\sum_{i=1}^{n}K\Big{(}\frac{x-x_{i}}{r}\Big{)} \tag{4}\]  
where \(r\) denotes the sliding window radius. For radially symmetric kernels, the profile of kernel _k(x)_ is defined and satisfies the following equation,  
\[K(x)=e_{k,d}k(\|x\|^{2}) \tag{5}\]  
where \(e_{k,d}\) refers to the normalization constant that assures that _K(x)_ is integrated into 0. The modes of density functions are located at the zero of the gradient function \(\
abla F(x)=0\),  
\[\begin{split}\
abla F(x)=\frac{2e_{k,d}}{nr^{d+2}}& \sum_{i=1}^{n}\left(x_{i}-x\right)\,g\Big{(}\|\frac{x-x_{i}}{r}\|^{2} \Big{)}\\ &=\frac{2e_{k,d}}{nr^{d+2}}\Big{[}g\Big{(}\|\frac{x-x_{i}}{r}\|^{ 2}\Big{)}\Big{]}\Bigg{[}\frac{\sum_{i=1}^{n}x_{i}\,g\Big{(}\|\frac{x-x_{i}}{r} \|^{2}\Big{)}}{\sum_{i=1}^{n}g\Big{(}\|\frac{x-x_{i}}{r}\|^{2}\Big{)}}-x\Bigg{]} \end{split} \tag{6}\]where \(g(s)=-k^{\prime}\) (s). The first term is proportional to the density estimate at \(x\) calculated with kernel G(x) = \(e_{k,k}\) g(\(\|x\|^{2}\)), and the second term is the mean shift. The mean shift vector constantly approaches the direction of maximum increase in density. The following vector computations are performed to realize the mean shift procedure:  
* Computation of mean shift vector \(M_{r}(x^{t})\);
* Translation of window \(x^{t+1}=x^{t}+M_{r}(x^{t})\).  
The mean shift vector is expressed as:  
\[M_{r}\Big{(}x^{t}\Big{)}\frac{\sum_{i=1}^{n}x_{i}\,g\Big{(}\|\frac{x-x_{i}}{r} \|^{2}\Big{)}}{\sum_{i=1}^{n}g(\|\frac{x-x_{i}}{r}\|^{2}\Big{)}}-x \tag{7}\]  
Mean shift is a hill-climbing algorithm in which the kernel for each iteration shifts to a higher-density region until it converges. The mean shift defines every shift in this algorithm. The kernel approaches the centroid or mean of the points within it in every iteration. The density within the sliding window is equal to the number of points within it. Kernel function selection determines the mean computation. The sliding window is shifted until convergence, where no direction at which shift can occupy points inside the kernel.  
Clustering via the MSC algorithm is illustrated in Figure 4, which shows that the kernel function approaches the highest density area in each iteration. VMs are clustered, and tasks are optimized to increase response time.