National College of Engineering

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

NATIONAL COLLEGE OF ENGINEERING

Affiliated to Tribhuvan University

A
Proposal
On
AUTOMATIC ROUTINE GENERATION USING

GENETIC ALGORITHM

Submitted By:

Aashish Shah (075/BCT/03)


Basanta Gurung (075/BCT/07)
Bimal Rai (075/BCT/08)
Milan Maharjan (075/BCT/014)
Submitted to :

Department of Electronics and Computer Engineering


National college of engineering
Talchhikhel, Lalitpur
Nepal
Dec 15, 2021
Abstract

Creating timetables for institutes that deal with theory classes, laboratory classes, tutorials,
and breaks is a complex problem. It is difficult and time-consuming to solve due to many
constraints. Depending on whether the constraints are essential or desirable, they are
categorized as ”hard” and ”soft” respectively. A feasible course timetable could be described
as a plan for the movement of students and staff from one classroom to another without
conflicts. Being an NP-Hard problem, many attempts have been made using varying
computational methods to obtain optimal solutions to the timetabling problem. Genetic
algorithms based on Darwin’s theory of evolution is one such method. The aim of this study
is to optimize a general university course scheduling process based on genetic algorithms
using some defined constraints

Keywords: Genetic Algorithm ,NP-Hard ,Schedule Generator , Computational Method.

2
Table of Contents
Abstract................................................................................................................................................2
Introduction.........................................................................................................................................5
1.1 Background Introduction........................................................................................................5
1.2 Problem statement.................................................................................................................5
1.3 Objective..................................................................................................................................6
Literature Review..................................................................................................................................7
Requirement Analysis..........................................................................................................................10
3.1 Software Requirements.............................................................................................................10
3.1.1 Python.................................................................................................................................10
3.1.2 C#........................................................................................................................................10
3.1.3 Firebase..............................................................................................................................10
3.1.4 MySql..................................................................................................................................10
3.1.5 JavaScript............................................................................................................................10
3.2 FUNCTIONAL REQUIREMENT.....................................................................................................10
3.3 NON-FUNCTIONAL REQUIREMENT............................................................................................11
3.4 FEASIBILITY STUDY.....................................................................................................................11
3.4.1 Economic Feasibility............................................................................................................11
3.4.2 Technical Feasibility............................................................................................................11
System Design.....................................................................................................................................12
4.1 Use case diagram.......................................................................................................................12
4.2 System Block..............................................................................................................................12
Methodology.......................................................................................................................................13
5.1 Method of Software Development............................................................................................13
5.2 DATA COLLECTION.....................................................................................................................13
5.2.1 Development Process.........................................................................................................13
5.2.2 Basics of Genetic Algorithm................................................................................................13
Cost Estimation....................................................................................................................................16
6.1 Team Member...........................................................................................................................16
6.2 Materials and Equipment..........................................................................................................16
6.3 Risk Management......................................................................................................................16
6.4 Quality Control..........................................................................................................................16
6.5 Scheduling.................................................................................................................................16
Expected Outcomes.............................................................................................................................17

3
4
Introduction
1.1 Background Introduction
It is not surprising that we need to generate routines for a college or university, given that
they are one of the most important aspects of running any organization smoothly. We can
see routines being used in educational institutions, offices, factories, or anywhere where a
timetable needs to be maintained. But, we have faced problems with manually generating
routines as they have chances of conflict and are tedious. So, we are in need of an
automatic routine generator that will not only make our work easier but also optimize the
routine so that it is the best fit for the required work. Among various methods to generate
automatic routines, the routine generated by using Genetic Algorithms is considered to be
the one of best fit. Although routine generation is considered to be a NP-Hard problem
and can always have a better solution than we have one now, the genetic algorithm gives
us an almost perfect routine.

1.2 Problem statement


As we are using manual and semi-manual methods to generate routines in our institutions,
we are facing the problem of inefficiencies and frequent errors. We can break the
problems into hard and soft constraints. Hard constraints must be overcome to get the
proper result. It includes critical errors like a group of students needing to attend a lecture
and a lab at the same time or a teacher having lectures at different classes at the same
time. Soft constraints are not compulsory to be solved, but solving them will make the
routine even better and will help teachers and students be better prepared for class. It
includes giving students 30 minutes of free time after every two lectures or resting the
teacher after every lecture. We are using manual methods and algorithms like the greedy
algorithm to generate routines which can produce errors. In this method, we just fill the
classes with an available teacher and use the ”hit and trail” method. This will make the
routine-making process long, and the routine should be changed frequently as it
encounters problems. The software used is not particularly routine generating software.
They are not user-friendly and are time-consuming. There are very few automatic routine
generating software products seen on the market that are exactly modelled according to
our requirements. Creating such software will help individuals as well as institutions
work effectively.

5
1.3 Objective
Although the manual scheduling process is time-consuming and quite confusing, smaller
universities adapt to this method. As the complexity of the university grows, it has become
necessary to use computerized methods to facilitate the scheduling process. It should be noted
that as the number of students with different interests and needs grows and the teaching
programs become more difficult with the growth of the university, the number of issues also
increases, leading to a significant increase in integration time, making it a full function of the
NP complete problem

6
Literature Review

During the past few decades, numerous articles and research papers have been published in
conferences and magazines relating to the automation of the timetable generator. The first
automated time generation was presented by Gotlieb [1] at the 1962 Munich IFIP Congress.
The idea of Gotlieb’s algorithm is to detect some tight assignments and some pseudo-
availabilities by investing certain subproblems of minor complexity using nonheuristic
approach. Welsh and Powell [2] (1967) uses a graph colouring concept for reducing
Timetabling Problem into the chromatic number problem which is also NP-Hard. M.
Dimopolou and P. Miliotis [3] uses an integer programming (IP) model for the generation of
automated timetable. To reduce the complexity in the routine generation using the
nonheuristic approach, must researcher are considering heuristic algorithm, such as Dave
Corne, Emma Hart and Peter Ross have worked with Genetic Algorithm (GA) and
timetabling [4]. In 1992, Edward L. Mooney and Ronald L. Rardin [5] uses Tabu Search
method which is meta-heuristic approach where they describe extensions and enhancements
of Tabu Search for the special case of the resource scheduling algorithm. Some researchers
have recently concentrated into Logic Programming so that they can solve this problem by a
natural way of representing constraints. Its limitations with unsatisfied performance were
pointed by Bartak. [6] Michael W. Carter [7], developed a computerized examination
timetabling system called EXAMINE, which was applied in Universities of Toronto and
Carleton. Here, the problem are investigated and compared using several algorithmic
strategies. Cooper and Kingstone [8] have used simulated annealing. Kendall and Hussin [9]
proposed a tabu search meta-heuristic method for ETP at University of Technology MARA.
Many researchers [10] have applied different evolutionary computing algorithm like cuckoo
search to the scheduling problem. This method outperformed other all conventional methods
for all problem instances. Masri Ayob was described a formulation of an Examination
Timetable Problem for University Kebangsaan Malaysia [11] . He proposed a useful
objective function. There were some constraint based reasoning which has proven to be a
productive research method for the researchers in different areas such as artificial
intelligence, operational research and logic programming. Kenekayoro [12] applied Machine
Learning to solve Timetabling problem for university. Tavakoli, et.al. [13] Proposed a novel
algorithm for timetabling problem with the quality of courses rendered approach.

7
S.N Title Author/s Remarks
1 The construction of Gotlieb,CC Here, no differentiation is concerned
class-teacher between mandatory and non-mandatory
timetable courses and the fact that course
presentation is uniform in different daily
time slots, while in order to promote
educational quality, have less courses at the
end of daily time slots
2 An upper bound for Welsh, Dominic JA and Apart from the improved upper bound for
the chromatic number Powell, Martin B the chromatic number the algorithm
of a graph and its presented above seems most useful for
application to scheduling problems where there is certain
timetabling problems amount of “slack”. It does not answer the
much more difficult problem, which usually
occurs in practice ,when in addition to an
incompatibility matrix we are given a pre
assignment matrices which specifies that
certain jobs must be carried out on certain
days ordained beforehand.
3 Implementation of a Dimopoulou, Maria and This paper reports the design and
university course and Miliotis, Panagiotis implementation of a PCbased computer
examination system to aid the construction of a
timetabling system combined university course–examination
timetable.

4 Genetic algorithms Ross, Peter and Hart, Emma It discusses the state of the art, at the start
and timetabling and Corne, Dave. of the new millennium, in using evolutionary
algorithms to tackle timetabling problems of
various kinds.

5 Tabu search for a class Mooney, Edward L and This paper describes extensions and
of scheduling Rardin, Ronald L enhancements of tabu search for the special
problems case of the resource scheduling problem.
Potential applications include shiftoriented
production and manpower scheduling
problems as well as course scheduling where
classrooms (instructors) are primary and
instructors (rooms) and students are
secondary resources
Interactive T. M uller and R. Bart a A promising algorithm for solving timetabling
timetabling: Concepts, problems, which combines principles of the
6 techniques, and local search with other techniques for
practical results solving constraint satisfaction problems. In
this paper a basic concept, a constraint
model, and a solution algorithm for
interactive timetabling was presented.
7 Examination Carter, Michael W and The authors have developed a computerized
timetabling: Laporte, Gilbert and Lee, Sau examination timetabling system called
Algorithmic strategies Yan EXAMINE. In this article several algorithmic

8
and applications strategies for this problem are investigated
and compared. Computational results are
reported on randomly generated problems
and on some real problems.
8 The solution of real Cooper, Tim B and Kingston, This paper describes a computer program for
instances of the Jeffrey H high school timetabling which has
timetabling problem completely solved an instance taken without
simplification from a large and tightly
constrained high school. A timetable
specification language allows the program to
handle the many idiosyncratic constraints of
such instances in a uniform way. New
algorithms are introduced which attack the
problem more intelligently than traditional
search methods.
9 A tabu search hyper- Hussin, NM and Kendall, G It presents their examination timetabling
heuristic approach to problem with respect to its size, complexity
the examination and constraints. It analyses their realworld
timetabling problem data, and produce solutions utilizing a tabu-
at the MARA searchbased hyper-heuristic
university of
technology
10 Performance Thepphakorn, Thatchai and First report on modified and hybrid Cuckoo
improvement Pongcharoen, Pupong Search for real-world course
strategies on Cuckoo timetabling.Comprehensive review on
Search algorithms for metaheuristics applied to solve course
solving the university timetabling problem
course timetabling
problem
Solving a practical Ayob, Masri and Ab Malik, This paper presents a GreedyLeast
examination Ariff Md and Abdullah, Saturation Degree (G-LSD) heuristic (which is
11 timetabling problem: Salwani and Hamdan, Abdul an adaptation of the least saturation degree
a case study Razak and Kendall, Graham heuristic) to solve a real-world examination
and Qu, Rong timetabling problem at the University
Kebangsaan, Malaysia. Utilizing a new
objective function that was proposed in our
previous work to evaluate the quality of the
timetable. The objective function considers
both timeslots and days in assigning exams
to timeslots, where higher priority is given to
minimize students having consecutive exams
on the same day

9
Requirement Analysis
3.1 Software Requirements
Our routine generator system requires Python, C# ,Firebase, My SQL and JavaScript which are
described below

3.1.1 Python
Python is a high-level, interpreted programming language designed for generalpurpose applications.
It was created by Guido van Rossum and released in 1991. Python has a design philosophy that
emphasizes code readability, notably using significant white space. It provides constructs that enable
clear programming in small and large programs. The programming language features a dynamic type
system and automatic memory management with support for multiple programming paradigms,
including Object-Oriented Imperative, Functional, and Procedural. The programming language has a
large and comprehensive standard library.

3.1.2 C#
C# is a general-purpose, multi-paradigm programming language. C# encompasses static typing,
strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-
based), and component-oriented programming disciplines. C# was designed by Anders Hejlsberg
from Microsoft in 2000 and was later approved as an international standard by Ecma (ECMA-334) in
2002 and ISO (ISO/IEC 23270) in 2003.

3.1.3 Firebase
Firebase is a back-end platform for building Web, Android and IOS applications. It offers real time
database, different APIs, multiple authentication types and hosting platform. Firebase can power
your app’s back-end, including data storage, user authentication, static hosting, and more. It focuses
on creating extraordinary user experiences. We can also connect Firebase to your existing back-end
using our server-side libraries or our REST API.

3.1.4 MySql
MySQL is an open-source relational database management system (RDBMS). Its name is a
combination of ”My”, the name of co-founder Michael Widenius’s daughter, and ”SQL”, the
abbreviation for Structured Query Language. In our project, we use this database to feed into system
for data labeling.

3.1.5 JavaScript
JavaScript often abbreviated as JS, is a high-level, interpreted programming language. It is a language
which is also characterized as dynamic, weakly typed, prototype-based and multi-paradigm. We use
JS to both accompany in sentiment labeling system as well as sentiment inference system which is
shown in appendix part of this report.

3.2 FUNCTIONAL REQUIREMENT


The following are functional requirements of our system:

• To show the generated routine.

10
• User-friendly front-end design using Cascading Style Sheets.

• Strong authentication while performing various operations.

• Java script validations and alerts wherever needed.

3.3 NON-FUNCTIONAL REQUIREMENT


The following are non-functional requirements of our system:

• Secure access of confidential data (user’s details). SSL can be used.

• Better component design to get better performance at peak time.

• Flexible service-based architecture will be highly desirable for future extension.

• It utilizes minimal processing/computing power.

• It greatly reduces the time needed to generate maximum error free timetables.

• It provides an easy means for data entry and revision through an intuitive interface.

• It increases productivity.

• Timetables generated are between to 60best solution.

• It almost eliminates paperwork.

• It simplifies the timetabling process.

3.4 FEASIBILITY STUDY


The following points describes the feasibility of the project

3.4.1 Economic Feasibility


Being a web application, it will have an associated hosting cost. Since the system doesn’t consist of
any multimedia data transfer, the bandwidth required for the operation of this application is very
low. The system will follow the freeware software standards. No cost will be charged to the potential
customers. Bug fixes and maintenance tasks will have an associated cost. At the initial stage, the
potential market space will be the local universities and higher educational institutes. Besides the
associated cost, there will be many benefits for the customers. In particular, the extra effort that is
associated with paper making and marking will be significantly reduced, while the effort to create
descriptive reports will be eliminated since routine generation is fully automated. From these, it’s
clear that the project is financially feasible.

3.4.2 Technical Feasibility


This is a complete web based application. The main technologies and tools that are associated with
this project are

• HTML

• CSS

• PYTHON

• MySQL

11
• JS

• Diagram drawing tools

■ Microsoft Project

■ Draw.IO

Each of the technologies are freely available and the technical skills required are manageable. Time
limitations of the product development and the ease of implementing using these technologies are
synchronized. From these it’s clear that the project is technically feasible.

3.4.3 Operational Feasibility


As this website only displays routine for teachers and students, they can easily use it. The admin is
the one feeding values and looking after everything who is a trained person.The web application is
compatible to any devices used either a desktop or a mobile or a tablet. So, the program is
operationally feasible.

System Design
We have proposed to develop a automated routine generator for University

4.1 Use case diagram


4.2 System Block

12
Methodology
This research falls under an optimization problem, and extensive verification of performance is not a
feasible solution. It is important to select an appropriate research design and methodology to ensure
the viability of the research

5.1 Method of Software Development


Iterative development is a method for creating software suitable for a continuously changing
environment for artificial intelligence development. This enables the developer to learn from every
iteration and apply it to future instances. Each iteration is an enhancement to the system, which will
repeat until the system delivers its expected result. Initial planning has been done by designing
system

architecture, data schematic and models. Upon entering an iteration, the feature to be done is
decided and planned. There are two types of iterations used; adding a feature or a model and
tweaking values. Each iteration’s goal is then implemented and then manually tested.

5.2 DATA COLLECTION


The required data, such as lecture id, lecture time table, course, and room number, is manually
entered by the administrator and fed into our database, where a genetic algorithm is used to
generate an optimized routine.

5.2.1 Development Process


With the help of genetic algorithms, we are going to develop this software. Genetic algorithms are a
type of evolutionary algorithm that is inspired by the process of 12 natural selection. A genetic
algorithm is a computing method that simulates natural selection, which is a process in biological
evolution. It is a search heuristic that is inspired by Charles Darwin’s theory of natural evolution. This
algorithm reflects the process of natural selection where the fittest individuals are selected for
reproduction in order to produce offspring of the next generation. In genetic algorithms, a solution is
referred to as a chromosome instead of an individual. The figure below shows the basic process of a
genetic algorithm. However, in practice, another step is added after evaluation, which is the
adjustment of the environment.

5.2.2 Basics of Genetic Algorithm


A genetic algorithm was applied to solve university timetabling problems under certain constraints.
The algorithms are:

1. Prototypes of parents and chromosomes (P1 and P2) were created.

2. The crossover process generates children’s chromosomes (Ch1 and Ch2).

3. Two of the best chromosomes that give the highest fitness value were selected using fitness
function.

4. The crossover process, or mutation process, by randomizing a probability value was decided upon
whether to be used.

• When the crossover process was chosen, steps 3–4 were repeated.

• When the mutation process was employed, each chromosome’s ”fitness value” with the
”fitness function” was examined, and only the chromosome that gave the highest fitness value to do
13
the mutation process was selected. The chromosome was put back into the pool and Step 4 was
repeated.

5. The process continues until the ”fitness value” is achieved or the user terminates the process.

Before using the genetic algorithm, first we need to create a chromosome. An individual is
characterized by a set of parameters(variables) known as genes. Genes are joined into a string to
form a chromosome. We will model our solutions as chromosomes. In our example, chromosome
will be different lecture sessions for students taking different subjects.Such as, we can consider a
coordinate of student groups, subjects, lecture room, days and time. We can represent it by: We will
encode this lecture sessions to a binary pattern to form a chromosome

Example: < C++, BCT2, Sunday, hall 1, 11:00 AM >

C++ : 00001

BCT2: 0010

Sunday: 000

Hall 1: 1101

11:00 AM: 1010

Chromosome: 00001001000011011010

Here, the individual bits are called genes. Thus, we can say that this chromosome as 20 genes.

The five main phases of genetic algorithm are:

1. Generation of Initial Population:


• Generation of the initial population will be done randomly where a random point will be
selected and act as a starting point, and then we will start filling up the table with any entity
that would fit, considering that all the hard constraints are to be met and that medium
constraints will undergo multiple attempts to be followed while the soft constraints are
ignored.The chromosomes will be constructed using lecturers, subjects, semesters, and class
type (lectures, practical, and tutorial). We will use binary bits, considering the number of
lecturers, subjects, and semesters.
2. Evaluation of each chromosome:
• Evaluation is the process of calculating the fitness of a chromosome. Fitness is the measure
of the quality of the chromosome relative to the desired solution. We can formulate the
evaluation function as the inverse number of class conflicts for student groups (i.e. lesser the
fewer the students in the class conflict, the more fit the class is), number of classes per week
and room availability. The fitness will be calculated in the range of 0-1 where values close to
1 represents best fit schedule with least conflict and optimum solution . Whereas,values
close to 0 represents conflicted outcomes
3. Selection of chromosome:
• After the evaluation of the chromosome, the chromosomes are now picked for
reproduction. Chromosomes with high fitness values are likely to get picked. Thus, here we
can see the concept of the survival of the fittest. There may be multiple ways for the
14
selection of a fit chromosome, all of which have their own pros and cons. Thus, we will use
the most appropriate type of selection mechanism to avoid early convergence. We will use
the value of fitness to determine fittest chromosomes. The concept of retaining elite
chromosomes will be used and less elite chromosomes will be used for mating.
4. Perform crossover:
• After the chromosomes are selected, they get into the mating pool. The mating pool
consists of the fittest chromosomes that will undergo crossover. Crossover, also called
recombination, is a genetic operator used to combine the genetic information of two
parents to generate new offspring. Like selection, there are also multiple ways of performing
crossover. Thus, it is very important to use the appropriate method to have a better
outcome. Davis order [14] crossover works best on permutation-based problems. The
process works by taking a collection of the first parent’s genes into the offspring and then
wrapping a gene for the second parent into the offspring. For each pair of chromosomes,
two children will be produced where the parent role is reversed to produce
different offspring. All children will take over from their parents’ places in the population.
This can be seen below:
5. Perform mutation:
• Mutation is a genetic operator that helps to maintain a variety of solutions. It helps to
maintain the genetic diversity from one generation of a population of genetic algorithm
chromosomes to the next. It helps to alter the one or more gene value from a initial state
chromosome. It also prevents the solution from being stuck in local optima. Mutation rate
may vary depending on the performance of population

15
Cost Estimation
6.1 Team Member
Our team consists of 4 members with equal work division among us

6.2 Materials and Equipment


We will use our personal laptops in the project. The software we use are freely available and will use
OS like windows and Linux.

6.3 Risk Management


We include identification and management of risks along with possible risk estimation in this section.
Generally, the cost estimation depends on the risk analysis and prioritization of the risk following the
response and monitoring to those risk involved in the project.

6.4 Quality Control


We look at the quality of project designed by us and the required quality of software by repeated
testing and process management. The cost estimation for the quality control depends on inspection,
checking , auditing and assurance of the project

6.5 Scheduling
We have scheduled for 6 topics. They are - Research and analysis, Preparation Planning and design,
Developmen

16
Expected Outcomes

The proposed project is expected to generate a class schedule after feeding all the input by the
admin related to the system without having any conflict, such as having the same teacher in multiple
classes. It will lead to smart and systematic implementation of the class schedule and remove the
manual paper work with higher efficiency within a shorter amount of time. This will develop the best
solution among the available multiple solutions after satisfying the fitness test and passing through
the crossover and mutation. Mainly in universities where there are a larger number of faculty and an
enormous number of students, it will play a very high-beneficiary role. The generated schedule is
also auto updatable as per the request, and the admin and students can simply get viewer access to
check for the schedule.

In the figure 7.1 representation is as below: L1,L2,L3,L4,L5,L6 - lecturers


SUB1,SUB2,SUB3,SUB4,SUB5 - Various subjects of the semester course T - Theory classes LAB -
Laboratory classes

17

You might also like