iOlivers / BrockTimeTable

3 stars 0 forks source link

[TASK/BUG FIX] Implement Truncation System For TimeTable Generation To Prevent Crashes From Exponential Combo Growth #3

Open iOlivers opened 2 weeks ago

iOlivers commented 2 weeks ago

Currently the generation system simply creates and displays all valid timetables of course combos. This works fine until we add more than around 3-4 classes (depending on how many secondary components they have) at which it, each time a class is added, potentially generates 100,000+ combos which ultimately causes the webpage to run out of RAM and crash.

The idea

Implement a smart truncation system. This system is only to enable once a defined threshold amount of combos is to be generated. The timetable generation system should remain the same if the threshold is not hit.

Once the threshold is hit, the timetable generation logic should change to limit the amount of possible combinations. Ideally this system should remove really similar combos, however if that is not possible maybe only consider the first n amount of secondary components (labs, seminars, tutorials) to single course combo generation to decrease the final combo amount to a reasonable size.