Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Investigation of the Course- Section Assignment Problem Assoc. Prof. Zeki Bayram Eastern Mediterranean University T.R.N.Cyprus.

Similar presentations


Presentation on theme: "An Investigation of the Course- Section Assignment Problem Assoc. Prof. Zeki Bayram Eastern Mediterranean University T.R.N.Cyprus."— Presentation transcript:

1 An Investigation of the Course- Section Assignment Problem Assoc. Prof. Zeki Bayram Eastern Mediterranean University T.R.N.Cyprus

2 Problem Specification Student registration period Students should be registered to courses with the minimal number of conflicts For a specific student, courses to be taken are known. Meeting times of course-sections also known. Need to decide on which sections to register with the minimum number of clashes

3 Problem Specification Student/advisor preferences also play a role Course-section assignment problem: given the courses the student should take, generate schedules for the student, in increasing order of the number of conflicts each schedule contains, up to a specified maximum Student and his advisor can then choose one they prefer (semi-automated)

4 Computational Complexity Scheduling problems which are decision problems, of a similar nature, are NP- complete Our problem is a function problem, rather than a decision problem – enumeration, given as input courses, and section information about courses Conjecture: Related decision problem “Is it possible to schedule n courses with at most k conflicts” is NP-complete.

5 Proposed Algorithm – high level i = 0 Repeat Generate all schedules with exactly i conflicts i  i + 1 Until the desired number of schedules have been generated

6 Algorithm Issues Finding schedules at a given level done through backtracking search Search space pruned if the total number of conflicts already exceed the currently allowed level Implemented as a Javascript program and runs in the Web browser’s JavaScript engine

7 Web application – data entry page

8 Web application – Results page

9 Formal Problem Specification Definition 1. A meeting-time is a day-period pair, such as, meaning the third period (i.e. 10:30) on Monday. Definition 2. The function rep(D,P) is defined as (val(D) ∗ 8)+P, where is a meeting-time, val(Monday) = 0, val(Tuesday) = 1, val(Wednesday) =2, val(Thursday) = 3 and val(Friday) = 4. rep(D, P) is a unique integer representation of a meeting-time.

10 Formal Problem Specification Definition 3. A course-section assignment is a function that maps a course to one of its sections. Definition 4. The function meetingTimes(C,S) returns the set of meeting times (represented as integers) of section S of course C. In other words, x ∈ meetingT imes(C, S) iff is a meeting-time of section S of course C and x = rep(D, P).

11 Formal Problem Specification Definition 5. The function nconf(assign) takes a course-section assignment as an argument and returns the number of conflicts it contains. Specifically, let be a list of courses and assign be a course-section assignment. nconf(assign) is defined as | meetingT imes(assign(C 1 )) |+... +|meetingTimes(assign(C n )) | − |meetingT imes(assign(C 1 )) ∪... ∪ meetingTimes(assign(C n ))|

12 Formal Problem Specification Definition 6. Given a list of courses, the course-section assignment problem (CSAP) is to generate a sequence of course-section assignments in such a way that every assignment appears exactly once in the sequence, and if ass i comes before ass j in the sequence, then nconf(ass i ) ≤ nconf(ass j ).

13 Algorithm in Pseudo-Code

14 Input to the Algorithm C, the maximum number of conflicts that can be tolerated. List of courses course 1, course 2,..., course L for which we need to find schedules with at most C conflicts. K, the number of sections per course. The function meetingTimes(i, j) that gives the bitmap for course i, section j. maxSolutions, the maximum number of solutions that should be generated

15 Output of the Algorithm All combinations of course sections such that the number of conflicts does not exceed C and solutions are generated in increasing order of the number of conflicts they contain, up to a maximum of max solutions solutions

16 Algorithm (part 1) declare current as an array[0..L] of bitmaps declare nc as an array[0..L] of integer declare next as an array[1..L +1] of integer declare result as an array[1..L] of integer ns ← 0 // number of solutions generated so far for c ← 0 to C i ← 1 // the next course to process next[1] ← 1 // section 1 of course 1 to be processed first current[0] ← (000000...) // bitmap of forty zeroes nc[0] ← 0 // initial node contains no conflicts

17 Algorithm (part 2) loop if ns > max solutions then exit program end if if i = 0 then exit loop end if if next[i]> K then i ← i − 1 continue loop end if if i = L + 1 then if c = nc[i − 1] then print the result array ns ← ns + 1 end if i ← i −1 // backtrack continue loop end if

18 Algorithm (part 3) newConflicts ← countOnes(meetingTimes(i, next[ i ])  current[i − 1]) if (newConflicts + nc[i − 1]) ≤ c then nc[i] ← nc[i − 1] + newConflicts current[i] ← current[ i − 1 ]  meetingTimes(i, next[ i ]) result[ i ] ← next[ i ] next[ i ] ← next[ i ] + 1 next[ i +1 ] ← 1 i ← i + 1 continue loop end if next[ i ] ← next[ i ] + 1 end loop end for

19 Implicit Tree traversed by the algorithm Level 0 000000 Level 1 (A, section 1) 111000 Level 2 (B, section 1) 111010 Level 2 (B, section 2) 111010 Level 2 (B, section 3) 111010 Level 1 (A, section 2) 110110 Level 2 (B, section 1) 111110 Level 2 (B, section 2) 110111 Level 2 (B, section 3) 110110 Level 1 (A, section 3) 000111 Level 2 (B, section 1) 101111 Level 2 (B, section 2) 010111 Level 2 (B, section 3) 101111

20 Algorithm Complexity – Worst Case Number of nodes visited by the algorithm an accurate measure of its time complexity In the implicit tree traversed by the algorithm:  Level of the root = 0  Level of the leaf nodes = N  Branching factor (number of sections of a course) = K  Number of nodes in the tree =

21 Algorithm Complexity – Worst case C = Maximum number of conflicts that are tolerated Algorithm makes C+1 passes over the implicit tree Number of nodes visited in tree tree by the algorithm =

22 Algorithm Complexity – Average Case Notation: P(Y@L b ) = probability that a node at level b with exactly Y conflicts is visited c’ = Maximum number of conflicts we can tolerate in a specific iteration of the algorithm Given c’, the expected number of nodes visited by the algorithm if we can tolerate c’ or less number of conflicts =

23 Algorithm Complexity – Average case C = Maximum number of conflcits we can tolerate in the solution Average case comlexity for the whole algorithm =

24 Computing P(j@L i ) Base cases P(0@L 0 ) = 1 P(0@L 1 ) = 1 P(j@L0=) = 0 for j > 0 P(j@L1) = 0 for j > 0

25 Computing P(j@L i ) Base cases (cont) R = Number of hours a course is taught in a week P(j@L 2 ) =

26 Computing P(j@L i ) Recursive case Let mean that k new conflicts are introduced when going from a node at level i-1 to a node at level i. Let mean the probability of introducing k new conflicts when going from a node at level i-1 to a node at level i, if there are already e conflicts at the node at level i-1.

27 Computing P(j@L i ) Recursive case For i>2, we have where

28 Explanation R is the number of hours per week each course is taught. At level i-1, we have alrady allocated sections to i-1 courses. Since they have e conflicts, (i-1)R-e slots (out of 40) are already taken.To go to the next level node, k slots of the new course must coincide with already taken slots at level i-1, and R-k slots must coincide with the free slots at level i-1.

29 Explanation is just all possible ways of choosing R slots from 40 slots.

30 Conclusion We defined formally the course-section assignment problem We proposed an algorithm for it We investigated the time-complexity of the algorithm using a probabilistic approach We showed a Web application that implements the algorithm

31 Future Work Investigating the applicability of the proposed algorithm to similar scheduling problems Adapting the probabilistic approach for computing the the average-case complexity of the algorithm to other scheduling algorithms

32 References http://cmpe.emu.edu.tr/bayram/VRegistration/ form.asp http://cmpe.emu.edu.tr/bayram/VRegistration/ form.asp


Download ppt "An Investigation of the Course- Section Assignment Problem Assoc. Prof. Zeki Bayram Eastern Mediterranean University T.R.N.Cyprus."

Similar presentations


Ads by Google