[GradTrak] Optimal course assignment for unit-threshold buckets - #1211
Open
ethanransing wants to merge 1 commit into
Open
[GradTrak] Optimal course assignment for unit-threshold buckets#1211ethanransing wants to merge 1 commit into
ethanransing wants to merge 1 commit into
Conversation
The CS major's upper-division requirements are four unit buckets (Design ≥4, CS ≥8, CS/EE/EECS ≥8, Technical Elective ≥4) that share overlapping eligible courses. The program filled them in order with take_until_units, then hand-excluded each bucket's picks from the next. A course that could count toward two buckets was always consumed by whichever came first, even when that left a later bucket short that it could otherwise have filled. Replaces that with assign_by_units, a backtracking search with most-constrained-first ordering and an upper-bound prune that maximizes the number of buckets whose thresholds are met, with no course used twice. Adds isUpperDivision as a shared helper for parsing Berkeley course numbers (letter prefixes/suffixes like C100, 170L, 170AC). Claude-Session: https://claude.ai/code/session_012F9yFMhu4JYgy3BwQSjSDC
This was referenced Sep 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #1141. Stacked on #1210.
Same problem as #1210, for unit thresholds instead of course counts. The CS major's upper-div requirements are four buckets (Design ≥4 units, CS ≥8, CS/EE/EECS ≥8, Tech Elective ≥4) with overlapping eligible courses, filled in order with
take_until_units. A course that could count toward two buckets was always consumed by the first one.Adds
assign_by_units, which does a backtracking search (most-constrained bucket first, with an upper-bound prune) to maximize the number of buckets that hit their threshold. Also addsisUpperDivision, which handles course numbers likeC100,170L,170AC. The CS program now usesassign_by_units; seed regenerated.5 new tests.