# Dynamic Round Robin CPU Scheduling Algorithm Based on K-Means Clustering Technique
## 1 Introduction
### Clustering Technique  
Dividing the data into groups that are useful, meaningful, or both is known as clustering [20]; greater difference between clusters and greater homogeneity (or similarity) within a cluster lead to better clustering. Clustering is regarded as a type of classification in that it generates cluster labels of the homogeneous objects [21; 22]. Major concern in the clustering process is revealing the collective of patterns into reasonable groups allowing one to find out similarities and differences, as well as to deduce useful and important inferences about them. Unlike classification, in which the classes are predefined and the classification procedure specifies an object to them, clustering creates foremost groups in which the values of the dataset are classified during the classification process (i.e., categorizes subjects (data points) into different groups (clusters)). Such a categorizing process depends on the selected the algorithm adopted and characteristics [23]. The type of features determines the algorithm used in the clustering, for example, conceptual algorithms are used for clustering categorical data, statistical algorithms are used for clustering numeric data, fuzzy clustering algorithms allow data point to be classified into all clusters with a degree of membership ranging from 0 to 1, this degree indicates the similarity of the data point to the mean of the cluster. Most commonly used traditional clustering algorithms can be divided into 9 categories, summarized in Table 1. Ten categories of modern clustering algorithms contain 45 [24]. \begin{table}
\begin{tabular}{c c} \hline
**Typical Clustering Algorithm** & **Based on (Category)** \\ \hline K-medoids, CLARA, CLARANS, PAM, K-means & Partition \\ Chameleon, ROCK, CURE, BIRCH & Hierarchy \\ MM, FCS, FCM & Fuzzy theory \\ GMM, DBCLASSD & Distribution \\ Mean-shift, OPTICS, DBSCAN & Density \\ MST, CLICK & Graph theory \\ CLIQUE, STING & Grid \\ FC & Fractal theory \\ ART, SOM, GMM, COBWEB, & Model \\ \hline \end{tabular}
\end{table} 
Table 1: Summarization of traditional clustering algorithms categories. K-means is the simplest and most commonly used clustering algorithm. The simplicity comes from the use of squared error as stopping criterion. Besides its simplicity, time complexity of K-means is low \(O(nkt)\), where \(n\): the number of objects, \(k\): the number of clusters, and \(t\): the number of iterations. In addition, K-means is used of large-scale data [24]. It partitions the dataset into \(K\) clusters (\(C_{1}\), \(C_{2}\),..., \(C_{K}\)), represented by their means or centers to minimize some objective function that depends on the proximities of the subjects to the cluster centroids. Equation (1) describes the function to be minimized in weighted K-means [25]. \[ \begin{array}{c}min\\ \{m_{k}\},\ 1\leq k\leq K\ \ \sum_{k=1}^{K}\sum_{x\in C_{k}}\pi_{x}dist(x,m_{k}), \end{array}  \tag{1}\]  
where \(K\) is the number of clusters set by the user, \(\pi_{x}\) is the weight of \(x\), \(m_{k}=\sum_{x\in C_{k}}\frac{\pi_{x}x}{n_{k}}\) is the centroid of cluster \(C_{k}\), and the function \" _dist_ \" computes the distance between object \(x\) and centroid \(m_{k}\), \(1\leq k\leq K\). Equation (2) describes the function to be minimized in standard k-means clustering [26]. \[d=\sum_{k=1}^{K}\sum_{i=1}^{n}\|(x_{i}-u_{k})\|^{2} \tag{2}\]  
where \(u_{k}\) represents the \(kth\) center, and \(x_{i}\) represents the \(ith\) point in the dataset. While the selection of the distance function is optional, the squared Euclidean distance, i.e., \(\|x-m\|^{2}\), has been most widely used in both practice and research. The \(K\) value was set according to the given number of clusters for each dataset [27; 28]. K-means clustering method requires all data to be numerical.