• Tidak ada hasil yang ditemukan

Low-level Construction heuristics

Chapter 7 A Genetic Algorithm Approach using a Direct Representation

7.2 Initial population creation

7.2.4 The sequential construction method (SCM)

7.2.4.1 Low-level Construction heuristics

The following sections describe the low-level construction heuristics that will be used to select tuples to allocate to the timetable. These construction heuristics can be used as primary or secondary heuristics. A primary heuristic is the first heuristic that is used to choose between tuples. Secondary heuristics are used as tie breakers.

Random Allocation

When using this heuristic, a tuple is randomly chosen from the list and is allocated to the timetable. In Table 7.3, any of the tuples could be chosen first. The random heuristic is applied continuously until all tuples have been placed in the timetable.

Largest degree

This heuristic gives priority to the tuple with the most number of lessons. In Table 7.1 above, meeting number 3 has the most occurrences (7 lessons). Any one of the seven tuples from meeting number 3 will then be allocated to a period in the timetable. As a result of the allocation, the number of lessons left to allocate for meeting number 3 is reduced by one

(from 7 to 6). The remaining list of tuples still to be allocated is then resorted and the next tuple with the most lessons is allocated to the timetable. This continues until all tuples have been allocated.

Consecutive periods

Priority in terms of allocation is given to the tuples that must be allocated as double periods.

In Table 7.1, meeting number 1 has a double period requirement so tuples corresponding to this meeting are given priority and two of the four tuples are allocated to the timetable. One of these tuples is allocated to a period in the timetable and the other is placed in an adjacent position either above or below the first allocation. If a double period tuple cannot be accommodated, then it must be split into two single period tuples (if specified as a constraint, then this will adversely affect the cost of the timetable).

Co-teaching and subclasses

In a co-teaching or subclass heuristic, priority is given to tuples that include multiple classes that form several subgroups or a single class that is split into two or more groups. These tuples are added to the timetable first to ensure that all subclass or co-teaching requirements are met.

Session priority

Tuples containing resources that must be allocated to specific periods of the day are given priority when being scheduled. This is done to allow these tuples to be allocated to their required periods before any other tuples (with no session priority) can be placed in those periods.

Teacher degree

When using this heuristic, priority is given to tuples with teachers that have to teach the most number of lessons. All tuples related to this teacher then get preference and one of these tuples is then allocated to the timetable.

Class degree

This is similar to the teacher degree where priority is given to the tuples involving the class with the most lessons. For example, higher grades that have 45 lessons in the week are given priority over lower grades that have 33 lessons in a week. Therefore the tuples that involve the higher grades are allocated first (if given priority), followed by the tuples involving the lower grades.

Number of available days

The tuples involving the teacher with the least number of days get priority and one of these tuples is then allocated to the timetable. For example, Teacher A, who is only available for two days in the week, is given a higher priority than teacher B who is available for five days

in a week. Therefore, the tuples involving teacher A are allocated before the tuples involving teacher B.

Saturation degree

The saturation degree heuristic, used by Carter [CART96] in examination timetabling, involves calculating the number of feasible periods available for each tuple. A feasible period is one that does not result in any hard constraint violations upon allocating the tuple to it. Priority is given to the tuple with the least number of feasible periods available. The tuples are allocated to periods in the timetable in this order, potentially reducing the number of violations when the timetable is populated. An example is shown in Table 7.4 (this table is similar but not related to Table 7.3).

Table 7.4: Tuple list with saturation degree

Meeting No Teacher Class Venue Double (1)

/Single (0)

Saturation Degree

1 A 10b 12 0 30

1 A 10b 12 0 30

1 A 10b 12 0 30

1 A 10b 12 0 30

2 B 12c 13 0 30

2 B 12c 13 0 30

2 B 12c 13 0 30

3 A 5d 4 0 30

3 A 5d 4 0 30

3 A 5d 4 0 30

3 A 5d 4 0 30

3 A 5d 4 0 30

3 A 5d 4 0 30

3 A 5d 4 0 30

4 D 10b 1 0 30

4 D 10b 1 0 30

4 D 10b 1 0 30

4 D 10b 1 0 30

4 D 10b 1 0 30

4 D 10b 1 0 30

5 C 12c 12 0 30

5 C 12c 12 0 30

5 C 12c 12 0 30

5 C 12c 12 0 30

Initially, all tuples have the same saturation degree (i.e. the number of periods) as the timetable is empty. The first tuple found is placed in the minimum penalty timeslot in the timetable as illustrated in Table 7.5 below, and removed from the tuple list.

Table 7.5: Timetable with tuple added

5d … 10b … 12c

1 2

3 A: 12

4 5 6

The saturation degree for each tuple is revised, leaving any tuples involving class 10b or teacher A or venue 12 with one less available space in the timetable. The revised table with the new saturation degree values is shown in Table 7.6.

Table 7.6: Tuple list with updated saturation degree

Meeting No Teacher Class Venue Double/Single Saturation

Degree

1 A 10b 12 1 29

1 A 10b 12 1 29

1 A 10b 12 1 29

2 B 12c 13 1 30

2 B 12c 13 1 30

2 B 12c 13 1 30

3 A 5d 4 1 29

3 A 5d 4 1 29

3 A 5d 4 1 29

3 A 5d 4 1 29

3 A 5d 4 1 29

3 A 5d 4 1 29

3 A 5d 4 1 29

4 D 10b 1 1 29

4 D 10b 1 1 29

4 D 10b 1 1 29

4 D 10b 1 1 29

4 D 10b 1 1 29

4 D 10b 1 1 29

5 C 12c 12 1 29

5 C 12c 12 1 29

5 C 12c 12 1 29

5 C 12c 12 1 29

Once a tuple has been allocated, the saturation degree is updated. Priority is given to tuples with the lowest saturation degree. As shown in the example in Table 7.6 above, after allocation all tuples containing class 10b, teacher A or venue 12 now have 29 available periods that will not result in hard constraint violations. The tuples containing other teachers and venues are not affected. During the next iteration of the allocation process, all tuples with a saturation degree of 29 are given priority and one of these tuples (chosen using secondary heuristics) will be allocated to the timetable. This process continues until all tuples have been allocated to the timetable.