university course timetabling by using multi objective genetic algortihms

21
BY HALIL CAN KAŞKAVALCI CONTINUED FROM WORK OF AHMET ULAK ADVISORS ASSOC. PROF. E.ERKAN KORKMAZ ASSOC. PROF. CEM ÜNSALAN YEDITEPE UNIVERSITY COMPUTER SCIENCE & ENGINEERING ELECTRICAL & ELECTRONICS ENGINEERING UNIVERSITY COURSE TIMETABLING USING MULTI OBJECTIVE GENETIC ALGORITHMS

Upload: halil-kaskavalci

Post on 16-Apr-2017

948 views

Category:

Education


0 download

TRANSCRIPT

Page 1: University Course Timetabling by using Multi Objective Genetic Algortihms

BY HALI L CAN KAŞKAVALC ICONTINUED FROM W OR K OF AHMET ULAK

ADVISORSASSOC. PROF. E.ERKAN KORKMAZ

ASSOC. PROF. CEM ÜNSALANYEDITEPE UNIVERSITY

COMPUTER SCI ENC E & ENGINEERI NGELECTRIC AL & ELECTRONI CS ENGINEERI NG

UNIVERSITY COURSE TIMETABLING USING MULTI

OBJECTIVE GENETIC ALGORITHMS

Page 2: University Course Timetabling by using Multi Objective Genetic Algortihms

ROADMAP

PROBLEM STATEMENTRELATED WORKMULTI OBJECTIVE GENETIC ALGORITHMSINHERITED PROJECTDESIGNIMPLEMENTATIONTESTSSAMPLE TIMETABLECONCLUSION

Page 3: University Course Timetabling by using Multi Objective Genetic Algortihms

UNIVERSITY COURSE TIMETABLING

Motivation to meet many objectives.NP-hard problem.Heuristic approach is required.Error prone when built manually.Optimization of three tuples: constraints, events,

resources.Constraints: grouped as hard and soft.

Hard constraints to be met under any circumstances Soft constraints should be satisfied as much as possible

Events: lectures, exams, meetings.Resources: professors, classrooms .

Page 4: University Course Timetabling by using Multi Objective Genetic Algortihms

RELATED WORKANNEALING is heat

treatment to create homogenous and a better material

SIMULATED ANNEALING is inspired by material science.

Material is heated to critical temperature and cooled down slowly.

When temperature is high, atoms can move fast and search space is broad.

As T goes down, search space gets smaller.

New form is accepted if energy is lower than previous form or with probability function

Analogy: Material = Timetable Elements = Courses Energy = Fitness value Temperature = Iteration

Page 5: University Course Timetabling by using Multi Objective Genetic Algortihms

MULTI OBJECTIVE GENETIC ALGORITHMS

Genetic algorithms (GA) are based on Darwinian evolution and natural selection.

Population consists of Individuals. Each individual has chromosome. Mutation, crossover and hill climber are applied to the chromosome. Selection mechanism eliminates bad individuals and good ones can live and breed.

Each generation creates a better population.

Fitness is defined to measure individual’s fit to the world.

Analogy Individual/Chromosome =

Timetable Genes = Courses Population = Solution pool World = Constraints

Multiple constraints and fitnesses can be handled in variety of ways.

Multiply all fitnesses with coefficients and add them together. This violates multi objectiveness.

Treat each fitness individually and do not favor one to another. This is called MOGA.

Page 6: University Course Timetabling by using Multi Objective Genetic Algortihms

MULTI OBJECTIVE GENETIC ALGORITHMS

MOGA provides a set of solutions which are called pareto front. Pareto front consist of individuals that cannot dominate each other.

Crowding distance is introduced to increase diversity.

Page 7: University Course Timetabling by using Multi Objective Genetic Algortihms

INHERITED PROJECTPrevious study is made by

Ahmet Ulak (M.Sc. in Yeditepe Uni)

MOGA is utilized.Chromosome is represented

as array of int.

Population is initialized by assigning random slots to courses.

At each generation population is copied and operators are applied to temporary population.

Crossover is single point CR. Selection is random.

Group mutation operators are implemented

HC randomly selects a course and improves it. Faculty courses may be selected as well.

Pareto front is not preserved. At each generation it is re-built.

Page 8: University Course Timetabling by using Multi Objective Genetic Algortihms

INHERITED PROJECTC++ project.No documentation is

supplied with submitted code.

Code is not cleanly written.One cpp file with 5878

lines. 5 classes, all tightly coupled. No OOP is observed.

1397 lines of depreciated functions, 2739 lines commented out code. Resulting 1742 lines effectively in use.

Complex IO

Variables like number of courses, population and pareto size are hard coded.

Compilation and runtime errors with different compilers. (Memory access violation by -1 array index)

HC and CR are insufficient and mutations are heavy.

Did not produce valid solution.

Page 9: University Course Timetabling by using Multi Objective Genetic Algortihms

DESIGN & IMPLEMENTATION

HC now selects the course that causes the most conflict.

Tournament selection is used.

Group crossover is utilized.

Pareto front is preserved rather than being re-constructed.

All operations are done on population rather than copying to temporary one.

Platform and compiler independency

OOP design and readable code

Modular fitness calculation for future change

Libraries used are open source to prevent licensing problems

Simpler IO (XML input, HTML output)

GUI for easier useTotal user control on

parameters

Page 10: University Course Timetabling by using Multi Objective Genetic Algortihms

IMPLEMENTATIONPopulation class initialize all

individuals.FileReader reads input files

and constructs Common singleton which is shared between all classes.

Population class can be created from console app or GUI which provides great portability.

In GUI, XML editor is implemented for easier modification of user parameters. i.e. courses, internal parameters, groups, prerequisites.

Page 11: University Course Timetabling by using Multi Objective Genetic Algortihms

IMPLEMENTATION

Tournament Selection Group Crossover

Page 12: University Course Timetabling by using Multi Objective Genetic Algortihms

IMPLEMENTATIONPopulation Control Hill Climber

Page 13: University Course Timetabling by using Multi Objective Genetic Algortihms

TESTS Code quality test

Code similarity 15.0 per

cent

Duration Tests (500s)

Test configuration:

1000 seconds

2000 secondsPareto Front

Population

Hard Soft Hard Soft

4.7 5.6 39.6 35.5

Pareto Front PopulationHard Soft Hard Soft

10.6 10.1 44.8 41.6

Pareto Front PopulationHard Soft Hard Soft

9.9 9.6 45.0 42.1

Mutation Rate

1 Per cent HC Size 100 Per cent

Crossover Rate

90 Per cent

HC Rate 35 Per cent

Duration 500 s HC Gene count 4

Population size

50 Selection Pool Size

5

Pareto size 20 Candidate size 2

Random Insert

0,5 Per Cent

Crowding Distance

8

Seed Random

Page 14: University Course Timetabling by using Multi Objective Genetic Algortihms

TESTS Crossover disabled

Mutation disabled

Hill Climber Disabled

Population: 20 Pareto 13

Population: 80 Pareto: 53

Population: 50 Pareto: 10

Population: 100 Pareto: 40

Population:50 Pareto: 40

Pareto Front

Population

Hard Soft Hard Soft

8.5 9.6 42.2 38.2

Pareto Front

Population

Hard Soft Hard Soft

5.9 6.8 6.4 7.4

Pareto Front

Population

Hard Soft Hard Soft

39.5 32.2 54.0 46.2

Pareto Front

Population

Hard Soft Hard Soft

6.0 6.3 25.1 23.0

Pareto Front

Population

Hard Soft Hard Soft

5.6 6.0 39.6 35.3

Pareto Front

Population

Hard Soft Hard Soft

6.0 6.3 25.2 23.9

Pareto Front

Population

Hard Soft Hard Soft

5.6 6.0 39.6 35.3

Pareto Front

Population

Hard Soft Hard Soft

5.3 5.2 52.2 46.1

Page 15: University Course Timetabling by using Multi Objective Genetic Algortihms

SAMPLE TIMETABLE

GUI follows minimalist design.

Progress bar is used to notify user.

Thread is started with highest priority

Here a sample timetable with 24 soft fitness violation is given.

Page 16: University Course Timetabling by using Multi Objective Genetic Algortihms

SAMPLE TIMETABLE

Page 17: University Course Timetabling by using Multi Objective Genetic Algortihms

SAMPLE TIMETABLE

Page 18: University Course Timetabling by using Multi Objective Genetic Algortihms

SAMPLE TIMETABLE

Page 19: University Course Timetabling by using Multi Objective Genetic Algortihms

SAMPLE TIMETABLE

Page 20: University Course Timetabling by using Multi Objective Genetic Algortihms

CONCLUSION

MOGA can be used to solve timetabling problem.

However, high processing power required.

HC, mutation and crossover operators should be selected carefully.

Results are not affected extensively by parameters. No domain knowledge is required.

Pareto front handling is key to solution.

Excessive mutation can result in distorted population.

Smarter HC finds solution fast however suffers from local minima.

Project is converted to more developer-friendly version which can be extended easily.

Page 21: University Course Timetabling by using Multi Objective Genetic Algortihms

THANK YOU