You are on page 1of 4

ATTENDANCE FULFILMENT USING GENETIC ALGORITHM

MANAV GUPTA

ABSTRACT fitness selection where rank can be


calculated based upon the fitness as
Attendance fulfilment problem is a preferences for each objective. In real
Multiple Objective Optimization problem world we need to deal with multiple
which can be solved in lower time objectives at once and thus the area for
complexity by evolutionary algorithms research in MOGA is gaining popularity.
rather than the traditional algorithm. This Attendance fulfilment problem presents a
paper describes genetic algorithm timetable for n days and m subjects each
approach to solve the problem of subject having xi classes where 0≤xi≤n and
attendance fulfilment. Same approach can 0≤i<m and minimum attendance criteria
be used for various other Multiple need to be fulfilled for each subject. We
Objective Optimization problems. need to find an attendance plan for
students to follow which maximizes the
KEYWORDS subjects fulfilling the minimum
attendance criteria with minimum days
Multiple Objective Optimization, Genetic
need to attend the school. In attendance
Algorithm, Attendance Fulfilment, fulfilment, there are two objectives i.e.
Timetable, Fitness, Crossover maximize the number of subjects which
fulfil the attendance criteria and minimize
INTRODUCTION the number of days to attend the school.
Our priority is to maximize the subjects
Genetic Algorithm is the method based on
fulfilling the attendance criteria.
the natural process of biological evolution
that can be used to solve the problems PRIOR WORK
which are difficult to solve with classical
To the best of our knowledge, genetic
methods. Genetic algorithm is non-
deterministic and is used to solve mainly algorithm has not been used to find the
NP-hard problem. Multiple Objective minimum days required to attend the
Optimization problem deals with multiple school such that attendance criteria is
objective simultaneously where the fulfilled. The problem belongs to class of
different objectives might be required to multi-objective optimization problems
maximize and minimize simultaneously. which has been tackled by genetic
What distinguishes multiple objective GAs algorithms.
from single objective GAs is how they rank Carlos[1] generalises Multiple Objective
and select individuals in the population. If Genetic Algorithm(MOGAs) . The genetic
there is only one objective, individuals are algorithm is seen as the optimizing
naturally ranked according to this
element of a multi-objective optimization
objective, and it is clear which individuals
loop, which also comprises the Decision
are best and should be selected as
Maker(DM). The paper describes solely
parents. In case of multiple objectives, it is
still necessary to rank the individuals, but rank-based fitness assignment which can
it is no longer obvious how to do this. The be used for the selection operator in
selection operator is limited to rank-based MOGA. Illustrative results of how the DM
can interact with the genetic algorithm unset bits represents school to be missed
are also presented in the paper. to be missed on those days.
Timetable Scheduling is a common FITNESS FUNCTION
problem which can be studied for the
better insight to our problem . Liviu[2] The fitness of the chromosome can be
describes the chromosomes and different assigned as a tuple of 2 attributes. The
approaches to be applied for crossover first attribute =
and mutation for timetable scheduling
(total subjects fulfilling the
which can be used to solve our problem
attendance criteria)
too.
(total subjects)

TECHNICAL DESCRIPTION OF The second attribute = Number of set bits


PROPOSED WORK in the chromosome

ASSUMPTIONS AND CONSTRAINTS Among the two attributes the preference


is given to the first attribute which we
We have assumed that there can be at
want to maximize and then to the second
most one class of a subject on a single
attribute which we want to minimize.
day. We have also assumed that student
arriving on single day will attend all the INITIAL POPULATION
classes on that particular day.
The initial population can be generated
CHROMOSOME ENCODING randomly by generating random
Solution to the problem can be encoded chromosomes each having length equal to
as binary string of length n days where ith number of days of the timetable. Initial
bit corresponds to the attending the ith population size must be at least n to
day of the school and set bit represent maintain diversity among the population.
school to be attended by the person and
the unset bit represents the school to be
missed on that ith day. SELECTION OPERATOR
The chromosome will be selected based
upon the k-way tournament selection.
This approach is slightly modified to give
such that less fitness chromosome have
better chance than traditional k-way
tournament selection. This is done by first
sorting the population based upon the
fitness of first attribute then the second
attribute and then directly selecting the
chromosomes rather than comparing as in
the traditional k-way tournament
In above string days 1,2 4,5 and 7 have set
selection.
bits and represents school to be attended
on these days and days 3 and 6 have
Random Number generated 2 and 4 which fulfils the attendance criteria for all
the subjects, the algorithms continues to
run until such solution is found.

EXPERIMENTAL RESULTS
Test Run 1:
Generation 1 fitness [0.8, 7]
Generation 2 fitness [0.8, 7]
Generation 3 fitness [0.8, 7]
Selected Generation 4 fitness [0.8, 7]
Generation 5 fitness [0.8, 7]
for
Generation 6 fitness [0.8, 7]
crossover Generation 7 fitness [0.8, 7]
Generation 8 fitness [1.0, 7]
Generation 9 fitness [0.2, 4]
Generation 10 fitness [1.0, 6]
In above example chromosome 2 and 4 Generation 11 fitness [1.0, 6]
are directly selected for crossover. Generation 12 fitness [1.0, 6]
Generation 13 fitness [1.0, 6]
CROSSOVER OPERATOR Generation 14 fitness [0.6, 6]
Generation 15 fitness [0.4, 6]
Single point crossover operation is done Generation 16 fitness [0.4, 6]
to produce the offspring. The offspring Generation 17 fitness [0.6, 5]
produced replaces the parents from the Generation 18 fitness [0.6, 5]
population pool. Generation 19 fitness [0.6, 5]
Generation 20 fitness [0.6, 5]
Generation 21 fitness [0.6, 5]
Generation 22 fitness [0.6, 5]
Generation 23 fitness [0.6, 5]
Generation 24 fitness [0.6, 5]
Generation 25 fitness [0.6, 5]
Generation 26 fitness [0.6, 5]
Generation 27 fitness [0.6, 5]
Generation 28 fitness [1.0, 6]
MUTATION OPERATOR Best solution fitness [1.0, 6]

To maintain the diversity, mutation is Test Run 2:


introduced in the chromosomes with low
probability. The mutated chromosome Generation 1 fitness [1.0, 7]
Generation 2 fitness [1.0, 7]
has some of its bits flipped i.e. set bit
Generation 3 fitness [1.0, 7]
becomes unset and vice-versa. Generation 4 fitness [1.0, 7]
Generation 5 fitness [1.0, 7]
Generation 6 fitness [0.6, 5]
Generation 7 fitness [0.6, 5]
Generation 8 fitness [0.6, 5]
TERMINATION CRITERIA Generation 9 fitness [0.6, 5]
Generation 10 fitness [0.6, 5]
The algorithm will continue to run till the Generation fitness [0.6, 5]
maximum generation size is reached. If Generation fitness [0.6, 5]
the solution has not been found a solution Generation 13 fitness [0.6, 5]
Generation 14 fitness [0.6, 5]
Generation 15 fitness [0.6, 5] Algorithms Branimir Sigl, Marin
Generation 16 fitness [0.6, 5] Golub, Vedran Mornar
Generation 17 fitness [0.4, 6]
Generation 18 fitness [0.0, 5]
Generation 19 fitness [0.0, 5]
Generation 20 fitness [0.6, 6]
Generation 21 fitness [0.6, 6]
Generation 22 fitness [0.6, 6]
Generation 23 fitness [0.6, 6]
Generation 24 fitness [0.6, 6]
Generation 25 fitness [0.6, 6]
Generation 26 fitness [1.0, 6]
Best solution Fitness [1.0, 6]

OBSERVATION
1) Best fitness along the generation is not
constant or follows any function. Fitness
along the generation in purely random.

2) The GA is able to find the best solution


and the solution found in different runs is
found at almost same generation.

CONCLUSION
The Genetic Algorithm approach is
successfully able to find the optimal
solution for our problem in low time
complexity. This also helps in providing
basis to multiple objective optimization
problems which can be tackled by the
same approach.

REFERENCES
1. Genetic Algorithms for
Multiobjective Optimization:
Formulation, Discussion and
Generalization∗ by Carlos M.
Fonseca† and Peter J. Fleming‡
2. Timetable Experiments using
genetic algorithms by Liviu Lalescu,
Costin Badica
3. Solving Timetable Scheduling
Problem by Using Genetic

You might also like