0

Here is some sample data:

Bio 256:

 LEC 1: 9am-10am
 LEC 2: 10am-11am
 LEC 3: 2pm-3pm

 LAB 1: 10:30am-12pm
 LAB 2: 1pm-2:30pm
 LAB 3: 3pm-4:30pm

Chem 356:

 LEC 1: 9am-10am
 LEC 2: 11am-12pm
 LEC 3: 12pm-1pm

 LAB 1: 8am-9:30am
 LAB 2: 2pm-3:30pm
 LAB 3: 4pm-5:30pm

Math 266:

 LEC 1: 8am-9am
 LEC 2: 10am-11am
 LEC 3: 3pm-4pm

 LAB 1: 10am-11:30am
 LAB 2: 12:30pm-2pm
 LAB 3: 3:30pm-5pm

Overall, a student would have 6 classes (1 lecture and 1 lab for each course), how do I find from this data the shortest amount of time a student would have to spend at school?

I tried simple greed algorithms (arrange by earliest end time, and removing rest of group, for example Lab2 and Lab3 if, Lab1 is picked), however that doesn't work.

Syed Ali
  • 21
  • 1
  • Google is your friend. There are tons of algorithms and existing solutions for this sort of problem. – hatchet - done with SOverflow Aug 24 '16 at 17:10
  • In addition to Google, see the "Related" section in the right column on this page. The first related question is quite relevant: http://stackoverflow.com/questions/2746309/best-fit-scheduling-algorithm?rq=1. Other are relevant as well. Make sure to do proper research on existing questions on SO. – Vince Sep 06 '16 at 20:10

0 Answers0