I've made a website that helps students at my university optimise their student timetables. Currently, for subjects with not many classes - I can generate and optimise the timetables quite fast. However, some combinations of subjects can result in millions of permutations - which is infeasible with my current method.
Currently, I am taking the cartesian product of my 'set pool', i.e. generating every possible timetable, then sorting them by features such as clash count, total day spans, e.t.c.
This set pool is just a list of lists, I need to pick one class from each list, to make a valid timetable.
I would like to know how to approach this problem using a method that isn't brute force.