Next Article in Journal
Machine Learning Applied to Diagnosis of Human Diseases: A Systematic Review
Previous Article in Journal
The Effect of a 7-Week Training Period on Changes in Skin NADH Fluorescence in Highly Trained Athletes
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Dynamic Round Robin CPU Scheduling Algorithm Based on K-Means Clustering Technique

1
Computer Science-Mathematics Department, Faculty of Science, South Valley University, Qena 83523, Egypt
2
Research Institute for Information Technology, Kyushu University, Fukuoka 819-0395, Japan
*
Author to whom correspondence should be addressed.
Appl. Sci. 2020, 10(15), 5134; https://doi.org/10.3390/app10155134
Submission received: 17 June 2020 / Revised: 18 July 2020 / Accepted: 22 July 2020 / Published: 26 July 2020
(This article belongs to the Section Computing and Artificial Intelligence)

Abstract

:
Minimizing time cost in time-shared operating system is the main aim of the researchers interested in CPU scheduling. CPU scheduling is the basic job within any operating system. Scheduling criteria (e.g., waiting time, turnaround time and number of context switches (NCS)) are used to compare CPU scheduling algorithms. Round robin (RR) is the most common preemptive scheduling policy used in time-shared operating systems. In this paper, a modified version of the RR algorithm is introduced to combine the advantageous of favor short process and low scheduling overhead of RR for the sake of minimizing average waiting time, turnaround time and NCS. The proposed work starts by clustering the processes into clusters where each cluster contains processes that are similar in attributes (e.g., CPU service period, weights and number of allocations to CPU). Every process in a cluster is assigned the same time slice depending on the weight of its cluster and its CPU service period. The authors performed comparative study of the proposed approach and popular scheduling algorithms on nine groups of processes vary in their attributes. The evaluation was measured in terms of waiting time, turnaround time, and NCS. The experiments showed that the proposed approach gives better results.

1. Introduction

This section is divided into two subsections; the first subsection discusses CPU scheduling, and the second subsection discusses the clustering technique.

1.1. CPU Scheduling

The mechanism for allocating and de-allocating the CPU to a process is known as CPU scheduling [1,2,3]; the portion of the operating system that carries out these functions is called the scheduler. In multi-programming systems, the number of processes in the memory is restricted by the degree of multi-programming. There are several processes in the memory waiting to receive service from the CPU, the scheduler chooses the next process to assign the CPU, waits for its processing period, and de-allocates the CPU from that process. The scheduling mechanism is the order in which processes are selected for CPU processing. The scheduling scheme may be preemptive (i.e., the CPU is assigned to a process for a certain period) or non-preemptive (i.e., once the CPU has been assigned to a process, the process keeps the CPU until it liberates the CPU either by switching to another state or by terminating). Many different CPU scheduling algorithms have been suggested. Under First Come First Served (FCFS), non-preemptive CPU-scheduling, the process that arrives first, gets executed first. Shortest Job First (SJF), non-preemptive CPU-scheduling, selects the process with the shortest burst time. The preemptive version of SJF is called Shortest Remaining Time First (SRTF); processes are placed into the ready queue as they arrive, and the existing process is removed or preempted from execution as a process with short burst time arrives, and the shorter process is executed first. Under priority scheduling, preemptive CPU-scheduling, if a new process arrived has a higher priority than the currently running process, the processing of the current process is paused and the CPU is assigned to the incoming new process [4].
RR scheduling is the most common of the preemptive scheduling algorithms [5], referred to hereafter as Standard RR (SRR), used in real-time operating systems and timesharing [6,7]. In RR scheduling, the operating system is driven by a regular interrupt. Processes are selected in a fixed sequence for execution [8]. A process receiving CPU service is interrupted by the system timer after a short fixed interval called time slice which usually is much shorter than the CPU service period (or CPU burst) of the process [9,10,11]. After that interruption, the scheduler performs a context switch to the next process selected from the ready queue which is treated as a circular queue [12,13]. Thus, all processes in the queue are given a chance to receive service for a short fixed period. This scheduling mechanism is basically used in timesharing systems [14,15,16]. The efficiency of RR algorithm depends on the time slice, if the time slice is small, overheads of more context switches will occur and if the time slice is large, RR behaves somewhat similar to FCFS with the possibility of starvation occurrence between processes. The scheduling algorithm performance depends upon the scheduling states of waiting time (i.e., total period the process spent waiting in the ready queue), turnaround time (i.e., total time between process submission and its completion), and number of context switches (NCS) [17,18,19].

1.2. 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].
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 ( n k t )   , 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 (C1, C2, …, CK), 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].
m i n { m k } ,   1 k K k = 1 K x C k π x d i s t ( x , m k ) ,
where K is the number of clusters set by the user, π x is the weight of x , m k = x C k π x x n k is the centroid of cluster C k , and the function “ d i s t   “ computes the distance between object x and centroid m k , 1     k     K . Equation (2) describes the function to be minimized in standard k-means clustering [26].
d = k = 1 K i = 1 n ( x i u k ) 2  
where u k represents the k t h center, and x i represents the i t h 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. The pseudo-code of K-means Algorithm 1 is as follows:
Algorithm 1K-Means
Input   -Dataset
   -number of clusters
Output   -K clusters
Step-1:-Initialize K centers of the cluster
Step-2:-Repeat
    -Calculate the mean of all the objects belonging to that cluster
         μ k = 1 N k   q = 1 N k x q  
      where μ k is the mean of cluster k and
       Nk is the number of points belonging to that cluster
    -Assign objects to the closest cluster centroid
    -Update cluster centroids based on the assignment
-Until centroids do not change
Determining optimal number of clusters in a dataset is an essential issue in clustering. Many cluster evaluation techniques have been proposed, one of which is the Silhouette method. Silhouette method measures the quality of a clustering; it determines how well each data point lies within its cluster. A high average silhouette width indicates a good clustering [29]. The Silhouette method can be summarized as follows:
  • Compute clustering algorithm for different values of k. For instance, by varying k from 1 to 10 clusters.
  • For each k, calculate total Within-cluster Sum of Square (WSS).
  • Plot the curve of WSS according to the value of k.
  • The location of a knee in the curve indicates the appropriate number of clusters.
The Silhouette coefficient ( S i ) of the i t h data point is defined in Equation (3).
S i = b i a i max ( b i , a i )   
where b i , is the average distance between the i t h data point and all data points in different clusters;   a i , is the average distance between the i t h data point and all other data points in the same cluster [30,31].
Motivation: Timesharing systems depend on the time slice used in RR scheduling algorithm. Overheads of more context switches (resulted from choosing short time slice), and starvation (resulted from choosing long time slice) should be avoided.
Organization: The rest of this paper is divided as follows: Section 2 discusses the related work. Section 3 presents the proposed algorithm. The experimental implementation is discussed in Section 4. Section 5 concludes this research work (see Figure 1).

2. Related Works

For better CPU performance in most of the operating systems, the RR scheduling algorithm is widely implemented. Many variants of the RR algorithm have been proposed to minimize average waiting time and turnaround. This section discusses the most common versions of RR. Table 2 shows a comparison between the known versions of SRR.
Aaron and Hong [32] proposed a dynamic version of SRR named Variable Time Round-Robin scheduling (VTRR). The time slice allocated to a process depends on the time needed to all tasks, process’s burst time, and number of processes in the ready queue.
Tarek and Abdelkader [33] proposed a weighting technique for SRR. The authors classified the processes into five weight categories based on their burst times. The weight of a process is inversely proportional to the weight; process with high weight receives more time slice and vice versa. Processes with burst time less than or equal to 10 tu receive 100% of the time slice defined by SRR, Processes with burst time less than or equal to 25 tu receive 80% of the time slice defined by SRR, and so on.
Samih et al. [18] proposed a dynamic version of SRR named Changeable Time Quantum (CTQ). Their algorithm finds the time slice that gives the smallest average waiting time at every round. CTQ calculates the average waiting time for a specific range of time slices and picks up the time slice corresponding to smallest average waiting time. Then, the processes in this round execute for this time slice.
Lipika [34] proposed a dynamic version of SRR by adjusting the time slice at the beginning of each round. The time slice is calculated depending on the remaining burst times in the subsequent rounds. In addition, the author also implemented SJF [35,36,37]. In SJF, the processes located in the ready queue are sorted in increasing order based on their burst times (i.e., the process having lowest burst time will be at the front of the ready queue and process having highest burst time will be at the end of the ready queue).
Christoph and Jeonghw [7] presented a dynamic version of SRR named Adaptive80 RR. The reason behind this name is that the time slice is set equal to process’s burst time at 80th percentile. Like Lipika’s [34], Adaptive80 RR sorts processes in increasing order. The time slice in each round depends on the processes located in the ready queue and if new process arrived, it will be added to the ready queue and will be considered in the subsequent calculations.
Samir et al. [38] proposed a hybrid scheduling algorithm based on SRR and SJF named SJF and RR with dynamic quantum (SRDQ). Their algorithm divided the ready queue into two subqueues Q1 and Q2; Q2 for long tasks (longer than the median) and Q1 for short tasks (shorter than the median). Like Adaptive80 RR [7] and Lipika’s [34] algorithms, this algorithm sorts the processes in ascending order in each subqueue. In every round, each process will be assigned a time slice depends on the median and the burst time of this process.
Samih [19] proposed a Proportional Weighted Round Robin (PWRR) as a modified version of SRR. PWRR assigns time slice to each process proportional to its burst time. Each process has a weight calculated by dividing its burst time by the summation of all burst times in the ready queue. Then the time slice is calculated depending on this weight.
Samih and Hirofumi [17] proposed a version of SRR named Adjustable Round Robin (ARR) that combines the low-scheduling overhead of SRR and favors a short process. ARR gives short process a chance, under predefined condition, to be executed until termination to minimize the average waiting time.
Uferah et al. [13] proposed a dynamic version of SRR named Amended Dynamic Round Robin (ADRR). The time slice is cyclically adjusted based on the process burst time. Like Adaptive80 RR [7], SRDQ [38] and Lipika’s [34] algorithms, ADRR sorts the processes in ascending order.

3. The Proposed Algorithm

The processes’ weights ( P W ) and numbers of allocation to the CPU (i.e., N C S   ) depend on the processes’ burst times ( B T ) , which are known, and are calculated as shown in the following subsections. We assumed that all processes arrive at the same time. The main advantage of the clustering technique in the proposed work is the ability to group similar processes in clusters. Similarity between processes depends on the values of B T ,   P W , and N C S near each other, K-means algorithm is used for this purpose. The proposed technique consists of three stages: Data preparation, data clustering, and finally, dynamic time slice implementation.

3.1. Data Preparation

Data preparation stage consists of calculating P W and N C S . The weight of the i t h process, P W i , is calculated from Equation (4):
P W i = B T i j = 1 N B T j  
where B T i is the burst time of the i t h process, and N is the number of the processes in the ready queue. The number of context switches of the i t h process, N C S i , is calculated from Equation (5):
N C S i = {   B T i S T S             i f   B T i h × S T S                             h = 1 ,   2 ,   3 ,         B T i S T S 1             i f   B T i = h × S T S                             h = 1 ,   2 ,   3 ,  
where S T S (standard time slice) is given by SRR, and   X   denotes the largest integer smaller than or equal to X . If the last round contains one process, this process will continue execution without switching its contents [4].

3.2. Data Clustering

Second stage comprises of two phases: First phase is finding the optimum number of clusters by using Silhouette method. A high average Silhouette width indicates a good clustering. Second phase is clustering the data into k number resulted from Silhouette method by using K-means algorithm. In the proposed work, the clustering metrics are B T , P W , and N C S .
Each point is assigned to the closest centroid, and each combination of points assigned to the same centroid is a cluster. The assignment and updating steps are repeated until all centroids remain the same. To quantify the notion of “closest” for a specific data, the Euclidean ( L 2 ) distance is the proximity measure for data points in Euclidean space.

3.3. Dynamic Time Slice Implementation

In the third stage, dynamic time slice implementation, the weight of the l t h cluster,   C W l , is calculated from Equation (6):
C W l = C a v g l m = 1 k C a v g m  
where C a v g l is the average of burst times in the l t h cluster. The time slice assigned to the l t h cluster, C T S l , is calculated from Equation (7):
C T S l = ( 1 C W l ) × S T S  
Each process in this cluster will execute for C T S l . In addition, a process that is close to its completion will get a chance to complete and leave the ready queue. A threshold is determined to allow the process that possesses burst time greater than STS and close to its completion to continue execution until termination. Therefore, the number of processes in the ready queue will be reduced by knocking out short processes relatively faster in the hope to minimize average waiting and turnaround times. The residual burst time of the i t h process, R B T i , is calculated from Equation (8).
R B T i = B T i C T S i  
If a process satisfies the threshold condition, its R B T equals zero and leaves the queue. When a new process arrived, it will be put at the tail of the queue to be scheduled in the next round. The clustering technique will be applied again for the survived processes (i.e., processes with B T or R B T greater than the time slice assigned to them in the current round) and new processes (if arrived) in the next round. Figure 2 shows the flowchart of the proposed algorithm.

3.4. Illustrative Examples

The following examples provide a more in depth understanding of the proposed technique.

3.4.1. Example 1

From the benchmark datasets used in the experiments, the first dataset which contains 10 processes (see Table 3) will be used in this example. P W and N C S are calculated from Equations (4) and (5), respectively. Silhouette method is used to find the optimum value of k . The location of a knee in the curve (see Figure 3) indicates the optimal number of clusters. From the curve, the optimal value of k is 2.
Now, k = 2 will be used by K-means algorithm to clustering the data points. The 7th and 8th processes are grouped into cluster 1 and the others are grouped into cluster 0 (Table 4).
The weight of cluster 0 equals 0.12271, and the weight of cluster 1 equals 0.87729. The time slice assigned to cluster 0 is 8.77287 tu, and the time slice assigned to cluster 1 is 1.227123 tu. The 7th and 8th processes will be assigned 1.227123 tu, and other processes will be assigned 1.227123 tu. The burst time of the third process is smaller than its cluster’s time slice, therefore it will terminate and leave. The number of processes, burst times, and weights will be updated for the next iteration and so forth until the ready queue becomes empty.

3.4.2. Example 2

Giving a short process more CPU time decreases the waiting time of this process more than it increases the waiting time of the long process. Consequently, the average waiting time decreases. To illustrate this concept, assume the following set of processes (Table 5) that arrive at the same time, each of which with its burst time, and the STS is 10 tu.
Using SRR scheduling, we would schedule these processes according to the following Gantt chart:
Applsci 10 05134 i001
The waiting time is 30 tu for process P1, 10 tu for process P2, 42 tu for process P3, and 45 for process P4. Thus the average waiting time is 31.75 tu, and the average turnaround time is 50 tu. On the other hand, suppose that each process is assigned a percentile of STS equals ( ( STS   /   BT ) ×   STS ) as in Table 6.
The results will be as shown in the following Gantt chart:
Applsci 10 05134 i002
The waiting time is 20 tu for process P1, 7 tu for process P2, 42 tu for process P3, and 37 for process P4. Thus the average waiting time is 26.5 tu, and the average turnaround time is 44.75 tu.

4. Experimental Implementation

The experiments were carried out using a computer with the following specification: Intel core i5-2400 (3.10 GHz) processor, 16 GB memory, 1 TB HDD, Gnu/Linux Fedora 28 OS, and Python (Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)], and version of the notebook server is: 6.0.3).

4.1. Benchmark Datasets

Nine synthetic datasets are used to test the performance of the algorithms used in the comparison. Each dataset contains a number of processes used for numerical simulation. For each process of each dataset, the burst time is randomly generated. The datasets on hand vary in number of processes, processes’ burst times, processes’ weights, and processes’ number of context switches. Detailed information on datasets is presented in Table 7. Weight and NCS depend on the process’s burst time, which means that the most important variant of the benchmark dataset is the burst times of its processes.

4.2. Performance Evaluation

The proposed algorithm was compared with five common algorithms; PWRR, VTRR, BRR, SRR, and ADRR on different nine combinations of number of processes and burst times. The authors implemented all these algorithms using the benchmark datasets. The average waiting and turnaround times depend on the number of processes in the ready queue; as number of processes increases, time cost increases. In addition, long burst times of the processes increase the time cost. To emphasize the efficiency of the proposed algorithm, benchmark datasets varying in number and burst times of processes are used. The time taken in clustering the dataset is trivial. Comparing with waiting and turnaround times, it can be said that the clustering time has no effect and can be ignored. Table A1 compares between the running times of the proposed algorithm (including the times consumed in the clustering) against other methods.
Table A2 shows a comparison of the time cost between the proposed algorithm and other algorithms in terms of average waiting time, turnaround time, and NCS. Table A3, Figure 4, and Figure 5 show the superiority of the proposed algorithm over the compared algorithms in all the datasets where the time cost of the proposed algorithm is the smallest (average waiting time and average turnaround time are 979.14 tu, 1061.36 tu respectively). Figure 6 shows how much improvement is achieved by the proposed algorithm. Unlike PWRR, BRR, and SRR which their time slices are less than or equal to the time slice defined by SRR, VTRR may behave somewhat similar to FCFS as it may give a process very long time slice. Therefore, the time slices calculated in the VTRR algorithm are restricted to be less than or equal to the time slice defined by SRR (i.e., 10 tu).

5. Conclusions and Future Work

In this paper, a dynamic SRR-based CPU scheduling algorithm has been proposed that could be used in timesharing systems in which it is important to reduce the time cost of the scheduling. Unlike the SRR algorithm which uses fixed time slice for the processes in the ready queue in all rounds, the proposed algorithm uses dynamic time slice. The proposed algorithm benefits from clustering technique in grouping processes that resemble each other in their features (i.e., burst times, weights, and NCS). Each cluster is assigned a time slice proportional to its weight, and every process in this cluster receives this amount of time for its execution in the current round. The features will be updated in the subsequent rounds. In addition, the proposed algorithm gives processes that are close to completion a chance to complete execution and leave; this in turn helps in reducing number of processes in the ready queue and reducing NCS. The proposed algorithm was compared with five common algorithms from the point of view of average waiting, turnaround times, and NCS. The proposed algorithm outperformed all the others; however, it behaves somewhat similar to ADRR in NCS.
In cloud-computing systems, achieving optimality in scheduling processes over computing nodes is an important aim for all researchers interested in both cloud and scheduling, where the available resources must be scheduled using an efficient CPU scheduler to be assigned to clients. The relation between CSP (cloud service providers) and CSC (cloud service consumers) is formalized through service level agreement (SLA). CSP must achieve best performance through minimizing time cost. Because of the superiority of the proposed algorithm over the compared algorithms in all the datasets, the proposed algorithm in this work is promising for cloud computing systems.

Author Contributions

Conceptualization, formal analysis, methodology, and writing—original draft, S.M.M. The research work was carried out under the supervision of H.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Acknowledgments

The authors thank the anonymous reviewers for their careful reading of our paper and their many insightful comments and suggestions.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Table A1. Running times comparison between the proposed algorithm and five scheduling algorithms.
Table A1. Running times comparison between the proposed algorithm and five scheduling algorithms.
DatasetProposedPWRRVTRRBRRSRRADRR
10.040.010.010.0170.0080.01
20.0420.010.010.0180.0080.01
30.0420.0120.0110.0180.0090.011
40.0460.020.0210.0220.010.02
50.0480.020.0210.0230.0110.02
60.050.0210.0220.0230.0110.021
70.050.020.0220.0250.0120.022
80.060.0240.0240.0270.0130.024
90.0620.0260.0250.0270.0130.025
Table A2. Average waiting time and turnaround time comparison between the proposed algorithm and five scheduling algorithms.
Table A2. Average waiting time and turnaround time comparison between the proposed algorithm and five scheduling algorithms.
DatasetProposedPWRRVTRRBRRSRRADRR
WTTTNCSWTTTNCSWTTTNCSWTTTNCSWTTTNCSWTTTNCS
1398.41538.61124450.85591.05141485.90626.10124467.60607.80306485.90626.10124485.9626.1124
2552.37660.44140605.22713.28154653.27761.33144622.20730.27341653.27761.33144625.933734139
3704.30795.40156760.63851.73169812.35903.45160779.50870.60371812.35903.45160778.3869.4154
4852.07932.59171918.54999.06182968.241048.76175943.521024.04401968.241048.76175935.361015.88169
51004.371077.631851078.261151.531951125.671198.931901107.801181.074301125.671198.931901094.771168.03184
61154.231222.001991236.421304.202101280.571348.342051254.311322.094551280.571348.342051222.971290.74194
71275.341338.612101356.381419.652201423.531486.802191388.581451.854791423.531486.802191341.851405.13204
81383.721443.232211468.751528.262301533.091592.602291498.911558.424991533.091592.602291454.761514.27214
91487.441543.742281575.991632.292381637.481693.782391605.921662.225191637.481693.782391563.621619.92224
Average979.141061.36181.561050.111132.34193.221102.231184.45187.221074.261156.48422.331102.231184.45187.221055.941138.16178.44
Improvement% 6.766.275.8711.1710.392.858.858.2356.9311.1710.392.857.276.75−1.74
Table A3. Improvement percentages of the proposed algorithm over five scheduling algorithms.
Table A3. Improvement percentages of the proposed algorithm over five scheduling algorithms.
PWRRVTRRBRRSRRADRR
WTTTNCSWTTTNCSWTTTNCSWTTTNCSWTTTNCS
111.638.8712.0618.0113.970.0014.8011.3859.4818.0113.970.0018.0113.970.00
28.737.419.0915.4513.252.7811.229.5658.9415.4513.252.7811.7510.02−0.72
37.416.617.6913.3011.962.509.658.6457.9513.3011.962.509.518.51−1.30
47.246.656.0412.0011.082.299.698.9357.3612.0011.082.298.908.20−1.18
56.856.425.1310.7810.122.639.348.7656.9810.7810.122.638.267.74−0.54
66.656.305.249.879.372.937.987.5756.269.879.372.935.625.33−2.58
75.975.714.5510.419.974.118.167.8056.1610.419.974.114.964.73−2.94
85.795.563.919.749.383.497.687.3955.719.749.383.494.884.69−3.27
95.625.424.209.168.864.607.387.1356.079.168.864.604.874.70−1.79

References

  1. Chandiramani, K.; Verma, R.; Sivagami, M. A Modified Priority Preemptive Algorithm for CPU Scheduling. Procedia Comput. Sci. 2019, 165, 363–369. [Google Scholar] [CrossRef]
  2. Rajput, I.S.; Gupta, D. A Priority based Round Robin CPU Scheduling Algorithm for Real Time Systems. J. Adv. Eng. Technol. 2012, 1, 1–11. [Google Scholar]
  3. Reddy, M.R.; Ganesh, V.; Lakshmi, S.; Sireesha, Y. Comparative Analysis of CPU Scheduling Algorithms and Their Optimal Solutions. In Proceedings of the 2019 3rd International Conference on Computing Methodologies and Communication (ICCMC), Erode, India, 27–29 March 2019; pp. 255–260. [Google Scholar] [CrossRef]
  4. Silberschatz, A.; Galvin, P.B.; Gagne, G. Operating System Concepts, 10th ed.; Wiley Publ.: Hoboken, NJ, USA, 2018. [Google Scholar]
  5. Sunil, J.G.; Anisha Gnana, V.T.; Karthija, V. Fundamentals of Operating Systems Concepts; Lambert Academic Publications: Saarbrucken, Germany, 2018. [Google Scholar]
  6. Silberschatz, A.; Gagne, G.B.; Galvin, P. Operating Systems Concepts, 9th ed.; Wiley Publ.: Hoboken, NJ, USA, 2012. [Google Scholar]
  7. McGuire, C.; Lee, J. The Adaptive80 Round Robin Scheduling Algorithm. Trans. Eng. Technol. 2015, 243–258. [Google Scholar]
  8. Wilmshurst, T. Designing Embedded Systems with PIC Microcontrollers; Elsevier BV: Amsterdam, The Netherlands, 2010. [Google Scholar]
  9. Singh, P.; Pandey, A.; Mekonnen, A. Varying Response Ratio Priority: A Preemptive CPU Scheduling Algorithm (VRRP). J. Comput. Commun. 2015, 3, 40–51. [Google Scholar] [CrossRef] [Green Version]
  10. Farooq, M.U.; Shakoor, A.; Siddique, A.B. An Efficient Dynamic Round Robin algorithm for CPU scheduling. In Proceedings of the 2017 International Conference on Communication, Computing and Digital Systems (C-CODE), Islamabad, Pakistan, 8–9 March 2017; 2017; pp. 244–248. [Google Scholar] [CrossRef]
  11. Alsulami, A.A.; Abu Al-Haija, Q.; Thanoon, M.I.; Mao, Q. Performance Evaluation of Dynamic Round Robin Algorithms for CPU Scheduling. In Proceedings of the 2019 SoutheastCon, Huntsville, AL, USA, 11–14 April 2019; pp. 1–5. [Google Scholar]
  12. Singh, A.; Goyal, P.; Batra, S. An optimized round robin scheduling algorithm for CPU scheduling. Int. J. Comput. Sci. Eng. 2010, 2, 2383–2385. [Google Scholar]
  13. Shafi, U.; Shah, M.; Wahid, A.; Abbasi, K.; Javaid, Q.; Asghar, M.; Haider, M. A Novel Amended Dynamic Round Robin Scheduling Algorithm for Timeshared Systems. Int. Arab. J. Inf. Technol. 2019, 17, 90–98. [Google Scholar] [CrossRef]
  14. Garrido, J.M. Performance Modeling of Operating Systems Using Object-Oriented Simulation, 1st ed.; Series in Computer Science; Springer US: New York, NY, USA, 2002. [Google Scholar]
  15. Tajwar, M.M.; Pathan, N.; Hussaini, L.; Abubakar, A. CPU Scheduling with a Round Robin Algorithm Based on an Effective Time Slice. J. Inf. Process. Syst. 2017, 13, 941–950. [Google Scholar] [CrossRef] [Green Version]
  16. Saidu, I.; Subramaniam, S.; Jaafar, A.; Zukarnain, Z.A. Open Access A load-aware weighted round-robin algorithm for IEEE 802. 16 networks. EURASIP J. Wirel. Commun. Netw. 2014, 1–12. [Google Scholar]
  17. Mostafa, S.M.; Amano, H. An Adjustable Round Robin Scheduling Algorithm in Interactive Systems. Inf. Eng. Express 2019, 5, 11–18. [Google Scholar]
  18. Mostafa, S.M.; Rida, S.Z.; Hamad, S.H. Finding Time Quantum of Round Robin CPU Scheduling Algorithm in General Computing Systems Using Integer Programming. Int. J. New Comput. Archit. Appl. 2010, 5, 64–71. [Google Scholar]
  19. Mostafa, S.M. Proportional Weighted Round Robin: A Proportional Share CPU Scheduler in Time Sharing Systems. Int. J. New Comput. Arch. Appl. 2018, 8, 142–147. [Google Scholar] [CrossRef]
  20. Lasek, P.; Gryz, J. Density-based clustering with constraints. Comput. Sci. Inf. Syst. 2019, 16, 469–489. [Google Scholar] [CrossRef] [Green Version]
  21. Lengyel, A.; Botta-Dukát, Z. Silhouette width using generalized mean—A flexible method for assessing clustering efficiency. Ecol. Evol. 2019, 9, 13231–13243. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  22. Starczewski, A.; Krzyżak, A. Performance Evaluation of the Silhouette Index BT. In Artificial Intelligence and Soft Computing; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2015; Volume 9120, pp. 49–58. [Google Scholar]
  23. Al-Dhaafri, H.; Alosani, M. Closing the strategic planning and implementation gap through excellence in the public sector: Empirical investigation using SEM. Meas. Bus. Excel. 2020, 35–47. [Google Scholar] [CrossRef]
  24. Xu, D.; Tian, Y. A Comprehensive Survey of Clustering Algorithms. Ann. Data Sci. 2015, 2, 165–193. [Google Scholar] [CrossRef] [Green Version]
  25. Wu, J. Cluster Analysis and K-means Clustering: An Introduction; Springer Science and Business Media LLC: Berlin, Germany, 2012; pp. 1–16. [Google Scholar]
  26. Yuan, C.; Yang, H. Research on K-Value Selection Method of K-Means Clustering Algorithm. J. Multidiscip. Sci. J. 2019, 2, 16. [Google Scholar] [CrossRef] [Green Version]
  27. Guan, C.; Yuen, K.K.F.; Coenen, F. Particle swarm Optimized Density-based Clustering and Classification: Supervised and unsupervised learning approaches. Swarm Evol. Comput. 2019, 44, 876–896. [Google Scholar] [CrossRef]
  28. Mostafa, S.M.; Amano, H. Effect of clustering data in improving machine learning model accuracy. J. Theor. Appl. Inf. Technol. 2019, 97, 2973–2981. [Google Scholar]
  29. Kassambara, A. Practical Guide to Cluster Analysis in R: Unsupervised Machine Learning; CreateSpace Independent Publishing Platform: Scotts Valley, CA, USA, 2017. [Google Scholar]
  30. Inyang, U.G.; Obot, O.O.; Ekpenyong, M.E.; Bolanle, A.M. Unsupervised Learning Framework for Customer Requisition and Behavioral Pattern Classification. Mod. Appl. Sci. 2017, 11, 151. [Google Scholar] [CrossRef] [Green Version]
  31. Liu, Y.; Li, Z.; Xiong, H.; Gao, X.; Wu, J. Understanding of Internal Clustering Validation Measures. In Proceedings of the 2010 IEEE International Conference on Data Mining, Sydney, Australia, 13–17 December 2010; Institute of Electrical and Electronics Engineers (IEEE): Sydney, Australia; pp. 911–916. [Google Scholar]
  32. Harwood, A.; Shen, H. Using fundamental electrical theory for varying time quantum uni-processor scheduling. J. Syst. Arch. 2001, 47, 181–192. [Google Scholar] [CrossRef]
  33. Helmy, T. Burst Round Robin as a Proportional-Share Scheduling Algorithm. Proceedings of The Fourth IEEE-GCC Conference on Towards Techno-Industrial Innovations, Bahrain, Manama, 11–14 November 2007; pp. 424–428. [Google Scholar]
  34. Datta, L. Efficient Round Robin Scheduling Algorithm with Dynamic Time Slice. Int. J. Educ. Manag. Eng. 2015, 5, 10–19. [Google Scholar] [CrossRef]
  35. Zouaoui, S.; Boussaid, L.; Mtibaa, A. Improved time quantum length estimation for round robin scheduling algorithm using neural network. Indones. J. Electr. Eng. Inform. 2019, 7, 190–202. [Google Scholar]
  36. Pandey, A.; Singh, P.; Gebreegziabher, N.H.; Kemal, A. Chronically Evaluated Highest Instantaneous Priority Next: A Novel Algorithm for Processor Scheduling. J. Comput. Commun. 2016, 4, 146–159. [Google Scholar] [CrossRef] [Green Version]
  37. Srinivasu, N.; Balakrishna, A.S.V.; Lakshmi, R.D. An Augmented Dynamic Round Robin CPU. J. Theor. Appl. Inf. Technol. 2015, 76. [Google Scholar]
  38. El Mougy, S.; Sarhan, S.; Joundy, M. A novel hybrid of Shortest job first and round Robin with dynamic variable quantum time task scheduling technique. J. Cloud Comput. 2017, 6, 1–12. [Google Scholar] [CrossRef] [Green Version]
Figure 1. Organization of the paper.
Figure 1. Organization of the paper.
Applsci 10 05134 g001
Figure 2. Algorithm flowchart.
Figure 2. Algorithm flowchart.
Applsci 10 05134 g002
Figure 3. Finding optimal number of clusters.
Figure 3. Finding optimal number of clusters.
Applsci 10 05134 g003
Figure 4. Comparing algorithms’ time cost.
Figure 4. Comparing algorithms’ time cost.
Applsci 10 05134 g004
Figure 5. Comparing algorithms’ NCS.
Figure 5. Comparing algorithms’ NCS.
Applsci 10 05134 g005
Figure 6. Improvement percentage of the proposed algorithm over the compared algorithms.
Figure 6. Improvement percentage of the proposed algorithm over the compared algorithms.
Applsci 10 05134 g006
Table 1. Summarization of traditional clustering algorithms categories.
Table 1. Summarization of traditional clustering algorithms categories.
Typical Clustering AlgorithmBased on (Category)
K-medoids, CLARA, CLARANS, PAM, K-meansPartition
Chameleon, ROCK, CURE, BIRCHHierarchy
MM, FCS, FCMFuzzy theory
GMM, DBCLASDDistribution
Mean-shift, OPTICS, DBSCANDensity
MST, CLICKGraph theory
CLIQUE, STINGGrid
FCFractal theory
ART, SOM, GMM, COBWEB,Model
Table 2. Comparison of common versions of Round Robin (RR) (WT is acronym for waiting time, TT is acronym for turnaround time).
Table 2. Comparison of common versions of Round Robin (RR) (WT is acronym for waiting time, TT is acronym for turnaround time).
ResearchersYearTechnique NameTechnique TypeBased onPerformance Metrics
WTTTNCS
Aaron and Hong2001VTRRDynamicSRR
Tarek and Abdelkader2007BRRDynamicSRR
Samih et al.2010CTQDynamicSRR
Lipika Datta2015-DynamicSRR and SJF
Christoph and Jeonghw2015Adaptive80 RRDynamicSRR and SJF
Samir et al.2017SRDQDynamicSRR and SJF
Samih2018PWRRDynamicSRR
Samih and Hirofumi2019ARRDynamic based on thresholdSRR
Uferah et al.2020ADRRDynamicSRR and SJF
Table 3. Dataset_1.
Table 3. Dataset_1.
BTWeightNCS
01090.07774610
11500.1069915
230.002140
3500.0356634
440.034954
5490.034954
64090.29172648
74900.34950148
8470.0335244
9460.032814
Table 4. Clustered dataset_1.
Table 4. Clustered dataset_1.
BTWeightNCSy
01090.077746100
11500.10699150
230.0021400
3500.03566340
4490.0349540
5490.0349540
64090.291726481
74900.349501481
8470.03352440
9460.0328140
Table 5. Four processes with the length of the burst time.
Table 5. Four processes with the length of the burst time.
Process IDBT
P115
P210
P331
P417
Table 6. Assigning time slice for the running processes in each round.
Table 6. Assigning time slice for the running processes in each round.
Round 1Round 2Round 3Round 4
Process IDBTTSRBTTSRBTTSRBTTS
P1157812.5
terminates after 8 tu
------------
P21010
terminates
------------------
P33142742341919
P4176119250 terminates after 2 tu------
Table 7. Datasets specifications. The first column presents the dataset ID, the second column presents the number of processes in each dataset, the third column presents the number of attributes (i.e., BT, PW, and NCS), and the forth column presents the standard deviations.
Table 7. Datasets specifications. The first column presents the dataset ID, the second column presents the number of processes in each dataset, the third column presents the number of attributes (i.e., BT, PW, and NCS), and the forth column presents the standard deviations.
Dataset IDNumber of ProcessesNumber of AttributesStandard Deviation
1103160.2615
215383.1789
3203123.5103
4253112.4794
5303103.9525
635397.17821
740391.67769
845387.08785
950383.1789

Share and Cite

MDPI and ACS Style

Mostafa, S.M.; Amano, H. Dynamic Round Robin CPU Scheduling Algorithm Based on K-Means Clustering Technique. Appl. Sci. 2020, 10, 5134. https://doi.org/10.3390/app10155134

AMA Style

Mostafa SM, Amano H. Dynamic Round Robin CPU Scheduling Algorithm Based on K-Means Clustering Technique. Applied Sciences. 2020; 10(15):5134. https://doi.org/10.3390/app10155134

Chicago/Turabian Style

Mostafa, Samih M., and Hirofumi Amano. 2020. "Dynamic Round Robin CPU Scheduling Algorithm Based on K-Means Clustering Technique" Applied Sciences 10, no. 15: 5134. https://doi.org/10.3390/app10155134

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop