Comparison of Performance between Different Selection Strategies on

0 downloads 0 Views 599KB Size Report
a GA when different selection strategies: roulette wheel selection, rank selection, and tournament selection, are applied. A good selection strategy tries to keep ...
Comparison of Performance between Different Selection Strategies on Genetic Algorithm with Course Timetabling Problem Wutthipong Chinnasri

Nidapan Sureerattanan

Department of Computer Education

Department of Computer Education

King Mongkut's University of Technology

King Mongkut's University of Technology

North Bangkok, Thailand

North Bangkok, Thailand

[email protected]

[email protected]

Abstract-Course timetabling is an NP-hard problem. There

algorithm and implementation. The simulation results are

are many factors to be considered. A GA is suitable for NP­

represented in section IV. Finally conclusion and future work are presented in section V.

hard and optimization problems and it can also be applied to various problems. Three main operators of GA are selection,

II.

crossover, and mutation. This paper compares performance on a

GA when different selection strategies:

roulette

wheel

The specific problem we used in this paper comes from the Rangsit University, Pathumthani, Thailand, and involves

selection, rank selection, and tournament selection, are applied.

A good selection strategy tries to keep good solutions and leave

the weekly timetable of all subjects of the Department of Information Management.

the bad ones out of a population. The experimental result demonstrates that GA with roulette wheel selection works

The problem data consists of subjects with a fixed number of students and to be taught by a specific lecturer,

more efficient than the others for producing feasible course timetables.

Keywords-selection timetabling;

strategies;

genetic

algorithm;

PROBLEM DESCRIPTION

classrooms with a fixed capacity and type of classroom (lecture or lab), and timeslot with a fixed number of study

course

days in a week (typically 5 or

6). Especially in this problem,

there are 3 study days in a week (Monday to Wednesday) because it is constraints of the department. Each day is equally split in a fixed number of timeslots.

INTRODUCTION

I.

The course timetabling is a common problem in all educational institutions. It is well known that timetabling

Many things have to be considered in order to assign a subject to a certain timeslot. These include lecturer's time

problem is very difficult to be solved by general methods because it is an NP-hard problem. This means timetabling

availabilities and room availabilities. Solutions that all subjects are assigned to timeslots with satisfaction of all hard constraints are called feasible solutions.

takes more times to find an optimal solution and the time exponentially increases in accordance with problem size. Many factors including students, classrooms, timeslots, are general considered

in

constraints

are

course

timetabling

usually

divided

problem. into

The hard constraints considered for this problem are shown in Table I.

subjects, lecturers, constraints to be two

The

set

types,

TABLE I.

of

hard

constraints and soft constraints. Hard constraints must be

No

Hard Constraints

I

A lecturer can teach only one subject at a time.

2

A classroom can be used for only one subject at a time.

considered very strictly, because the timetable which violates just one of the hard constraints is unusable while the timetable which violates some soft constraints is still usable but it possibly gets less satisfaction. The GA approach is one of the most popular methods used in automated timetabling [ 1]. It is best suited and

3

Students can study only one subject at a time.

4

Each classroom must have its own availability schedule. A subject must be scheduled in a classroom appropriate for the subject type.

5

widely used for NP-hard and optimization problems [2].

III.

GA's evolution process starts from generate chromosomes to

HARD CONSTRAINTS OF THIS TIMETABLING PROBLEM

THE PROPOSED ALGORITHM AND IMPLEMENTATION

Genetic algorithm is a part of evolutionary algorithm (EA)

be an initial population. New generations of population are created by genetic operation such as selection, crossover, and

that uses techniques of evolutionary biology such as selection, crossover and mutation. It is used to search large,

mutation. A good selection strategy tries to keep good solutions and leave the bad ones out of a population. In this

nonlinear solution space where expert knowledge is lacking or difficult to encode. Moreover it requires no gradient

paper roulette wheel selection, rank selection, and tournament selection are used. This paper proposes to compare performance of different selection strategies.

information evolves from one population to another and produces multiple optima rather than single local one. These

The paper is organized as follows; the next section introduces the university course timetable problem with a set

characteristics make GA a well-suited tool for university course timetable problem [3].

of hard constraints. In section III, we present the proposed

978-1-4244-6932-1110/$26.00 ©2010 IEEE

105

The evolution process starts from generate chromosomes to be an initial population. In each generation genetic operation such as selection, crossover, and mutation will be used to create new chromosomes. Every chromosome from genetic operation will be evaluated by fitness function. Some chromosomes are selected from the current population based

B.

The first step of GA is to initial the first population. Chromosomes in the initial population are generated with all

on their fitness to be a new population in the next iteration of the algorithm. The GA stops if optimum chromosome is

subjects and their lechlrers randomly assigned into timeslots.

found or the algorithm reaches the maximum number of generation. The algorithm is shown in Figure 1.

C.

'�'�\

I

"

(

----.".. 5

CroHO, V"'__

I, �r\1

many hard constraint it has been violated. Fitness value is zero if there is no violation. In case with degrees of violation,

\

less value is better than higher value.

Ii �L...{ I II ,,����

l

r l

Ofhoriul

D.

Ofh_.l

Mtttnion

i : :::: : g: :::: :

Selection Three selection strategies will be compares in this srudy. Roulette wheel selection strategy: select parents

\ 1

'-................................................................................./

Evaluation

Fitness function is used to evaluate chromosomes whether they are feasible and how good they are. In this experiment, each chromosome will be considered that how

tI, � _' � _ ________________ c.en'!tic ?-anion

Initialization

according to their fitness. The better chromosomes are more chances to be selected.

;

Rank selection strategy: similar with roulette wheel selection but the chances to be selected based on rank. Tournament selection strategy: Some chromosomes are randomly selected from the population for enter to the tournament. The number of chosen chromosomes is called tournament size. In each tournament, the chromosome with the best fitness will be selected. Elitism will be applied together with all strategies to prevent losing the best chromosome.

Figure

A.

I.

E. Diagram of Genetic Algorithm.

Encoding

a new offspring. For cycle crossover, gene cycle between two parents will be looked for. It starts with choosing a starting gene in the first parent and sees the gene in same position in second parent. From second parent, finds the

only the efficiency of the GA but also the speed and quality of the final result [4]. A day is divided into 3 timeslots so

same gene in the first parent. The cycle crossover repeats this process until the chosen gene rerum to the first chosen gene

there are totally 9 timeslots for a week as shown in Table II.

Rooml MON

II.

in the first parent. Genes that are included in the cycle will stay, while the others will be swapped between two parents.

TIMESLOTS FOR A ROOM

An example is shown in Figure 2.

15.00-18.00 12.00-15.00 Timeslot 2 Timeslot 3 Timeslot 4 Timeslot 5 TUE Timeslot 6 WED Timeslot7 Timeslot9 Timeslot 8 A permutahon encodmg IS used for problem representation. In this method, chromosome is a sequence of integer values, from 1 to the number of genes, with no missing or repeated number. If a timeslot get a subject, it's gene represents [SubjectID:LecrurerID:SectionID:Subject Year:SubjectType]. For null timeslot, it's gene represents [Free:Number]. Table III shows an example gene. TABLE

09.00-12.00 Timeslot 1

III.

Crossover

Crossover operation randomly selects a couple of chromosomes to exchange their characteristics then produces

Encoding of the chromosomes for the GA model is an essential factor in the success of a GA as it will affect not

TABLE

selection

Par�t a

Offrpti ng

Figure

F.

2.

1

Cycle Crossover

Mutation

Although mutation occurs infrequently in nahlre, it is believed as an important driving force for evolution [5]. For

EXAMPLE FOR THE STRUCTURE OF GENE

a swap mutation, the two different locations of the target chromosome will be randomly selected. Their values will be swap. An example is shown in Figure 3

106

P"",",c

q

111213171415191 Figure

IV.

3.

Po pul ati on Siz e

P"",",c

111215171413191

Swap Mutation.

2

EXPERIMENTAL RESULT AND DISCUSSION

In this experiment, we use the same crossover and mutation technique for the three selection strategies. The GA will end if one of two conditions is met. First, the algorithm can find chromosome representing a feasible timetable. Second, the algorithm runs into 2,000 generations. For the parameter, we have different parameter groups. We try values of population size as 2, 4,

4

6, 8, 10, and 12, values of

crossover rate as 100, 90, 70, 50, 30 and 0, values of mutation rate as 100, 90, 70, 50, and 30. We have 108 parameters groups that show in Table IV. The algorithm will be executed 10 times for each parameter group and each selection strategy. For three selection strategies, we have

6

3,240 results.

TABLE IV.

PARAMETER GROUP IN THIS EXPERIMENT

Population size

Mutation Rate

Crossover Rate

100 90 70 50 30

100,0 90,70,50,30 90,70,50,30 90,70,50,30 90,70,50,30

Number of Parameter Groups

12 24 24 24 24 108 Sum The expenmental result IS unremarkable whIch mutation rate and crossover rate are optimal because there is fluctuation on different selection strategies. Sum of getting feasible timetable in early generation based and processing time based on different selection strategies show in Table V. Table VI and Table VII demonstrates more effectiveness of roulette wheel selection than rank selection and tournament selection, on either generation-based or time­ based consideration. 2,4,6,8,10,12 2,4,6,8,10,12 2,4,6,8,10,12 2,4,6,8,10,12 2,4,6,8,10,12

V.

8

10

12

CONCLUSION

This work observes GA's performance under 3 different selection strategies: roulette wheel selection; rank selection; and tournament selection. The experiment is conducted on real

course timetabling problem at

Rangsit University,

Thailand. The parameter setting includes different mutation

Generationl Processing time

Roulett eWheel Selectio n

Rank Selectio n

Tourname nt Selection (Tourname nt Size 4)

16/155 88/20 42/2

221159 78118 47/1

221139 66/36 40/2

18/0

2110

30/0

13/0

10/0

19/0

3/3 26/98 74/59 48/17

2/2 16/88 81167 46119

3/3 17/88 78/67 47/21

=

[0-200]/[0-3] (200-500]/(3-6] (500-800]/(6-9] (800-1200]/(912] (1200-2000]/(1240] >2000/>40 [0-200]/[0-3] (200-50011(3-61 (500-800]/(6-9] (800-1200]/(912] (1200-2000]/(1240] >2000/>40 [0-200]/[0-3] (200-50011(3-61 (500-800]/(6-9] (800-1200]/(912] (1200-2000]/(1240] >2000/>40 [0-200]/[0-3] (200-50011(3-61 (500-800]/(6-9] (800-1200]/(912] (1200-2000]/(1240] >2000/>40 [0-200]/[0-3] (200-500]/(3-6] (500-800]/(6-9] (800-1200]/(912] (1200-2000]/(1240] >2000/>40 [0-200]/[0-3] (200-500]/(3-6] (500-80011(6-91 (800-1200]/(912] (1200-2000]/(1240] >2000/>40

19/3

27/2

30/2

1111

6/0

7/1

2/2 31164 83/66 41133

4/4 20/46 93/83 41/33

III 26/63 83/64 42/39

15/10

19111

24/10

9/6

6/6

5/4

111 29/40 87170 36/29

III 28/35 77/57 45/38

0/0 32/43 74/56 32/32

18/23

22/28

24/18

10/18

8122

16/29

0/0 47/39 86/64 29/37

0/0 29/20 81163 38/35

2/2 29/25 75151 45/36

14/18

21124

20/26

4/22

11/38

11142

0/0 35/21 81145 43/45

0/0 29114 76/43 41/38

0/0 35/20 67/44 38/31

18/34

22/28

24/25

3/27

10/34

14/37

0/0

2/2

2/2

TABLE VI. SUM OF GETTING FEASIBLE TIMETABLE IN EARLY 200 GENERATIONS AND 3 SECONDS PROCESSING TIME AND SUM OF GETTING FEASIBLE TIMETABLE AFTER 2,000 GENERATIONS AND AFTER 40 SECONDS PROCESSING TIME FOR ALL POPULATION SIZE ON DIFFERENT SELECTION STRATEGIES

rate, crossover rate, and population size. For each selection strategy, 108 groups of parameter setting are run for 10 times. Therefore 3,240 results can be obtained. From numerous result, it is found that roulette wheel selection strategy works more efficient than the others, for producing feasible course timetables in early generation and short time. As further research, we will focus on soft constraints and different techniques of mutation and crossover operations.

Generation and Processing time based

Roulette Wheel Selection

Rank Selection

Tournament Selection (Tournament Size 4)

200 Generations 3 Seconds >2000 Generations > 40 Seconds

184 417 6 6

144 362 9 9

161 378 8 8

=

TABLE V. SUM OF GETTING FEASIBLE TIMETABLE IN RANGE OF GENERATION BASED AND PROCESSING TIME (SECOND) BASED ON DIFFERENT SELECTION STRATEGIES

107

TABLE VII.

SUM OF GETTING FEASIBLE TIMETABLE IN EARLY 500 GENERATIONS BASED AND 6 SECONDS PROCESSING TIME BASED ON DIFFERENT SELECTION STRATEGIES

PopuIati on Size

2 4 6 8 10 12

Generati on/Proce ssing time

500/6 500/6 500/6 500/6 500/6 500/6

RouIe tte Wheel Selecti on

104117 5 100115 7 114113 0 116111 0 113110 3 116166

Rank Selection

Tourname nt Selection (Tournam ent Size 4) =

100/177

88/175

97/155

95/155

1131129

109/127

105/92

106/99

110/83

104176

105157

102/64

REFERENCES [I]

Stuart Leyland, "A Timetable Exploration System", Third Year Project Report School of Computer Science, 2009.

[2]

Nilesh Gambhava and Gopi Sanghani. "University Examination Timetabling using Genetic Algorithm," in Proceeding of the 2nd International Conference on Applied Artificial Intelligence, 2003.

[3]

Salwani Abdullah and Harnza Turabieh. "Generating University Course Timetable Using Genetic Algorithms and Local Search," Third 2008 International Conference on Convergence and Hybrid Information Technology. IEEE, pp. 254-260, 2008.

[4]

Ghaemi, S. Vakili, M.T. Aghagolzadeh, A. "Using a genetic algorithm optimizer tool to solve University timetable scheduling problem," Signal Processing and Its Applications, 2007. ISSPA 2007. 9th International Symposium, pp.I-4, 2007.

[5]

Zan Wang, Jin-lan Liu and Xue Yu. "Self-fertilization based genetic algorithm for university timetabling problem," ACM/SIGEVO Summit on Genetic and Evolutionary Computation. ACM, pp.10011004, 2009.

108