B Y H A L I L C A N K A Ş K A V A L C I
C O N T I N U E D F R O M W O R K O F A H M E T U L A K
A D V I S O R S
A S S O C . P R O F . E . E R K A N K O R K M A Z
A S S O C . P R O F . C E M Ü N S A L A N
Y E D I T E P E U N I V E R S I T Y
C O M P U T E R S C I E N C E & E N G I N E E R I N G
E L E C T R I C A L & E L E C T R O N I C S E N G I N E E R I N G
UNIVERSITY COURSE TIMETABLING
USING MULTI OBJECTIVE GENETIC
ALGORITHMS
ROADMAP
 PROBLEM STATEMENT
 RELATED WORK
 MULTI OBJECTIVE GENETIC ALGORITHMS
 INHERITED PROJECT
 DESIGN
 IMPLEMENTATION
 TESTS
 SAMPLE TIMETABLE
 CONCLUSION
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 WORK
 ANNEALING 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.

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 PROJECT
 Previous 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 PROJECT
 C++ 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 use
 Total user control on
parameters
IMPLEMENTATION
 Population 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, prereq
uisites.
IMPLEMENTATION
Tournament Selection Group Crossover
IMPLEMENTATION
Population Control Hill Climber
TESTS
 Code quality test
 Code similarity 15.0 per cent
 Duration Tests (500s)
 Test configuration:
 1000 seconds
 2000 seconds
Pareto Front Population
Hard Soft Hard Soft
4.7 5.6 39.6 35.5
Pareto Front Population
Hard Soft Hard Soft
10.6 10.1 44.8 41.6
Pareto Front Population
Hard 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

University Course Timetabling by using Multi Objective Genetic Algortihms

  • 1.
    B Y HA L I L C A N K A Ş K A V A L C I C O N T I N U E D F R O M W O R K O F A H M E T U L A K A D V I S O R S A S S O C . P R O F . E . E R K A N K O R K M A Z A S S O C . P R O F . C E M Ü N S A L A N Y E D I T E P E U N I V E R S I T Y C O M P U T E R S C I E N C E & E N G I N E E R I N G E L E C T R I C A L & E L E C T R O N I C S E N G I N E E R I N G UNIVERSITY COURSE TIMETABLING USING MULTI OBJECTIVE GENETIC ALGORITHMS
  • 2.
    ROADMAP  PROBLEM STATEMENT RELATED WORK  MULTI OBJECTIVE GENETIC ALGORITHMS  INHERITED PROJECT  DESIGN  IMPLEMENTATION  TESTS  SAMPLE TIMETABLE  CONCLUSION
  • 3.
    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 .
  • 4.
    RELATED WORK  ANNEALINGis 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. 
  • 5.
    MULTI OBJECTIVE GENETICALGORITHMS  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.
  • 6.
    MULTI OBJECTIVE GENETICALGORITHMS  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.
  • 7.
    INHERITED PROJECT  Previousstudy 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.
  • 8.
    INHERITED PROJECT  C++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.
  • 9.
    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 use  Total user control on parameters
  • 10.
    IMPLEMENTATION  Population classinitialize 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, prereq uisites.
  • 11.
  • 12.
  • 13.
    TESTS  Code qualitytest  Code similarity 15.0 per cent  Duration Tests (500s)  Test configuration:  1000 seconds  2000 seconds Pareto Front Population Hard Soft Hard Soft 4.7 5.6 39.6 35.5 Pareto Front Population Hard Soft Hard Soft 10.6 10.1 44.8 41.6 Pareto Front Population Hard 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
  • 14.
    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
  • 15.
    SAMPLE TIMETABLE  GUIfollows 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.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
    CONCLUSION  MOGA canbe 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.
  • 21.