optimisationofschool
timetables
MartinKlemsa,cofounderofSkolaris
Abstract
Thecommunityoftimetablersseemstobeskepticalaboutamachinesabilitytogenerateabetter
timetablethanaperson.Thispaperpresentsargumenttothecontrary.Chapter1focuseson
analysisofreasonsfortheskepticism.Amethodicalapproachtotimetablequalityassessmentis
outlinedtogetherwithageneraldiscussionaboutthetheoreticalabilityofbothmachinesand
peopletofindafeasibletimetable.Chapter2summarizesthemethodologiesusedforautomatic
timetablingexperimentsandtimetablecomparison.Chapter3presentstworealschoolexamples
thatshowimprovementofthetimetablequalitywhenautomaticoptimisationisapplied.
1.Theoryandpracticeoftimetablecreation
1.1Introduction
Theschooltimetablingproblemisawellknownandwellstudiedexercise.Researchersand
programmershavebeentacklingitfordecades,timetablersatschoolsforevenlonger.Forthe
formeritconstitutesaspecificoptimisationproblemofhighcomplexityforthelatterataskto
whichawidespectrumoflabelsisinevitablyattached,rangingfromasummerdrudgerytoaform
ofart.
Astimetablershavetooverseeamultitudeofinterlinkedconstraintswhileassemblinga
timetable,naturallytheyturntosomekindoftimetablingsoftwaretohelpthemwiththedifficult
task.Suchhelpintheformofaclashcheckingtooltheycherish.Itguidesthetimetablers'hands
toplacethenextlessonatavacantspotforboththeclassgroupandtheteacher,andthenintoa
vacantroom,andsavesthemtime.Inessence,thisisacomputeraidedmanualtimetabling.
Someestablishedandwidelypopulartimetablingtools(e.g.aScTimetables,Untis)offer
automatedtimetablingthataimsatgeneratingatimetablefromgivenbasedatawithlittleorno
helpfromthetimetabler,butbecauseovertheyearsmanysoftwarepackageskeptfailingat
completingthetask,thetimetablersbecameskepticalandsettledforusingthemfor
clashcheckingonly[1,2,4,15].Theprocessoftimetablecreationhasinnatureremained
manual.Thisgaverisetoskepticismabouttimetablingprogramsingeneral,incarnatedin
statementssuchas
1. ourschool'stimetableissocomplexthatnosoftwarecangenerateit[1,3]or
2. thetimetablegeneratedbyacomputerisunusableorinferior,becauseitlacksthequalities
apersonalwaysincorporatesintotheschedule[4].
Theseopinionsseemtobedeeplyrootedwithinthecommunityandpassedonfromone
timetablertoanother.Letsexaminethem.
1.2Timetablequality
Statement(2)highlightsthequestionoftimetablequality.Timetablersusuallyrelyonintuitionand
experiencetoevaluatethequalityofatimetable,andtheextenttowhichitsatisfiesthe
requirementsandpreferencesoftheschool.Inotherwords,theirevaluationissubjective.If
automaticschedulingistobecarriedoutbyamachine,amorerigorous,objectivemethodof
evaluationmustbefound.Onepossibilityistheobjectivefunctionapproachdescribedby
Schaerf[5].Itestablishesasystemofpenalties,whereeachflaw1 isassignedapositivepenalty
value,orweight.Thewholetimetable'squality(fitness)isthencalculatedasthesumofpenalties
forallflawsoccurringinthetimetable,withtheperfecttimetablehavingafitnessvalueofzero.
Configuration(assigningweightstoflaws)mustbedonebythetimetablerpriortotheassessment
basedonindividualprioritiesoftheschool.
Commonflaws
Apartfromclashesandotherrulesthatmustbeobserved(hardconstraints2seeChapter2),a
goodtimetableshouldpossesscertaincommonproperties(aspectsorsoftconstraints):
Balancedsubjectdistributionthroughouttheweek(e.g.ifasubjecthastwolessonsper
week,theseshouldnotoccuronconsecutivedays)
Diversesubjectsequenceforpupils(e.g.twolanguageclassesshouldnotfolloweach
other)
Observationofclassroom(room)assignmentpreferences
Observationofteachers'schedulepreferences
andmore(seeChapter2)
Failuretoobserveanaspectcreatesaflaw.Thisisverycommonandtimetablescontainlotsof
them.Minimisingtheirquantityisthegoaloftimetableoptimisation.
Thepenaltiesintroducedaboveareeasilyevaluatedbyamachine.Thisevaluationisobjective
andaccurate,andthequalityofeachtimetablecanbeassessedquickly.Becauseactual
timetablescontaindozensorhundredsofflaws,dependingonthesizeoftheschool,thisgives
machinesadistinctedgeoverpeopleintimetablequalityassessmentandcomparison,provided
thatalldesirableaspectsarecorrectlyrecognizedbythemachineandconfigured.Foranytwo
giventimetablesbasedonthesamedata,amachineisabletoimmediately3decidewhichis
better.
1
Anundesiredsituationintheschedule,e.g.alessonplacedinaroomotherthanapreferredone.
2
E.g.alessonplacedinaroomwhichisunavailableatthescheduledtime,ateacherteachingtoomanyconsecutive
lessonsetc.
3
Thisisimportant,becausetheabilitytocomparetimetablesquicklyisparamounttothemethodusedbySkolarisfor
timetableoptimisation.
However,whilebeingabletotellagoodtimetablefromabadoneisaprerequisite,itdoesn't
implytheabilitytocreateit.
1.3Timetablefeasibility
Statement(1)ismoreconcernedwithfindingafeasibletimetable.Thistaskisquiteseparatefrom
thetaskofevaluatingthesuitabilityofanexistingtimetable.Theproblemitselfhasbeenshownto
belongtotheclassofthemostdifficultoptimisationproblems4 (NPcompleteinmathematical
complexityterms).
Whatisinterestingaboutitisthefactthatwheremachineshavestruggled,thetimetablers
alwaysproduceafeasiblescheduleotherwiseschoolswouldn'tbeabletofunction.
Forlargeschoolsorthosewithlotsofrules,thetraditionallyconstructedgenerationtoolswill
usuallyfailtoproduceacompletetimetableunlesssomeoftherulesarerelaxedorignored.
However,thisisalsotrueformanualtimetabling,astheexamplespresentedinChapter3
demonstrate.Whenintrouble,timetablersusuallybreakorbendafewrulestheyhadimposed
originally,inordertoachieveafeasibleresult.
Thetaskofdecidingwhichrulestomodifyinordertoachieveacompletetimetableisafar
fromsimpleone,however.Thebestruletobendorignoreinanycircumstanceishighly
dependentonthestateofthetimetableatthatparticulartime.Thismightbeimportantwhenusing
agenerationbasedtool,becauseevenaftertellingthemachinetobreakcertainrules,itmaystill
failtoproduceatimetable,simplybecausethoseruleswerespecifictothestateinwhichthe
timetablehadbeen before
theywereallowedtobebroken5 .Thusthebeliefin(1)maybe
reinforcedwitheveryiterationoftimetablecreation,eventhoughtheshortcomingsofbothmanual
andautomatedapproachcouldactuallybeequal.
Anewhope
Relativelyrecentresearchonlocalsearchtechniques,suchas[5],offersamorepowerful
approachtoobtainingfeasibilitythanthetraditionalalgorithmsbasedonincrementalgeneration.It
alsoprovidesahighlysuccessfultheoreticalmechanismforsolvingschooltimetablingproblems.
Thisapproachcombineswellwiththetimetableevaluationoutlinedinsection1.2andallowsthe
optimisationtostartfromanystate,makingitanexcellentchoicenotonlyforautomatic
optimisationbutalsoforinteractivetimetabling,particularlywhenthetimetablerdecidestobreaka
fewrules.
Nomatterhowpowerfultheapproach,thecomplexnatureoftheproblemremains.Some
methodsaremoresuccessfulthanothers,butnoonecanclaimtohaveageneralrecipefor
findingatimetablewheneveritispossible,orevenverifyingthatsuchpossibilityexists.The
importantthingistoprovideanalgorithmthatoffersareasonableprobabilityofgeneratinga
feasibletimetable(andoptimisingit)withinreasonabletimeframe.AsshowninChapter3,
Skolarisdoes.Moreover,itisabletoprovidehighqualitysolutionswithwhichmanuallycreated
timetablescanhardlycompete.
4
Inshort,onewouldhavetoexamineallcombinationstofindtheoptimalsolution.
5
Themachinewouldprobablybeabletofinishthetimetablefromthatstatewereitabletostartfromit,whichisnot
alwaysthecase.Reachingitfromanemptyschedulehasofcourseaprobabilityclosetozero.
1.4Schoolreality
Therearemanyreasonswhytimetablerswhodotheirworkcompletelymanually,orusea
softwaretoolthatcannotgeneratethetimetableforthem,canbereluctanttotryoutanewone.
Thesecanbedividedintotwocategoriesobjectiveandsubjective.
Objectivereasons
Objectivereasonsarethosewhichareunrelatedtothetimetablersthemselves.Theseare
primarily
lackofintegrationwiththeschool'scurrentinformationsystem,
bureaucraticobstacles(Theheadmasterdoesnotwishit.[6],Theeducationdepartment
recommendedtheschooltobuyaninformationsystem[withoutpropertimetable
generation]andwecannotuseothersoftware.[7])and
lackofresources(Wecannotafforditatthemoment.[8]).
Note:Ifthesolereasonfornotadoptingatimetablingsoftwareisthelackofintegration,oneshouldconsiderthe
factthatmanuallycopyingagoodtimetable,whileextremelyinconvenient,isstillmuchfasterandmore
worthwhilethanmanuallyassemblinganinferiorone.
Subjectivereasons
Subjectivereasonsarebasedonthebeliefsandexperienceofthetimetablers.Theyinclude
badexperiencewithtimetablingsoftware(Sofarnosystemwasabletoincorporateallour
conditions.[9]),
unverifiedclaims(Iamconvincedthat[manual]timetablecreationwillbefasterthan
inputtingrequirementsintoasoftware.[10],Beforeweinputalltheconstraints,subgroup
specificsandrequirementsetc.intoanyprogram,wehavethetimetablefor1500pupilsand
55classgroupsfinished[manually].[11]),
prematuredoubtsaboutthesoftwarecapabilities(Yoursystemmostcertainlycannot
createindividualtimetables...[12],Webelievenosystemisabletoacceptourspecific
data[16]),
appreciationofthechallenge(Ienjoyspendingtwoweekscreatingthetimetable.[2])and
satisfactionwithcurrentstate(Oursoftwarecannotgenerateourtimetablebutwe'reused
toit.[1,2,8],Ourschoolissmallsoourmanualapproachisgoodenough.).
Thereareevenschoolsthatoversimplifythetasktobeabletomanuallycreatetheschedule.
Thesedon'tconsiderrequestsfromtheteachersconcerningtheschedule[13],orevenuse
unsuitableclassgroupdivisions(onedivisionforbothforeignlanguagesandPhysicalEducation
sothatalanguagelessonforonesubgroupcanbescheduledsimultaneouslywithaPElessonof
theothersubgroup[13].Thisdisregardsdifferentpupiltalentsandneedsineitherthelanguage
lessonsorPElessonsorboth).
Inthesecases,reluctancetousetimetablingsoftwarethatmightoptimisetheschedulemay
leadtounnecessaryreductionofqualityoflifefortheteachersand,what'smoreimportant,alower
qualityofeducationforthepupils.
Changingtheview
Allthepresentedreasonsarebasedonwhattherealityhasbeensofarandnotheoretical
argumentislikelytopersuadethepeopleinvolvedotherwise.Tochangethetimetablers'viewitis
necessarytodemonstratethat,withSkolaris,schedulescannotonlybegeneratedautomatically,
butthattheycanindeedbesignificantlybetterthanthemanuallycreatedones.Unfortunatelymost
schoolsarenotinterestedininvestingtime(bysharingenoughdetailsabouttheirschedule)in
whatisfromtheirpointofviewafutileundertakingandwasteofhumanpotentialandresources
[14](arguablybecausepreviousattemptshavefailed),soautomatictimetablegenerationand
subsequentcomparisonareimpossible.Chapter3presentshighlyinterestingresultsfortwovery
differentschoolsthatwerewillingtotry.
2.ExperimentalMethodology
2.1Qualityassessment
Asmentionedabove,thequalityofafeasibletimetablecanbeassessedautomaticallyby
assigningapenaltyweighttoeachaspectoftheschedule.Aspectscanbedividedintoseveral
basiccategoriesbasedontheentitiesaffectedbytheaspect.
Classgroupaspects
Theseaspectsdeterminethequalityofthescheduleforaclassgroup.
Aspect Description
Subjectdistribution Balanceddistributionoflessonsofthesamesubjectthroughoutthe
week.Innocasetheyshouldoccurtwiceaday.Iftherearetwoor
threeperweek,theyshouldnotalloccuronconsecutivedays.If
thetimetablespansmore(orless)thanfivedays,balance
calculationismorecomplexbutfollowssimilarprinciples.
Subjectsequence Twolessonsofthesamesubjectcategoryshouldnotfolloweach
other.Detailsaboutcategoryassignmenttoeachsubjectaregiven
separatelyforeachsampleschool.
Lessondistribution Balanceddistributionoflessonsthroughouttheweek.Itis
desirableforpupilstospendmoreorlessthesametimeatschool
everydaytopreventdaysthatwouldbetooshortortoolong(in
otherwords,deviatetoomuchfromtheaveragenumberoflessons
perday).(Aruleatsomeschools.)
Early/latestarts Pupilsshouldstartatthesametimeeveryday.(Aruleatsome
schools.)
Latelessons Pupilsshouldnotfinishschooltoolateintheafternoon(relativeto
theaveragenumberoflessonsperday).Itisrelatedtothelesson
distributionaspect.
Asitisalwaysgoodtoobservetheseaspects,failuretodosocreatesobjectiveflaws.Thelesson
distributionandearly/lateaspectsdonotapplyateveryschool.Someschoolsrequirethateach
daysclassesstartatthesametime,somerequireforeachdaytohaveapredeterminednumber
oflessons.Inthesecasestheaspectsbecomerulescontributingtothetimetablefeasibilityand
canbeomittedduringthequalityassessmentoffeasibletimetables.
Teacheraspects
Theseaspectsdeterminethequalityofthescheduleforateacher.
Aspect Description
Teachingatundesiredtime Teachersareallowedtospecifytimesatwhichtheyprefernotto
teach,forvariousreasons.Itisdesirableforascheduletorespect
theseasmuchaspossible.
Gaps Numberoftimesadayateacherhasoneormorefreeperiods
betweentwolessons.Forthepurposeoftheexperimentsatleast
onegapperdaywasallowedforeachteacherwithoutincurringa
penalty.
Gaplength Thenumberoffreeperiodsconstitutingagap.Allowedgaplength
isdefinedseparatelyforeachsampleschool.
Veryshortdays Itmightbeinconvenientfortheteacherstocometoschoolto
teachonlyalimitednumberoflessons.Averyshortdaywas
definedasoneinwhichateacherteachesonlyonesingleperiod
lesson.
Interbuildingtransits Itmightbeinconvenientfortheteacherstomovefrequently
betweenbuildingsduringtheday.Twosuchmoveswereallowed
withoutapenalty,whichrepresentsstartingatonebuilding,going
toanotherbuildingforanumberoflessonsandthenreturningto
theoriginalbuilding.
Theteacheraspectslistedabovemaynotnecessarilyapplytoallteachers,andfailuretoobserve
themmaynotalwaysresultinanobjectiveflaw.Skolarisofferstheabilitytoconfigureeach
teacherindividuallysothattheirschedulesreflecttheirpreferences.Forthepurposeofthe
experimentsallteachersweresetupequally,basedonthegeneraltendenciesinthemanual
timetables,withtheexceptionoftimeavailabilitiesthatreflectedtherealindividualrequirements.
Otheraspects
Theaspectslistedbelowdonotfallintoanyoftheabovecategories.
Aspect Description
Subjecttaughtatundesired Somesubjectscannotorshouldnotbetaughtatspecifictimes,for
time variousreasons.Forexample,itmaybedesirabletoavoid
schedulingcertainsubjectsinthefirstorlastperiodoftheschool
day.
Lessonsatundesiredtime Sometimeslotsshouldnotbeusedforteachingunless
necessary.Theseareusuallyearlyinthemorning(ifapplicable),
orverylateintheafternoon.Thisaspectoverlapswith
entityspecifictimerelatedaspectssuchasteacherundesiredtime
orclassgrouplatelesson.
Lessonsinundesiredroom Thereareusuallycompetingroompreferencesforeachlesson.A
classgroupmightpreferoneroom,ateacheranother,andalso
subjectscommonlypreferaroom.Inevitablythesepreferences
clash.Thisisresolvedusingweightstospecifywhichpreferenceis
moreimportant.Ifthemostimportantpreferenceismet,theaspect
istreatedasobservedfortheparticularlessonandthereisno
penalty.Otherwisethepenaltyismultipliedbyaprecalculated
importancecoefficient(between0and1),sothatplacingthe
lessonintheleastpreferredroom(orinaroomthatisnot
preferredatall)producesthehighestpenalty.
Theseaspectsshouldalwaysbeobservedand,aswasthecasewithclassgroupaspects,failures
resultinobjectiveflaws.
Aspectweightsandtotalpenalty
Inthechartsaccompanyingtheexperimentalresults,thepenaltyforeachaspectisrarelyequalto
theflawcountmultipliedbythedesignatedweight.Thishasvariousreasons:
Penaltycalculationforclassgroupflawstakessubgroupsintoconsideration.
Lessonpenaltiesareinfluencedbythenumberofclassgroupsandteachersinvolvedinthe
lesson.
Somesuitablepenaltiesareincreasedwiththeflawmagnitude(e.g.wheneveragap
exceedstolerablelength,thepenaltyincurreddependsonthedifferencebetweenthe
actualandtolerablelength).
Allaspectsconcerningtimeavailability(e.g.undesiredtimeforclassgroups,teachers,
subjects)dependontheactualavailabilityvaluebetween0(completelyunavailable)and
100(fullyavailable)foreachtimeslot.6
Thesenuancesaredesignednotonlytoincreaseassessmentcorrectnessbutalsotoimprove
flawelimination.Thecompletedetailsarebeyondthescopeofthispaper.
2.2Optimisation
SkolarisSmartoptimisationalgorithmwasusedtogenerateandoptimisethetimetablesforeach
school.Theautomaticgenerationstartedfromanemptytimetableunlessstatedotherwise.
AdesktopcomputerwithIntelCorei74790Kprocessorat4GHzwasusedforall
computations.RAMusagedidnotexceed300MB.
6
ThismechanismallowstheSkolarisusertospecifytimeprioritieswithratherfinegranularity.
Reachingfeasibility
Feasibilityratioistheprobabilityofreachingafeasibletimetablebythealgorithm.Itwas
establishedbyperformingmany feasibilityonly7runs.Exactnumbersandconfigurationdetailsare
presentedlaterforeachsampleschool.
Hardconstraintscontributingtofeasibility
Constraint Description
Timeorroomunbooked Alllessonsmustbebookedintimeandplace.
Classgroup,roomorteacher Noneoftheresourcesassignedtoalessonmustbe
clash doublebooked.
Classgroup,room,subject, Allresourcesassignedtoalessonmustbeavailableatthe
teacherortimeslot scheduledtimeofthelesson.
unavailable
Classgroupgaps Theremustbenogapsinclassgroupschedules(withthepossible
exceptionofalunchbreak).
Classgroupminimumand Aclassgroupmustbetaughtatleast(atmost)thespecified
maximumperiods8perday numberofperiodsperday.Thisisastrongerversionofthelesson
distributionaspectusedsothatafeasibilityonlyrunproducesan
atleastroughlybalancedschedule.
Classgroupmaximum Thenumberofperiodsafterwhichaclassgroupisrequiredto
consecutiveperiods havealunchbreakorfinishtheday.
Teachermaximumteaching Maximumnumberofperiodstaughtbyateacherinoneday.
periodsperday
Teachermaximum Maximumnumberofperiodstaughtbyateacherwithoutagapin
consecutiveteachingperiods oneday.
Teachermaximumworking Maximumnumberofperiodsateachercanspendatschoolinone
periodsperday day.
Lessoninaforbiddenroom Lessonresourcesmayspecifyanabsoluteroompreference.In
thatcasealessonmusttakeplaceinthepreferredroom.Also
certainroomsmayacceptonlycertainsubjects,forexampleagym
usuallyonlyacceptsPhysicalEducationlessons.
Roomcapacity Aclassgroupmustbescheduledintoaroomthatseatsallpupils.
Classgrouplunchbreak Alunchbreakmusttakeatleast(atmost)thespecifiednumberof
minimumandmaximum periods(usuallyone).
duration
7
Disregardingaspects.
8
PeriodsisgenerallymorecorrectthanlessonsbecauseSkolarisallowsdefiningmultiperiodlessons.Ifaschool
usessingleperiodlessonsonly,thewordsperiodsandlessonsareinterchangeable.
Fulloptimisation
Withtheabilitytogenerateafeasibletimetableestablished,fulloptimisationcouldbeattempted.
Theevaluationpenaltieswerechosentorepresentqualityprioritiesapparentfromthemanual
timetables.Detailsaregivenineachschool'srespectivesection.First,afeasibilityonlyrunwas
performed(possiblyrepeatedly)toobtainafeasibletimetable.Itsresultwasusedasastarting
pointforafulloptimisationrun,withallaspectstakenintoaccountbythealgorithm,which
producedthetimetableusedforthecomparison.
2.3Comparison
Foreachschoolboththemanualandautomatictimetableswereevaluatedusingthepresented
aspectsetups.Chartsaregivenseparatelyforeachaspect,aswellasforthetotaltimetable
penaltywhichisasumofpenaltiesforbrokenrulesandallflaws.
3.Experimentalresults
Forthepurposeofevaluatingtheautomatictimetableoptimisation,twoschoolswerechosena
regularsizedprimaryschoolandalargesecondaryschool.Theysuppliedalldatarelatedtothe
timetables(onpaperorbydirectinput)andtheactualtimetablesusedbytheschoolswereputin
manuallyinbothcases.
Allrequiredconditionsliketeachertimerequirementsandrequests,timeslotlimitationsfor
classgroupsandsubjectsetc.wereputinwithkindcooperationoftheschools'timetablers.
TimetablequalitycomparisonchartsshowthemanualtimetablesasOriginal(blue).The
automaticallygeneratedtimetablesaremarkedSkolaris(red).
3.1Regularprimaryschool
Thisschool,locatedincentralBohemia,has23classgroups,43teachers,aweeklyscheduleof
622lessons(ahandfulofwhichareonlytaughteveryotherweek)thatmustbeplacedinto45time
slots(onlyasubsetofwhichisavailabletoeachclassgroup)and34rooms.
Feasibilityonlytestresults
Aspectsetup(orderedbyweight)
Aspect Weight
Classgroupsubjectdistribution(twolessonsofthesamesubjectinoneday) 75
Classgroupsubjectdistribution(spread) 25
Classgrouplessondistribution 15
Teachergaps 10
Teachergaplength 10
Teacherveryshortday 10
Teacherinterbuildingtransits 10
Lessoninundesiredroom 10
Classgroupsubjectsequence 2
Classgroupsubjectdistributionwassetupasthemostimportantaspect.Allteacheraspectswere
giventhesameweight.
Allpupilsstartatthesametimeeachdayasaruleandthelatestallowedperiodforeachday
wasalsoarequirement,soearly/lateaspectswerenotapplicable.Allteachertimepreferences
wererulesaswellandcontributedtofeasibility.
Twogapsperdaywereallowedwithoutpenaltyandthemaximumallowedlengthofeachgap
wassettotwoperiods.
Hardconstraints
Hardconstraintsetup
Constraint Value
Classgroupminimumperiodsperday 4
Classgroupmaximumperiodsperday 9
Classgroupmaximumconsecutiveperiods 6
Classgrouplunchbreakduration 1
Teachermaximumteachingperiodsperday 9
Teachermaximumconsecutiveteachingperiods 6
Teachermaximumworkingperiodsperday 9
Themanuallycreatedtimetablecontainsthreehardconstraintbreaks,allofthemroom
assignmentclashes,whichareprobablysolvedonaweeklybasis.Thisisnoteasythough,as
theyconcerntheschool'sgymnasiums.PossiblyalternatingPElessonsareplacedoutsideor
replacedwithotheractivityonthesethreeoccasionseveryweek,butthishasnotbeenconfirmed
bytheschool.
Skolariswasabletoeliminateallinfeasibilities.
Classgroupaspects
Thetotalnumberofsubjectclassgroupcombinationswas265.
Thesubjectcategoriesweresetupwithoutconsultingtheschool.Minordifferenceswouldnot
changetheresultsignificantly.
Subjectcategories
Category Subjects
Language Anglickjazyk,eskJazyk,Francouzskjazyk,Konverzacevanglickm
jazyce,Nmeckjazyk,Ruskjazyk
(EnglishLanguage,CzechLanguage,FrenchLanguage,EnglishConversation,
GermanLanguage,RussianLanguage)
Humanity lovkajehosvt,lovkaspolenost,lovkasvtprce
(ManAndHisWorld,ManAndSociety,ManAndTheWorldOfWork)
Technical Informatika,Potaovdovednosti
(Informatics,ComputerSkills)
Science Chemie,Fyzika,Matematika
(Chemistry,Physics,Mathematics)
Unclassified Dlny,Hudebnvchova,Osobnostnvchova,Prodopis,Semin
Literrndramatick,Seminprodovdn,Sportovnaktivity,Tlesnvchova,
Vchovakezdrav,Vtvarnvchova,Zempis
(Workshops,Music,MoralEducation,NaturalScience,LiteraryDramatic
Seminar,SeminarOfNaturalScience,SportsActivities,PhysicalEducation,
HealthEducation,Art,Geography)
Teacheraspects
ThelargedifferenceinthepenaltyiscausedbySkolariseliminatinglonggapsmoreeffectively.In
fact,longgapshavecompletelytakenoverthepenaltychart,becausetherewerenotoomany
gapsperdayflawsineithertimetable.Thiscanbecreditedtotheratherforgivingsetupwhich
allowedtwogaps.
Ifonlyonegapperdayisallowed,justforthesakeofanalysis,thepenaltyforOriginal
timetablerisesto300andthepenaltyforSkolaristimetablereaches160.However,itisnotfairto
useasetupthatpenalizesthemanualtimetableevenmore,becauseclearlythisaspectwasnot
theprioritywhilethetimetablewasbeingconstructed.Alsoitisnotmeaningfultojudgeatimetable
createdbySkolarisbasedonasetupthatdiffersfromtheoneusedduringtheoptimisation.
Thisaspectwasprobablynottakenintoaccountatallduringtheconstructionofthemanual
timetableandfromthispointofviewitsweightcouldhavebeenlower9 .Itispresentedhereasan
exampleofapossibleaddedvaluethatautomaticoptimisationcanbringtothetimetablecreation
process.
9
Evenasthingsstanditscontributiontotheoverallpenaltyislessthan3%.
Otheraspects
Summary
TheSkolarisgeneratedtimetablewasfeasible,andbetterthanthemanuallycreatedoneinevery
aspectusedforassessment.Subjectdistribution,subjectsequenceandroomassignmentare
someofthemainaspectswhichcouldvastlyimproveshouldthisschoolopttousean
automaticallyoptimisedtimetable.
3.2Largesecondaryschool
Thisschool,locatedinBrno,Czechrepublic,has55classgroups,82teachers,afortnightly
scheduleof2809lessons(ahandfulofwhichareonlytaughtonceeveryfourweeks)thatmustbe
placedinto130timeslots(onlyasubsetofwhichisavailabletoeachclassgroup)and58rooms.
Ninelessonswerepreallocatedbeforeautomaticoptimisationaspartoftherequirements.
ThesewerefourSpecialPhysicalEducationlessonsandfiveteachermeetings.
Feasibilityonlytestresults
0.80 20 90 4.71
Twoseparaterunswithdifferentaspectsetupswereperformedforreasonsexplainedlater.
3.2.1Run1
Aspectsetup(orderedbyweight)
Aspect Weight
Classgroupverylatestart 100
Classgroupsubjectdistribution(twolessonsofthesamesubjectinoneday) 100
Classgroupsubjectdistribution(spread) 25
Classgrouplessondistribution 5
Teachergap 5
Teachergaplength 5
Teacherteachingatundesiredtime 4
Teacherveryshortday 2
Subjecttaughtatundesiredtime 2
Classgroupearly/latestart 1
Classgroupsubjectsequence 1
Classgrouplatelesson 1
Lessoninundesiredroom 1
Lessonatundesiredtime 1
Themainemphasiswasputonsubjectdistribution,someonteachers'effectiveschedule
(minimisingidletimewhileatschoolandtryingtoobservetheirtimerequests).Theleastimportant
qualitieswereclassgroups'earlyandlatelessons,subjectsequenceandroompreferences.
Themaximumallowedlengthofteachergapswassettooneperiod.
Optimisationsteps
HardConstraints
Thehardconstraintsusedbythesecondaryschoolweresomewhatdifferentfromtheprimary
school.Namelytherewasnoperiodallowedforlunch,whichwasinsteadhandledbyalongbreak
betweenperiodsinthetimeslotsetup.
Hardconstraintsetup
Constraint Value
Classgroupminimumperiodsperday 4
Classgroupmaximumperiodsperday 9
Classgroupmaximumconsecutiveperiods 9
Teachermaximumteachingperiodsperday 8
Teachermaximumconsecutiveteachingperiods 8
Teachermaximumworkingperiodsperday 9
10
Thetimetablepresentedwasfoundafter30hoursand48minutes.Thealgorithmfailedtofindabetterfeasible
timetableintherestofthetime.Thesearchendedwithatimetablewithalowerpenalty,butthisresultwasdiscarded
becauseonehardconstraintwasbroken.
Themanuallycreatedtimetablecontains13hardconstraintbreakserrorsthatbreaktherules:
1teacherclashalessoncollidingwithateachermeeting
3lessonstaughtatanunavailabletimefortheteacher
3gapsinclassgroupschedule
2classgroupclashesaPhysicalEducationlessoncollidingwithaSpecialPElesson
whichisavoidedelsewhereinthetimetable
4classgroupshaving10consecutivelessonsinaday
Skolarisfoundafeasibletimetablewithnobrokenhardconstraints.
Classgroupaspects
Thetotalnumberofsubjectclassgroupcombinationswas853.
Thesubjectcategoriesweresetupwithoutconsultingtheschool.Minordifferenceswouldnot
changetheresultsignificantly.
Subjectcategories
Category Subjects
Language Anglickjazyk,eskjazyk,Nmeckjazyk
(EnglishLanguage,CzechLanguage,GermanLanguage)
Humanity Aplikovanpsychologie,Djepis,Naukaospolenosti,Obansknauka,Obansk
vchova,Prvnnauka
(AppliedPsychology,History,SocietyStudies,CivilStudies,CivilEducation,Law
Studies)
Technical Automatizace,Automatizaceobrbcchstroj,slicovtechnika,Elektrick
men,Elektrickstrojeapstroje,Elektronickzazen,Elektronika,
Elektrotechnika,Kancelskavp.technika,Kontrolaamen,Mechanika,
Mechatronika,Mikroprocesorovelektrotechnika,Pneumatikaahydraulika,
ProgramovnCNC,Provozntechnika,Stavbaaprovozstroj,Strojeazazen,
Strojrensktechnologie,Strojnictv,Technickdokumentace,Technickmen,
Technickkreslen,Technickvybaven,Technologie,Technologiemontaoprav,
Zkladyautomatizace,Zkladyelektrotechniky
(Automation,MachineToolAutomation,DigitalTechnology,Electrical
Measurements,ElectricalMachineryAndAppliances,ElectronicEquipment,
Electronics,ElectricalEngineering,OfficeAndComputingTechnology,Controlling
AndMeasurement,Mechanics,Mechatronics,MicroprocessorElectronics,
PneumaticsAndHydraulics,CNCProgramming,OperatingMachinery,Construction
AndOperationOfMachinery,Machinery,ManufacturingTechnology,Mechanical
Engineering,TechnicalDocumentation,TechnicalMeasurement,TechnicalDrawing,
Hardware,Technology,TechnologyOfInstallationAndRepair,BasicAutomation,
ElectricalEngineeringFundamentals)
Science Chemie,Fyzika,Matematika
(Chemistry,Physics,Mathematics)
Unclassified Ekonomie,Ekonomikaaorganizace,Ekonomikaazen,Informanakom.
technologie,Laboratoe,Management,Marketing,Marketingamanagement,
Materilyatechnologie,Obchodninnosti,Obchodnkorespondence,Potaov
grafika,Potaovst,Podnikovekonomika,Praktickcvien14,Praxe,
Programovn,Programovvybaven,Psychologieprodeje,Sovoperan
systmy,Stelnzbran,Technikaadministrativy,Tlesnvchova,etnictv,
Zkladyekologie,Zkladyekologieachemie,Zkladyvroby,Zboznalstv,
Zdravotntlesnvchova,Zempis,Zpracovninformac
(Economics,EconomicsAndOrganization,EconomicsAndManagement,
InformationAndComm.Technology,Laboratories,Management,Marketing,
MarketingAndManagement,MaterialsAndTechnologies,BusinessActivities,
BusinessCorrespondence,ComputerGraphics,ComputerNetworks,Business
Administration,PracticalExercises14,Practice,Programming,Software,Sales
Psychology,NetworkOperatingSystems,Firearms,AdministrationTechnique,
PhysicalEducation,Accounting,FundamentalsOfEcology,FundamentalsOf
EcologyAndChemistry,BasicsOfProduction,MerchandiseStudies,Special
PhysicalEducation,Geography,InformationProcessing)
Verylatestartsweremadeahardconstraintfortheautomaticgeneration.
Excludestheverylatestarts.
DespitetheSkolaristimetablecontainingalmosttwiceasmanylatelessons,itsoverallbalance
wassignificantlybetter.Evenso,theemphasisofthemanualtimetablewasnotprojectedcorrectly
intothesetupoftheseaspects.
Teacheraspects
EventhoughtheabsolutenumberofgapswashigherintheSkolaristimetable,thetotal
gaprelatedpenaltywaslowerbecausetheaveragegaplengthwasshorter.
TheOriginaltimetableseemsputstrongemphasisonthisaspectanditsimportancewasclearly
underestimated.Theweightofthisaspectwassettoolowforthisautomaticoptimisationrun.
Otheraspects
ValuesreportedbySkolariswerenotcompletelycorrectinthiscase.Thereweresixclassgroups
withlessonsonlyintheafternoonwhichtooklanguagelessonsattimeswhichhadbeen
designatedasundesired.AsSkolarisdoesn'tallowspecifyingwhichsubjectisavailableatwhich
timeforspecificclassgroups,theseinevitableoccurrenceswerereportedasflaws.Moreover,
somesubjectscouldexceptionallybetaughtatanundesiredtimeinspecialcircumstances.The
correctvaluesexcludingthesefalsereportsareshownontheleftineachchart.Thereported
valueswhichcontributedtothetotaltimetablepenaltyareshownontheright.
Summary
Apartfromreachingfeasibilitywithoutrelaxinganyrules,theSkolaristimetableshowednoticeable
improvementsinsubjectdistribution,subjectsequencing,classgrouplessondistributionand
lessonroomassignment.However,theeliminationoftheclassgrouplatelessons,teachervery
shortdaysandsubjectundesiredtimeswasunderestimatedandseemedunsatisfactory.Itwas
decidedtoperformanotheroptimisationrunwithanadjustedsetofaspectpenaltiesinhopethat
theresultingtimetablewouldrespectthebalanceofthemanualtimetablebetter.
3.2.2Run2
Another optimisation run(run 2)was performed inan attemptto correct the shortcomingsofthe
previouslyanalysedtimetable,whichwasusedasastartingpoint.
ThechartsshowthetimetablefromthisrunasSkolaris(run2)(orange).Comparisonofall
threetimetablesisgiveninflawcountchartstodemonstratetheeffectsofweightsetuponthe
results.Penaltychartsshowcomparisonofthetimetableobtainedinrun2withthemanual
timetable(thepenaltiesforthemanualtimetablehavebeenrecalculatedtomatchtheadjusted
aspectweights).Showingthetimetablefromrun1inthepenaltycomparisonsdoesn'tmakesense
evenafterrecalculation,asdifferentaspectweightswereusedforitsgeneration.11
Aspectsetup(orderedbyweight)
Classgroupverylatestart 100 0
Classgroupsubjectdistribution(twolessonsofthesamesubjectinone 75 25
day)
Subjecttaughtatundesiredtime 40 +38
Teacherveryshortday 35 +33
Classgrouplatelesson 30 +29
Teacherteachingatundesiredtime 25 +21
Classgroupsubjectdistribution(spread) 20 5
Teachergaplength 15 +10
Teachergaps 7 +2
Classgrouplessondistribution 5 0
Classgroupearly/latestart 5 +4
Classgroupsubjectsequence 1 0
Lessoninundesiredroom 1 0
Lessonatundesiredtime 1 0
Optimisationsteps
11
Justforthesakeofcompleteness,itsrecalculatedtotalpenaltyvaluewas16455.
Fulloptimisation 24.88 12265 4190
Hardconstraints
Therewasnochangebetweenruns1and2asfarashardconstraintswereconcernedcomplete
eliminationwasrequired.Samewastruefortheclassgroupverylatestartaspect.Therespective
chartsarethereforeomitted.
Classgroupaspects
TherelativelyhighpenaltyiscausedbytwoSpecialPElessonsprescheduledtolateslots,which
combinestudentsfrommanyclassgroupstogetherwhichmultipliesthepenalty.
Lessondistributioninrun2fellvictimtootheraspectswithincreasedweights,butstayedwithin
reasonablebounds.
Teacheraspects
Theslightincreaseingapaspectweightspaidoff.Eventhoughtheaveragenumberofteacher
gapsperdayisstillslightlyhigher(by0.08),thegapsaremoreregularlydistributedandtheir
averagelengthislower,whichisthereasonforthelargedifferenceinpenalty.
ThisistheonlyaspectinwhichtheOriginaltimetableoutperformedSkolarisrun2.Itcould
probablyberectifiedbyincreasingtheweightevenmore,butitdidntseempracticaltorerunthe
optimisationjusttogetridoftwoextrashortdays.Afterall,outofthetotal771teacherteaching
days12,thedifferencebetweenthevalueswasbelow0.3%.
Otheraspects
12
Asmentioned,therewere82teachersand10dayspertimetablingweek,whichwouldcreate820teachingdays,but
notallteacherswereavailableeveryday.
Aratherdrasticincreaseinaspectweighthelpedproduceexceedinglygoodresultwithalmostall
realflawseliminated.Theappearanceoffalselyreportedflawsisnotabigproblem,eventhough
theOriginaltimetableispenalizedmorebecauseSkolariswasabletoavoidsomecaseswhichdid
notcontributetotherealpenalty.
Summary
Theweightadjustmentshiftedtheaspectbalanceintherightdirection(asindicatedbythetotal
penaltycomparison)andSkolariswasabletoproduceatimetablesuperiorineveryaspectexcept
theshortteacherdays.
Apartfromclassgroupsubjectdistributionandsubjectsequence,theremarkable
improvementthatwouldbefeltbybothstudentsandteachersonadaytodaybasisisthe
reductionofearlyandlatestartsaswellas
thenumberoflatelessons,whichcomeshandinhand
withamorebalancedlessondistribution.Themuchimprovedlessonroomassignmentmighthelp
theoverallqualityofclasses,forexamplebecauseofbetteraccesstospecializedequipment.
4.Discussionandconclusions
ComparisonoftimetablescreatedmanuallyandautomaticallybytheSkolaristimetable
optimisationsoftwarehasbeenpresented.TheSkolaristimetablewassuperiorinallaspectsfor
theprimaryschool.Findingagoodbalanceofaspectweightsprovedmoredifficultforthelarge
secondaryschool(asexpected).Afteradjustmentsweremade,Skolariswasabletoproducea
timetableofahigherqualitynotonlyoverallbutalsoforeverysingleaspectexceptone.Thisfact
indicatesitsabilitytoadaptexistingsolutionstochangingcircumstances.
Thelistofaspectsusedforthequalityassessmentisbynomeanscomplete13.However,itis
wideenoughtosafelyassumethatadditionofotheraspectswouldnothaveanadverseeffecton
thesoftware'sabilitytoassessandoptimisetimetables.Thisisalsosupportedbythefactthatthe
usedoptimisationandassessmentmethodsdonotdependonaspecificaspectsetup.Asseenin
theSecondaryschoolexample,carefulanalysisisnecessarytoobtainabalancedresult.
Basedonthehugeimprovementstothetimetablesforthetwovariedschools,itcanbe
arguedthatautomaticoptimisationcouldbeappliedsuccessfullyinmostschoolsofsimilar
13
AtthetimeofwritingSkolarissupported49differenttimetableaspects,including(userdefinable)hardconstraints.
structure.Thatleadstotheconclusionthattimetablersmightbeharbouringknowledgeabout
automatictimetablingsoftwarethathasbecomeobsolete.Infact,somepresentedstatements
haveturnedtomythsthatmayindeedbepreventingbothpupilsandteachersfromhavinga
better,morebalancedschedule,andarguablypreventpupilsfromhavingamoreenjoyabletimeat
school.
Appendix
Skolaris,togetherwithcompleteinformation,isavailableat
http://skolaris.net
.
Timetablespresentedinsection3.2aswellasthebasedataareavailableathttps://skolaris.net/ui
(clicktheDemobuttontologin),underorganisationIntegrovanstednkola,termCase
study.
References
1. Secondaryschool,Brnoernovice,Czechrepublic
2. Secondaryschool,BrnoKrlovoPole,Czechrepublic
3. Secondaryschool,FrdekMstek,Czechrepublic
4. Secondaryschool,Prague10,Czechrepublic
5. A.Schaerf,
LocalSearchTechniquesforLargeHighSchoolTimetablingProblems
,IEEE
TransactionsonSystems,Man,andCyberneticsPartA:SystemsandHumans,vol.29,
Issue4,p.368377,1999
6. Secondaryschool,SlavkovuBrna,Czechrepublic
7. Unknownschool,Plze,Czechrepublic
8. Primaryschool,Otrokovice,Czechrepublic
9. Secondaryschool,Prague4,Czechrepublic
10. Primaryschool,Uherskhradit,Czechrepublic
11. Secondaryschool,Plze1,Czechrepublic
12. Artschool,Klimkovice,Czechrepublic
13. Secondaryschool,BrnoBystrc,Czechrepublic
14. Primaryschool,Albrechtice,Czechrepublic
15. Privatesecondaryschool,Prague,Czechrepublic
16. Primaryschool,Prague3,Czechrepublic