I need to find an algorithm to find the best time to meet up for lets say a study group. The system has information about a group of students and their class schedules. The system should give a time for meetup, where there is no conflict with anyone's class schedules. what would be the best way attack this problem. I was looking for any scheduling algorithm, but didnt find anyone that fits.
thanks in advance
Interesting question.
This is what I would do:
Which then looks like this, for example:
Student A: 11100000111111100000
Student B: 00000011111000010001
Student C: 00000000111111110001
_______________________________+
11100022333222220002
^^^ ^^^
Then you'd need to find all gaps in the array (areas with zeros) by using a simple loop which keeps track of the current zero-length. Memoize the start and end index and translate it back (reverse of step 1) to a time region.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With