[GradTrak] Optimal course-to-requirement matching with double major overlap enforcement#1141
[GradTrak] Optimal course-to-requirement matching with double major overlap enforcement#1141ethanransing wants to merge 3 commits into
Conversation
…reshold matching algorithm
…pse DS domain emphasis by default
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c9f0457c5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (kind === "AndRequirement" || kind === "OrRequirement") { | ||
| const children: Requirement[] = | ||
| (node as AndRequirement | OrRequirement).requirements?.data ?? []; | ||
| extractLeaves(children, ownerIdx, out); | ||
| continue; |
There was a problem hiding this comment.
Respect OR semantics when extracting joint leaves
extractLeaves flattens OrRequirement exactly like AndRequirement, so all leaves inside every OR branch are treated as simultaneously optimizable constraints. Because runJointAssignment maximizes satisfied leaf count, it can allocate courses to multiple sibling OR alternatives and starve required leaves elsewhere, producing a final tree where an And parent is false even though a satisfying assignment exists (e.g., satisfying several OR siblings instead of a required sibling node).
Useful? React with 👍 / 👎.
| const baseInput: Input = { | ||
| subject, | ||
| courseNumber, | ||
| courseId, | ||
| courseNumber: "", | ||
| type: InputType.Term, |
There was a problem hiding this comment.
Preserve course number when hydrating inputs from URL
URL parsing now constructs hydrated inputs with courseNumber: "", and this value is propagated into loaded outputs. The Grades UI uses input.courseNumber for rendering and edit state, so opening/reloading shared URLs can produce blank or invalid course identities in cards/edit flows until the user manually reselects a course. Parse should retain or recover the real course number instead of hardcoding an empty value.
Useful? React with 👍 / 👎.
Summary
Introduces optimal course-to-requirement matching for GradTrak, which replaces greedy assignment with algorithms that optimally assign courses to requirements within a program (e.g. L&S's 7 Breadths), and also handle Berkeley's upper-division overlap policy for double majors.
Changes
Limitations