Question 1
A school needs to schedule 6 courses. The following courses have overlapping students and cannot be scheduled at the same time:
- CS conflicts with English
- CS conflicts with Chemistry
- CS conflicts with Physics
- Chemistry conflicts with Physics
- Chemistry conflicts with English
- Chemistry conflicts with Math
- Chemistry conflicts with History
- Physics conflicts with English
- Physics conflicts with History
- English conflicts with Math
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:
- CS: Slot 1
- Chemistry: Slot 2
- Physics: Slot 3
- English: Slot 4
- History: Slot 1
- Math: Slot 3
3. Colors/slots used: 4
Answer: Minimum 4 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:
- CS: Slot 1
- Chemistry: Slot 2
- Physics: Slot 3
- English: Slot 4
- History: Slot 1
- Math: Slot 3
3. Colors/slots used: 4
Answer: Minimum 4 time slots
Key Strategy: The chromatic number of the conflict graph gives the minimum slots needed.