Simulate and visualize Shortest Job First CPU scheduling algorithm to understand how processes are executed based on their burst time.
Shortest Job First (SJF) is a CPU scheduling algorithm that selects the process with the smallest execution time first. SJF is optimal in terms of average waiting time for a given set of processes, but it requires knowledge of the CPU burst time in advance. The non-preemptive version of SJF will let a process run to completion once it starts execution.
Processes arrive at the system at their respective arrival times and are placed in a ready queue.
From the available processes in the ready queue, the process with the shortest burst time is selected for execution.
The selected process executes until completion. Once finished, the CPU is assigned to the next process with the shortest burst time among those available.
After all processes complete execution, metrics like average waiting time and average turnaround time are calculated to evaluate the scheduler's performance.