university course timetabling by using multi objective genetic algortihms
TRANSCRIPT
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
ROADMAP
PROBLEM STATEMENTRELATED WORKMULTI OBJECTIVE GENETIC ALGORITHMSINHERITED PROJECTDESIGNIMPLEMENTATIONTESTSSAMPLE TIMETABLECONCLUSION
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 .
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
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.
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.
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.
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.
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
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.
IMPLEMENTATION
Tournament Selection Group Crossover
IMPLEMENTATIONPopulation Control Hill Climber
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
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
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.
SAMPLE TIMETABLE
SAMPLE TIMETABLE
SAMPLE TIMETABLE
SAMPLE TIMETABLE
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.
THANK YOU