-
Notifications
You must be signed in to change notification settings - Fork 4
Understanding the Solver
While the project is primarily about the creation of a web app to make to project allocation process easier for students, lecturers and admins, the web app would be entirely pointless if it was not able create a maximum size matching with the data it gathers. Luckily for me, the difficult part of implementing the algorithms that manage the allocation process has already been taken care of, and I can use them via a python package matchingproblems.
The aforementioned python package, is run from the command line. It is run by being provided a txt file containing the data for the matching and can be fine-tuned using flags to produce the desired result.
The project allocated to me at the start of the semester was to extend the functionality of an existing web app. A student had undertaken the task of building such a web app, in a previous session and my job would be to add the functionality they didn't have the time to implement. The only problem, the previous student built their web app using the Django web framework. While I am familiar with it, I have not used it since the Web App Development course in level 2, but more importantly, it just isn't as easy or efficient to build applications with as modern JS frameworks tend to be.
So my first self-assigned task was to rebuild the web app in, my preferred web framework, NextJS. While that certainly makes the development of the web app several orders of magnitude more efficient, it caused one unavoidable issue. Since the matching problem solver was written in Python, I would no longer be able to host the solving capabilities in the same application as the web app. The solution I came up with, was to build a separate Python server that given the appropriate data would run the correct matching algorithm and return the project allocations to the web app.
As mentioned already, the solver is run from the command line by giving it a path to a file containing the data and a series of flags to build the appropriate matching algorithm. This is a significant bottleneck in performance, as file IO operations are quite slow. To avoid this issue, I would need to build the SPA-STL model used by the solver some other way. But in order to do that I need to get a better understanding of how the solver actually works. Hence this short series of documents.