Question 1
Five patients need appointments. Their preferences are:
- Patient A: Dr. Patel at 10:00 AM
- Patient B: Dr. Kumar at 10:00 AM
- Patient C: Dr. Patel at 10:30 AM
- Patient D: Dr. Shah at 10:00 AM
- Patient E: Dr. Patel at 11:00 AM
Each doctor can see one patient per 30-minute slot. If all preferences are honored, how many patients need to be rescheduled?
Step-by-step solution:
Conflict Detection Method:
1. Create doctor-time matrix:
Doctor | 10:00 | 10:30 | 11:00 | 11:30
------------|-------|-------|-------|-------
Dr. Patel | A | C | E | ---
Dr. Kumar | B | --- | --- | ---
Dr. Shah | D | --- | --- | ---
2. Check for conflicts:
- Dr. Patel at 10:00: Only Patient A (No conflict)
- Dr. Patel at 10:30: Only Patient C (No conflict)
- Dr. Patel at 11:00: Only Patient E (No conflict)
- Dr. Kumar at 10:00: Only Patient B (No conflict)
- Dr. Shah at 10:00: Only Patient D (No conflict)
3. Verification:
- No doctor has multiple patients in same slot
- All preferences can be honored
Answer: 0 patients need rescheduling
Key Strategy: Map all appointments to a doctor-time grid and identify slots where multiple patients request the same doctor.
Conflict Detection Method:
1. Create doctor-time matrix:
Doctor | 10:00 | 10:30 | 11:00 | 11:30
------------|-------|-------|-------|-------
Dr. Patel | A | C | E | ---
Dr. Kumar | B | --- | --- | ---
Dr. Shah | D | --- | --- | ---
2. Check for conflicts:
- Dr. Patel at 10:00: Only Patient A (No conflict)
- Dr. Patel at 10:30: Only Patient C (No conflict)
- Dr. Patel at 11:00: Only Patient E (No conflict)
- Dr. Kumar at 10:00: Only Patient B (No conflict)
- Dr. Shah at 10:00: Only Patient D (No conflict)
3. Verification:
- No doctor has multiple patients in same slot
- All preferences can be honored
Answer: 0 patients need rescheduling
Key Strategy: Map all appointments to a doctor-time grid and identify slots where multiple patients request the same doctor.