sql - Course schedule using php/mysql -


the problem consists of course scheduler (for university/college). if not using sql: have 1 array of arrays , 1 2-dimensional array. each array in first array contains unique ids of different courses take (each course has different times , days represented these unique ids). second array contains compatible course (i.e. don't make time conflict). if take "n" number of courses wish find possible combination of courses without having time conflict.

+++++++array 1+++++++++   ++++array 2+++++ course1 course2 course3   (compatible ids)   122     235     654         122  235   123     456     876         122  456   124     190     943         122  654   145     456     321         122  321                               235  654... 

in above example following ids can make schedule: 122 235 654.
solution came brute forcing (n nested loop). there more efficient way of solving problem? maybe using mysql?

if it's option, i'd use mysql, , maintain of relational data way.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -