Skip to content

Conversation

@SUJALGOYALL
Copy link
Contributor

Title

feat(timetable): add user input, preferred slots, conflict checking, GA optimization, and sorted timetable output

Description

This pull request implements the C++ Time Table Generator according to the project requirements:

  • User input for days, slots, rooms, courses, and instructors
  • Custom slot labels for each time slot
  • Preferred slots per course, allowing scheduling constraints
  • Conflict checking for overlapping instructors and room clashes
  • Genetic Algorithm (GA) optimization to minimize conflicts
  • Sorted timetable output by day and slot for readability

This ensures robust and optimized timetable generation, covering all edge cases mentioned in the project issue.

Semver Changes

  • Patch (bug fix, no new features)
  • Minor (new features, no breaking changes)
  • Major (breaking changes)

Issues

List any issues that this pull request closes.

Checklist

  • I have read the Contributing Guidelines
  • My code follows the style guidelines of this project
  • I have tested the changes locally and they work as expected
…GA optimization, and sorted timetable output
@prajwal3114
Copy link
Collaborator

@SUJALGOYALL
There are several major issues in your current implementation:

  • The code accepts characters and strings where numeric input is expected.
  • The project crashes for certain sets of inputs.
  • It fails to generate an optimized timetable in most cases.
  • There’s no validation to check whether the provided data is deterministic.
  • The timetable generation should be shifted from a day-wise approach to a class-wise approach.
  • Multiple conflicts are observed in the scheduling logic.

Please address these issues and test thoroughly before updating the PR.

@SUJALGOYALL
Copy link
Contributor Author

@prajwal3114 thanks for the detailed review . To make sure I fix the issues exactly where they occur, could you please share concrete test cases / repro steps for the points you listed?

@prajwal3114
Copy link
Collaborator

@SUJALGOYALL

  • When there is a string or character in place of a number, your code directly terminates or crashes.
  • For non-deterministic cases where the total available slots S< required sessions R, your code still produces an output.
  • Your algorithm does not terminate if there is a case where all generated timetables have conflicts.
  • The code can crash when the input is 0 for some cases, as your algorithm does not strictly check for division or modulo by zero.
  • Your code does not perform strict checks for the case where a single instructor handles multiple courses in the same slot.
  • Lack of strict checking for input constraints implies that if the constraints are very specific, the code may terminate with only an average solution
  • Your code fails or struggles under dense constraints.
@SUJALGOYALL
Copy link
Contributor Author

@prajwal3114 Thanks for the detailed feedback. I understand the issues and I’ll update the PR soon with the corrected solution.

@SUJALGOYALL
Copy link
Contributor Author

@prajwal3114 Hi, I’ve updated the PR to improve input validation, handle conflicts better, and check for impossible schedules. Please have a look and let me know if any changes needed.

@prajwal3114 prajwal3114 merged commit 0085118 into OPCODE-Open-Spring-Fest:main Oct 28, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment