Question 1
A school needs to schedule 6 courses. The following courses have overlapping students and cannot be scheduled at the same time:
- History conflicts with Chemistry
- History conflicts with CS
- History conflicts with Biology
- Chemistry conflicts with CS
- Chemistry conflicts with Physics
- Chemistry conflicts with Biology
- CS conflicts with Physics
- CS conflicts with Biology
- Math conflicts with Physics
- Math conflicts with Biology
What is the minimum number of time slots needed to schedule all courses without conflicts?
Step-by-step solution (Graph Coloring):
1. Model as graph coloring problem:
- Vertices = Courses
- Edges = Conflicts (courses that cannot be together)
2. Apply greedy coloring algorithm:
- History: Slot 1
- Chemistry: Slot 2
- CS: Slot 3
- Math: Slot 1
- Physics: Slot 4
- Biology: Slot 5
3. Colors/slots used: 5
Answer: Minimum 5 time slots
Key Strategy: The chromatic number of the conflict graph gives the minimum slots needed.
1. Model as graph coloring problem:
- Vertices = Courses
- Edges = Conflicts (courses that cannot be together)
2. Apply greedy coloring algorithm:
- History: Slot 1
- Chemistry: Slot 2
- CS: Slot 3
- Math: Slot 1
- Physics: Slot 4
- Biology: Slot 5
3. Colors/slots used: 5
Answer: Minimum 5 time slots
Key Strategy: The chromatic number of the conflict graph gives the minimum slots needed.