Complete Document
Complete Document
A CS Thesis Project
LAS PIÑAS
Researcher:
Celiz, Edcel A.
April 2018
DEDICATION
To remind that the question is not “can I make this?” but “how long till I
make this?”
II
ACKNOWLEDGEMENT
Our God Almighty, for making all of this happen and serving as an
AMA Computer College Las Piñas’ dean, Engr. Michelle Pullon, who
AMA Computer College Las Piñas’ college faculty who have shown
My friends and peers who have shown their support and help in
times of distress.
III
TABLE OF CONTENTS
Approval Sheet I
Dedication II
Acknowledgement III
Abstract IV
Table of Contents V
CHAPTER I
Introduction 1
Conceptual Framework 6
Definition of Terms 27
CHAPTER II
CHAPTER III
V
Method of Software Development
CHAPTER IV
CHAPTER V
Summary 49
Conclusion 50
Recommendation 51
Figures
Tables
VI
Table 4.3 Subjects CSV Column
Bibliography
Appendices
Appendix A – Letters
VII
CHAPTER 1
Introduction
problems which can help optimize existing solutions or create never been
different types but it will all follow the same concept. This research aims
traits that can generate a university schedule timetable with the goal of
1
generating a valid and as optimal as possible solution with certain
constraints.
Using computers to find the best solution for this problem using
ignored for a time when solving such problem. However, rise in computing
not only help reduce expense but mainly to cater to students. Often, better
2
the problem by just filling up and making sure that the constraints are
a highly tight scenario. Replicating the human way of solving the problem
computing cost.
Computers are rarely used for solving this problem because of the
computers are slow and not intended to solve compute intensive problems.
power, using computers to solve new sets problems that previously can
algorithms. All of these processes have their own pros and cons. Genetic
3
burden due to a number of features that are scattered and not even being
utilized majority of the time. The process can still not provide a solution
that is ensured to be free from errors, bad looking result and constraint
admitted senior high school students which put the dean in creating a
The software assisting the operator is not user friendly and the
experience of using the software is bad and far from standards. This
4
The software being used is not fitted for the institute and therefore
generation of solution.
For AMA Computer College Las Piñas: The system will greatly
more time for the administrator to manage the institute. This will also be
applicable with the senior high school department of the said institute.
Multiple educational institutes can adopt the system and benefit by having
The system is built to support scheduling for levels lower than college.
For the Researcher: Developing the system will greatly help the
of multiple algorithms. It will also help provide a step for the growing
the portfolio which can display the skills of the researcher in tackling
complex problems.
5
For Future Researchers: Researchers can use this research as a
source for their research. They may use this approach on solving
Conceptual Framework
software wherein you input basic data sets and it will output a structured
Feedback
6
another step is added after evaluation which is adjustment of
environment.
greedy approach where a random point will be selected and act as starting
point and then start filling up the table with any entity that would fit.
to the desired solution. It also triggers the ending process given that a
7
subject placement, lunch break, section rest, section idle time, instructor
user. The evaluation matrix is a set of constraint weights that has the
Name Function
of session
8
Attempts to at least give instructors a 30-
of session
date selection.
Computing the total fitness would use the formula below where:
= 𝑐ℎ𝑟𝑜𝑚𝑜𝑠𝑜𝑚𝑒, 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛𝑠 𝑓𝑜𝑙𝑙𝑜𝑤 𝑡ℎ𝑒 𝑒𝑣𝑎𝑙𝑢𝑎𝑡𝑖𝑜𝑛 𝑚𝑎𝑡𝑟𝑖𝑥 𝑏𝑒𝑙𝑜𝑤 𝑎𝑛𝑑 𝑓𝑊 𝑖𝑠 𝑒𝑣𝑎𝑙𝑢𝑎𝑡𝑖𝑜𝑛 𝑤𝑒𝑖𝑔ℎ𝑡
𝒇𝒊𝒕𝒏𝒆𝒔𝒔(𝒙) = (𝑔(𝑥) ∗ 𝑔𝑊) + (ℎ(𝑥) ∗ ℎ𝑊) + (𝑖(𝑥) ∗ 𝑖𝑊) + (𝑗(𝑥) ∗ 𝑗𝑊) + (𝑘(𝑥) 𝑘𝑊)
Subject Placement
the subject placement. Computing this would use the formula below
where:
9
Lunch Break
throughout the week. Attending section days are evaluated and tagged
Section Rest
dictated by the rule that there should be at least a break for every three
formula below:
subject to subject of sections. The section idle time makes use of modified
removed, therefore gives a section free 30 minutes of rest time for every
three hours of session present in the day. This stage also respects lunch
10
break and section rest. Therefore, idle time is computed using the formula
below:
𝒊𝒅𝒍𝒆 𝒕𝒊𝒎𝒆
= 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑣𝑎𝑐𝑎𝑛𝑡 𝑡𝑖𝑚𝑒𝑠𝑙𝑜𝑡𝑠 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 𝑓𝑖𝑟𝑠𝑡 𝑎𝑛𝑑 𝑙𝑎𝑠𝑡 𝑠𝑒𝑠𝑠𝑖𝑜𝑛 𝑜𝑓 𝑡ℎ𝑒 𝑑𝑎𝑦
− 𝑎𝑙𝑙𝑜𝑤𝑒𝑑 𝑏𝑟𝑒𝑎𝑘𝑠
If idle time is more than zero for the day, then it should be tagged
with excess rest. We can therefore compute the fitness of section idle time
by:
Instructor Rest
is dictated by the rule that there should be at least a break for every three
formula below:
instructor load. This takes into account the fact that instructors may have
a mutual subject pool with other instructors. The following formula below
11
𝒊𝒏𝒔𝒕𝒓𝒖𝒄𝒕𝒐𝒓 𝒍𝒐𝒂𝒅(𝒊𝒏𝒔𝒕𝒓𝒖𝒄𝒕𝒐𝒓)
∑ 𝑖𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑜𝑟 𝑙𝑜𝑎𝑑(𝑖𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑜𝑟𝑠)
𝒇𝒊𝒕𝒏𝒆𝒔𝒔 =
𝑡𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑎𝑐𝑡𝑖𝑣𝑒 𝑖𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑜𝑟𝑠
Meeting Pattern
meeting patterns. There are only currently two (2) defined meeting patterns
which is “MWF” and “TTH”. Calculating the fitness follows the formula
below:
the process of changing running variables to cater for better results. This
adjustment.
12
Population Alignment
of solution, the operator using the system can change the running
𝒄𝒉𝒂𝒏𝒈𝒆(𝒙)
∗ 𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝑐𝑜𝑢𝑛𝑡
change. Mutation rate adjustment happens when the trigger which is set
13
After evaluation, chromosomes are picked to participate for
picked. This is where the survival of the fittest comes. There are multiple
ways of selecting chromosomes all of which have their pros and cons.
Having the most appropriate type of selection will help avoid early
population but capped at twenty five (25). The tournament will run until
enough pairs are picked. The following example below shows a simulation
#1 4.1 TRUE
#2 3.4
#3 5.6 TRUE
#4 7.5
#5 6.5
#6 1.2
#7 3.5 TRUE
#8 2.8 TRUE
14
#9 7.5
#10 1.1
Winner: Chromosome #3
chromosomes after crossover would total into 100 which is the population
use the most appropriate one to have better outcome. Davis’ order
works by taking the gene cluster of first parent into the offspring and then
wrapping the gene cluster of second parent into the offspring. For each
reversed to produce different offspring. All offspring will take their parent’s
15
Mutation is a genetic operator that helps maintain the variety of
solutions. It can also prevent solutions from being stuck in local optima.
mutation rate is low and fixed. However, adaptive genetic algorithm means
population.
end criteria, the top 5 fittest chromosomes will be displayed for user
review. The user may pick any from the proposed solution and get its
algorithm that involves keeping the best set of solutions over next
generations to preserve high level solution but at the same time, variables
16
Computing the schedule would involve validation for each
constraint. Constraints are set of rules that directs the acceptance of the
to the validity of the output. However, this can only be broken if the
solution if broken.
Students should
17
Instructors should
Sections should have
Instructors can only take have normalized
at least 30 minutes
N amount of subjects distributed load
vacant time for every
dependent to their based on the
3 consecutive hours
maximum amount of load instructor pool of
of session
subjects
Instructors should
have at least 30
consecutive hours of
session
available schedule
laboratory subject
schedule that is
participants
18
Rooms can only take class
type
depending on its
configuration
an instructor if there is a
configuration
special feature of sharing subject with other sections and the scenario
types of output; using the result viewer of the application which can view
the top five solutions of the last generated scenario and exporting the
selected solution which will produce three comma separated values (CSV)
files. Tests for reliability and performance of the program specifically the
evaluation for the performance of the artificial intelligence will come from
Piñas. The application will be using the Python language. The research will
19
be conducted during the second and third trimester of the school year
solution for the scenario. The quality of the result relies heavily on running
preference. Due to its stochastic nature, results may vary from poor to
excellent. The system does not guarantee that every solution’s hard
meet hard constraints. Hard constraints are bound to be followed and will
CSV Formatting
All CSV files should use line 1 of the file as file indicator. These
second line of the file should be used for defining table columns in same
20
1. Instructors – name, hours
Name of the
name String
instructor
Serviceable hours
hours Integer (1-100)
per week
21
Example Importable CSV File
first_trimester_subjects.csv
subjects
code,title,type,hours,splittable
ENGL101,Communication Skills 1,lec,3,1
MATH101,College Algebra,lec,3,1
MATH110,College Trigonometry,lec,3,1
CS101,Introduction to Computing,lec,2,1
CS101L,Introduction to Computing,lab,2,0
for genetic algorithm which can cause performance issues and improper
result if tweaked wrongly. Computers that will run the system should
not liable for any 3rd party damages that may occur due to inappropriate
use.
1 GB*
*This still relies on the scenario size and
RAM:
algorithm configuration see Chapter 5 for
assessment of consumption.
At least 1 GB Available Space*
usage.
22
Genetic Algorithm Settings
one for all type where it can cater every scenario. This is due to the
following table below shows the description and recommendation for each
23
hundred (100), the peak consumption of
24
The threshold value for triggering
25
chromosomes will be preserved until the
premature convergence.
chromosomes.
computation of space consumption does not fully depict the actual usage.
26
Definition of Terms
Operational Terms:
unsupervised.
solution.
27
Mutation - A genetic operator used to maintain genetic diversity from one
Technical Terms:
an organism.
Gene – Sequence of DNA which codes for a molecule that has a function.
genome of an organism.
traits.
28
CHAPTER 2
finding the best solution is hard when the search space goes big. Knowing
possible solutions for the problem is also needed as it might show some of
1. Operations Research
the book published in IBS center for management research [2] it is stated
responsible for the process and quality of work. It is said that scheduling
and Nada R. Sanders [3], they said that the theory of constraints is that the
29
2. Common Scheduling Conditions in the Philippines
university’s newly imposed scheduling rule. The classes were made earlier
and a break of fifteen (15) minutes were given between each subject. It is
said that it was implemented in order to give students time to prepare for
the Philippines written by Anne Marxze Umil [5], many institutes still lacks
classrooms and teachers. This also includes private schools who had to
Illiana Tan, it has showed the dismay of students who cannot create a
30
3. How Humans Solve Complex Problems: The Case of the Knapsack
Problem
of finding the subset of items with the highest total value from a set of
items with given weight and value subject to weight constraint. In the
Murawski and Peter Bossaerts, it is found that humans solve the knapsack
eighty one (1,381), the chance of getting the most optimal solution is
merely a 0.7%. The results of the study have shown that humans
performed extremely well with a median score of 97.4% of the most optimal
solution value. However, it is worth noting that just because humans can
solve knapsack problems with an optimal solution, it is not the same case
31
defining organization’s computer scientist, Paul E. Black [11], NP-Complete
other NP problems too. In an article by J.D. Ullman [12], he said that finding
Complete problem.
study on subject matter by Ahmed Wasfy and Fadi A. Aloul [13]. There are
Ellis Cohen and Jarurat Ousingsawat [14]. Some are only feasible up to
certain level such as the constraints they can handle, objectives to meet
and sometimes mixed with search algorithms such as greedy and genetic
32
6. Genetic Algorithms: An Overview
problems and to model evolutionary systems. The vast search space has
inspired the creation of genetic algorithm. Biological entities over the years
then become part of the early waves of artificial intelligence wherein rules
and behavior are manually encoded. The algorithm is still in use in modern
evolving a set of solutions into better ones. Each solutions are often
Having a good and proper conversion will definitely help in computing the
solution.
33
score on how did each solution perform. In order to continue into next
It can either lead to fast good or bad convergence. However, the selection
of the parents mimicking the biological reproduction. There are many ways
on how to perform crossover but just like selection, each of them has their
own pros and cons. Some of these crossover types are standard crossover
using N-points, shuffle, discrete, uniform, order based and many more
according to A.J. Umbarkar and P.D. Sheth [19]. Order based crossover is
34
10. Genetic Algorithm Essentials, Studies in Computational Intelligence
according to O. Kramer’s study [20]. Usually, a fixed value for mutation rate
is used but adaptive variety of genetic algorithm may change the value
biggest challenge often because bad schedules leads to students and other
party’s dismay. Solving the problem using only pure man work maybe
efficient enough but it will not scale up. To solve this problem, computing
the schedule using the right algorithm and constraints is a must. Genetic
35
Windows – The application should be able to support 800x600
elements.
interaction.
36
CHAPTER 3
research.
The selected method for collecting and analyzing data for testing the
profiled after being used in the system. The profiling results shall
This enables the developer to learn every iteration and apply it to future
instance. This methodology is fit for the research as the system relies on
37
tweaking and managing constraints. Each iteration is an enhancement to
the system which will repeat until the system delivers its expected result.
done is decided and planned. There are two types of iterations used;
tweaking the initial value and trying to produce a solution from it.
38
The surrogate modelling is often used in science and engineering
used instead. An example of this is finding the optimal design for a car’s
behavior of real model as closely as possible without the need for a more
expensive evaluation.
as basis.
39
evaluation matrix. The model will serve as a basis for evaluating the
be gathered are the ones to be used by the evaluation above which will be
40
CHAPTER 4
method has presented multiple data for interpretation. The following figure
below shows the chain of data collection and evaluation methodology for
one model:
There will be three (3) models to be used listed on the table below.
For each model, there will be three (3) scenarios. For each scenario, there
note that there will only be one time generation of random values for
settings and the three (3) generated values will be used all throughout the
scenarios to prevent bias in result. For every setting, there will be five (5)
41
generated result set. In total, there will be 135 solution set for evaluation
Name Matrix
Subject Placement 16%
Lunch Break 0%
Section Rest 0%
Instructor Rest 0%
Meeting Pattern 0%
Lunch Break 0%
Meeting Pattern 0%
42
The randomization has a set amount of possible values based on
Name Limit
Entry Matrix
43
Maximum
64 Elite Population 6%
Generations
Maximum
Attempts
Minimum
Mutation Rate Adjustment
Population 79 .05
Trigger
Count
Maximum
#2 Count
Maximum
89 Elite Population 7%
Generations
Maximum
Attempts
Maximum
96 Maximum Fitness 95%
Population Count
#3 Maximum
63 Elite Population 2%
Generations
Maximum
Attempts
44
There are three (3) scenarios prepared for the evaluation. The three
Computer College Las Piñas have (Appendix C) for CS, IT and CpE courses.
Each scenario have 91, 93 and 95 entities respectively. These entities are
active instructors, rooms, subjects and sections. Each model below shows
computation of min, max and average of total fitness of each result from
all settings.
Name Matrix
the maximum possible solution. The distribution of priority has made the
artificial intelligence have hard time balancing all the constraint. The table
45
below shows the performance of the algorithm to each scenario in
(Settings 2)
(Settings 2)
(Settings 2)
Name Matrix
Lunch Break 0%
Section Rest 0%
Instructor Rest 0%
Meeting Pattern 0%
Being one of the easiest model, the artificial intelligence was able to
adapt easily as it does not have to worry about other constraints when
46
placing entities. It has showed its superiority on initializing the population
(Settings 1)
(Settings 1)
(Settings 1)
Name Matrix
Lunch Break 0%
Meeting Pattern 0%
in terms of software capability was able to assess solutions that are much
47
better than the first model despite having the same nature of balance in
(Settings 2)
(Settings 2)
(Settings 2)
The models have shown that the artificial intelligence was able to
cope up with the problem. Each settings has produced varying answer
but have shown that from the data gathered, higher settings can produce
48
CHAPTER 5
Summary of Findings
models, the system was able to generate solutions that have at least 80%
fitness (basing on set of highest solutions per scenario). The problem lies
the algorithm was able to cater for majority of the entries on the evaluation
matrix.
The lack of testing in models and the amount of model itself does
not show the exact capabilities and limitation of the system. With
generation of results from one (1) model, three (3) settings and one (1)
scenario taking almost an hour, there is only a limited amount of data that
can be used for evaluation. However, it is fair to say that the system has
algorithm’s configuration.
was limited, therefore, the system was not able to perform at its peak. The
49
tremendous amount of possible combinations for generation of the system
Conclusion
The results have shown that the system can provide valid solutions
that can be used. However, it does not provide complete automation. There
are still scenarios that would require the operator to adjust some entries
easily use and experiment with the application until they find perfect fit
the system was able to generate results that despite being imperfect still
50
remains valid and acceptable given the number of constraints imposed to
it.
The solutions that the system will provide will heavily depend on
the running configuration and evaluation matrix. One may find a perfect
solution if the application was given enough time and computing power.
The complete evaluation for the system will remain hard to solve as the
freedom for the configuration of the algorithm has provided a large amount
Recommendation
problem. However, this does not mean that it should be used for every case
where more constraints are being implemented than the available ones in
timetabling solution for more complex and constraint needs until further
51
Bibliography
from https://www.universalclass.com/articles/business/the-usage-
of-operations-management.htm
http://www.icmrindia.org/courseware/Operations%20Management%
202nd%20Edition/Operations%20Scheduling.htm
www.csus.edu/indiv/b/blakeh/mgmt/documents/opm101chapter15
_000.ppt
[4] Althea Gonzales and Jessy Go, “Earlier classes, longer breaks draw
http://thelasallian.com/2014/06/10/earlier-classes-longer-breaks-
draw-mixed-reactions/
[5] Anne Marxze Umil, “New school year, same old problems: K to 12,
http://bulatlat.com/main/2017/06/06/new-school-year-old-
problems-k-12-shortages-classrooms-teachers/
[6] Paulyn Navarrete and Illiana Tan, “Persistent issues faced during
http://thelasallian.com/2015/01/29/in-review-persistent-issues-
faced-during-enlistment/
[7] Careen L. Malahay and Tweeny M. Malinao, “Elementary school
http://newsinfo.inquirer.net/207699/elementary-school-shortens-
classes-to-accommodate-pupils
http://math.ucdenver.edu/~sborgwardt/wiki/index.php/Knapsack_P
roblem_Algorithms
[9] Carsten Murawski and Peter Bossaerts, “How Humans Solve Complex
from https://www.nature.com/articles/srep34851/
https://dl.acm.org/citation.cfm?doid=358141.358144
https://xlinux.nist.gov/dads/HTML/npcomplete.html
Retrieved from
http://www.sciencedirect.com/science/article/pii/S0022000075800
080
[13] Ahmed Wasfy and Fadi A. Aloul, “Solving the University Class
http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=83CF2A33
80EB4E45C5B2241036C7FAE2?doi=10.1.1.140.3740&rep=rep1&typ
e=pdf
[14] Ellis Cohen and Jarurat Ousingsawat, “An Introduction to
solving-schedule-related-problems
https://link.springer.com/article/10.1057/jors.2012.174
Retrieved from
http://ohm.ecce.admu.edu.ph/wiki/pub/Main/ResearchProjects/mit
chell_GA_tutorial.pdf
https://pdfs.semanticscholar.org/1db9/a59ebe9b4808722fee55601b
eb8e2eda5064.pdf
https://www.researchgate.net/publication/259461147_Selection_Me
thods_for_Genetic_Algorithms
http://ictactjournals.in/paper/IJSC_V6_I1_paper_4_pp_1083_1092.p
df
[20] O. Kramer, “Genetic Algorithm Essentials, Studies in
www.springer.com/cda/content/document/cda_downloaddocument/
9783319521558-c2.pdf
https://msdn.microsoft.com/library/windows/desktop/dn742479.as
px
Appendix A
Letters
Appendix B
Title Proposal
Appendix C
College Curriculums
Appendix D
Sample Output
Appendix E
Program Listing
Appendix F
Application Results
Appendix G
Gantt Chart
Appendix H
Curriculum Vitae
Appendix I
Final Permit