Skip to content

[GradTrak] Optimal course-to-requirement matching with double major overlap enforcement#1141

Open
ethanransing wants to merge 3 commits into
mainfrom
ethan/gradtrak-req-matching-fixes
Open

[GradTrak] Optimal course-to-requirement matching with double major overlap enforcement#1141
ethanransing wants to merge 3 commits into
mainfrom
ethan/gradtrak-req-matching-fixes

Conversation

@ethanransing
Copy link
Copy Markdown
Contributor

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

  1. Bipartite matching for breadth/count requirements. Replaces greedy matching
  2. Unit-threshold buckets (ex. >= X units of UD classes): Course assignment uses backtracking w/ pruning to optimally fulfill buckets
  3. Joint matching across double majors (see L&S, CDSS, CoE policies): Backtracking w/ pruning to assign upper division classes to major A, major B, both (if overlap cap isn't exceeded), or none
  4. Testing: Unit tests in packages/BtLL/src/test.ts covers
  5. UX change: hide DS domain emphasis subrequirements by default

Limitations

  1. Joint majors aren't handled. These don't have the same overlap restrictions as double majors
  2. This CoE double major restriction isn't encoded: "Each major must include at least 5 upper division technical courses, of at least 3 units each, that do not overlap with the other major."
  3. 3+ majors aren't supported

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +43 to +47
if (kind === "AndRequirement" || kind === "OrRequirement") {
const children: Requirement[] =
(node as AndRequirement | OrRequirement).requirements?.data ?? [];
extractLeaves(children, ownerIdx, out);
continue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines 102 to 106
const baseInput: Input = {
subject,
courseNumber,
courseId,
courseNumber: "",
type: InputType.Term,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants