Now, we want to have an examination after some period.
In the examination, each student will give a paper for the subject s/he is registered.
We have some limited number of days during which all the students of a given course will be giving papers at the same time. And we have more than one courses, and we want to take the papers of all courses.
- A student can’t give more than one papers at the same day/time.
- All the students in a course will give the paper for the course at the same time.
- Students of two courses can give their papers at the same time only if there is no student registered in both courses. This means, both courses have no common students.
There can be other conditions, depending on the institution and type of examination. But the above conditions are the basic conditions. One extra requirement which can arise is: How to arrange all the papers in minimum possible days, while satisfying the above conditions? First lets focus on simple datesheet making (arranging of papers).
How to build a datesheet?
- Make a list of courses, while each course will contain a list of students registered in it.
- Lets have a list of days, while each day will contain the list of courses whose papers will be arranged on that day.
- Let current-day is the first day.
- Get one course and add it to the current-day.
- Get an other course, call it current-course.
- If no student in the current-course has a course in the current-day-courses, then add the current-course to the current day. This will be a little hard to grasp and implement but this is the main step. This step will ensure that the 1st condition is satisfied.
- Else skip the course.
- Go to step 5.
- If there is no course left with no student in the current-day courses (in other words: all courses left have students with at least one course registered in the courses in the current day), then add another day to the days list and call it the current day, and then go to step 4.
- If all there is no course left (all courses are added to days in the days-list), then save the days along with the courses in each day and call it the datesheet, and terminate.
This is how to build a simple datesheet.