This repository contains two main components:
- CPU Scheduling Algorithms: Core implementations of CPU scheduling algorithms (without UI).
- CPU Scheduling App with UI: An interactive application for visualizing and running CPU scheduling algorithms, combining both the algorithms and a graphical user interface (GUI).
- Supported Algorithms:
- First-Come First-Served (FCFS)
- Shortest Job First (SJF)
- Shortest Remaining Time First (SRTF)
- Priority Scheduling
- Round Robin (RR)
- Interactive UI:
- Add processes dynamically.
- Visualize the Gantt Chart for each scheduling algorithm.
- Error handling for invalid inputs.
- Standalone Core Algorithms:
- The
cpu_scheduling_algorithms.pyfile contains the core implementations of scheduling algorithms, independent of the GUI.
- The
- Integrated Application:
- The
cpu_scheduling_app.pyfile combines the algorithms and an interactive UI in a single application.
- The
- Clone the repository:
git clone https://github.com/mohamedyounis10/cpu-scheduling-app.git cd cpu-scheduling-app - Install dependencies:
pip install customtkinter matplotlib pillow
- Run the GUI application:
python cpu_scheduling_app.py
You can use the core algorithms independently by importing them from the cpu_scheduling_algorithms.py file. Example:
from cpu_scheduling_algorithms import FCFS, ProcessAttributes
processes = [
ProcessAttributes(pid="P1", BurstTime=5, ArrivalTime=0),
ProcessAttributes(pid="P2", BurstTime=3, ArrivalTime=2),
ProcessAttributes(pid="P3", BurstTime=8, ArrivalTime=4),
]
result = FCFS(processes)
print(result) # Output: [("P1", 0, 5), ("P2", 5, 8), ("P3", 8, 16)]- Launch the application and add processes by filling out the fields for Process ID, Burst Time, Arrival Time, and optionally Priority/Time Quantum.
- Select a scheduling algorithm.
- Click "Run Algorithm" to visualize the Gantt Chart.
- cpu_scheduling_app.py: The main file for the GUI application that combines the scheduling algorithms and an interactive UI.
- cpu_scheduling_algorithms.py: Contains core implementations of scheduling algorithms, designed to be used independently of any GUI.
- images/: Directory for screenshots and other assets.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Feel free to submit a pull request or open an issue to suggest improvements or report bugs.
Created by Mohamed Younis.

