Skip to content

Latest commit

 

History

History
executable file
·
50 lines (34 loc) · 2.36 KB

README.md

File metadata and controls

executable file
·
50 lines (34 loc) · 2.36 KB

Algorithm

1. Input:

  • Desired Courses: Courses the student wants to take.
  • Unavailable Times: Days and hours when the student does not want to have classes.

2. Data Preparation:

  • Organize the course data in a way that includes information about course timings and durations.
  • Convert the user input (desired courses and unavailable times) into a format suitable for comparison with the course data.

3. Constraint Modeling:

  • Temporal Constraints:
    • Ensure that the class timings don't overlap with the times the student is unavailable.
  • Course Constraints:
    • Match the student's desired courses with the available courses.

4. Backtracking Algorithm:

Implement a backtracking algorithm to explore all possible combinations of schedules based on the constraints:

  • Variables: Each variable represents a course the student can take.
  • Domain: For each variable, the domain represents all possible time slots the course can be scheduled in.
  • Constraints: Apply the temporal constraints and course constraints during the search process.

5. Backtracking Steps:

  • Base Case:
    • If all courses are scheduled and constraints are met, return the current schedule as a solution.
  • Recursive Step:
    • Pick an unscheduled course variable.
    • Iterate through its possible time slots (domain values).
    • For each time slot, check if it satisfies temporal constraints.
    • If a valid slot is found, move to the next course variable recursively.
  • Backtrack:
    • If no valid slot is found for a course variable, backtrack to the previous variable and try a different time slot.

6. Output:

Once all possible schedules have been explored, present the valid schedules to the user.

Notes

  • Ensure the algorithm considers both course constraints and the unavailable times specified by the user.
  • It's essential to handle cases where no valid schedule can be generated due to conflicting constraints.
  • Validate the algorithm with various input scenarios to ensure correctness and efficiency.

This algorithm works similarly to the one described earlier, but with a focus on incorporating the user's specific course preferences and unavailable times. By following these steps, you can create a schedule solver that generates personalized schedules for students based on their desired courses and availability constraints.