Parent Teacher Meeting scheduling app

Volunteer project done for Wisdom World High School, Pune

View the Project on GitHub derbedhruv/PTM

The Problem Statement - origin

My mom is vice-principal at a high school called Wisdom World in Wakad, Pune. She needed to schedule a parent-teacher meeting for all teachers (from classes 3 to 10) and it was turning out to be a major headache to do manually (which is how they have been doing it for years!).

I was at home at the time, I had recently quit my job at Hyderabad to be at home before I would fly out to Stanford, California for the graduate program I'd be starting in the fall of 2016. I had been reading a lot about algorithms and discrete optimization (the coursera course especially) and I was aching to try things out in the real world using the things I'd learned, so I told my mum I'd make a system which would ease her job and the many such optimization jobs to come.

Understanding the user's perspective

I planned to write the backend in python and use flask to serve the website. The only information this system would be the timetable of teachers indicating which subject they taught and which class. Initially I had thought I would make a simple and beautiful bootstrap-based online entry system by which the timetable could be populated by the teachers. However, a quick conversation with my mum told me that the teachers were extremely used to dealing with MS Excel. It would be too much to expect them to have to re-enter data and that too in a webapp they weren't comfortable using. So, taking advantage of the openpyxl library, I wrote up a simple "black-box" system by which they'd upload an xlsx file with the teacher-class table, which would be processed on cloud and would spit out another XLSX file with the required timetable schedule, all done!

Un-intended Impact of the Work

We kept finding that the optimization would severely slow down as the number of classes included was increased (which is expected for larger instances in these class of problems) but in an unnatural way. After a lot of debugging, we discovered that there were two teachers (the computer course teachers in fact!) that were over-assigned classes and this was making the scheduling task very hard because it was becoming combinatorially increasingly difficult to ensure they didn't have any clashes. This has actually led to a proposal to hire more computer teachers for the school! It's so gratifying that there was so much benefit by this simple project that was just done for fun!

Under the Hood

Everything runs in python. The optimization is run in minizinc - the .dzn file is produced by a python code on-the-fly and run with the .mzn file. The output from this is written to a temporary file, which is parsed by the same python routine and used by it to generate the excel file. The main file to read is gen_timetable.py.