Introduction
Creation of Scheduling/timetable for bigger educational institutions is a time-consuming process and has more complexities in solving the scheduling process. In this article, I will explain how to create a scheduling with C#.
Pre-Requisite Data for processing the flow
The following fields are required from the end-user for processing the flow
- Number of Classes
- Working Days Per Week
- Hours Per Day
- Hours Per Week
- Subjects Per Class
- Weekly Subjects Per Class
- Number of Teachers
Step 1:
Create a 3D array as,
Step 2
In the pre-requisite Data section, the Days in a week may have 6 Days (i.e. 6 X 7 Hours per day = 42 Hours). But in some cases, the hours may be limited to 4 hours on last / 6th Day (i.e 39 Hours). In the below step, the remaining values in the Array Variable are set as '-1'.
Step 3
In this step, the below code will store the subject values in the array variable. Here, in the first loop, the values for the third dimension of the array variable will be stored randomly for the first run of second dimension of the array variable. And the process will continue until all subjects have been added for all classes. While storing the values, the below step will check the previous and next hour values to avoid repetition of classes.
Step 4
Once the allocation of subjects has been completed, the below step will allocate the weekly subjects for all classes.
Finally generated result will be stored in the table 'TimeTable'.