Skip to content

Feat/room blockout#105

Open
ekremarmagankarakas wants to merge 4 commits into
mainfrom
feat/room-blockout
Open

Feat/room blockout#105
ekremarmagankarakas wants to merge 4 commits into
mainfrom
feat/room-blockout

Conversation

@ekremarmagankarakas

Copy link
Copy Markdown
Contributor

Summary

  • Fix merge group scheduling — replaced high-weight edge approach with node contraction before DSATUR coloring, guaranteeing merged courses always share the same time slot
  • Add room blockout feature — users can upload an optional CSV specifying (room, day, block) slots where rooms are unavailable; the scheduler respects these during room assignment
  • Surface unroomed exams — courses that have a time slot but no available room (all rooms blocked) are now tracked, persisted to the DB, and visualized distinctly from unscheduled courses

Room blockout CSV support:

  • RoomBlockoutSchema and RoomBlockoutAdapter with flexible day/block
    parsing (accepts integers or named values like 'Monday', '9AM-11AM')
  • room_blockouts field on SchedulingDataset; DatasetFactory accepts
    optional blockouts_df
  • _assign_rooms skips blocked rooms and tracks unroomed courses in
    ScheduleResult.unassigned so unplaced_exams count is accurate
  • API route and DatasetService accept optional room_blockouts file
  • Precompute blockout_slots into file_paths JSONB metadata at upload
    time so schedule retrieval never re-reads from S3
  • Frontend: optional upload slot with badge, store, and API support
  • Tests: adapter parsing, scheduler enforcement, end-to-end pipeline

Merge group scheduling fix:

  • Replace weight-9999 edge hack with DSATUR graph contraction — edges
    mean must-be-different-color so the old approach prevented merged
    courses from sharing a slot rather than guaranteeing it
  • Contract each merge group into a virtual node, union external edges,
    expand colors back after coloring
  • Sum soft-constraint penalties across all CRNs in a group during slot
    selection so back-to-back and load costs reflect the full group
  • Add algorithm correctness test suite (coloring validity, no hard
    conflicts, merge invariants, determinism)

Frontend:

  • Pass per-slot blocked room counts through schedule API response
    (blockouts field on both generate and retrieve endpoints)
  • CompactView shows blocked room badge per calendar cell
  • DensityView shows blocked room badge alongside conflict badges
  • StatisticsView shows blockout stats card (rooms constrained, total
    blocked slots) when blockouts are present
  • Extract extractTimeFromBlock to shared utils.ts, removing duplicate
    implementations in both calendar views

Other:

  • Run scheduler in asyncio.to_thread (CPU-bound work was blocking the
    event loop)
  • Make instructor, department, and term optional in course schema so
    datasets missing these fields upload successfully

  Room blockout CSV support:
  - RoomBlockoutSchema and RoomBlockoutAdapter with flexible day/block
    parsing (accepts integers or named values like 'Monday', '9AM-11AM')
  - room_blockouts field on SchedulingDataset; DatasetFactory accepts
    optional blockouts_df
  - _assign_rooms skips blocked rooms and tracks unroomed courses in
    ScheduleResult.unassigned so unplaced_exams count is accurate
  - API route and DatasetService accept optional room_blockouts file
  - Precompute blockout_slots into file_paths JSONB metadata at upload
    time so schedule retrieval never re-reads from S3
  - Frontend: optional upload slot with badge, store, and API support
  - Tests: adapter parsing, scheduler enforcement, end-to-end pipeline

  Merge group scheduling fix:
  - Replace weight-9999 edge hack with DSATUR graph contraction — edges
    mean must-be-different-color so the old approach prevented merged
    courses from sharing a slot rather than guaranteeing it
  - Contract each merge group into a virtual node, union external edges,
    expand colors back after coloring
  - Sum soft-constraint penalties across all CRNs in a group during slot
    selection so back-to-back and load costs reflect the full group
  - Add algorithm correctness test suite (coloring validity, no hard
    conflicts, merge invariants, determinism)

  Other:
  - Run scheduler in asyncio.to_thread (CPU-bound work was blocking the
    event loop)
  - Make instructor, department, and term optional in course schema so
    datasets missing these fields upload successfully
  - Pass per-slot blocked room counts through schedule API response
    (blockouts field on both generate and retrieve endpoints)
  - CompactView shows blocked room badge per calendar cell
  - DensityView shows blocked room badge alongside conflict badges
  - StatisticsView shows blockout stats card (rooms constrained, total
    blocked slots) when blockouts are present
  - Extract extractTimeFromBlock to shared utils.ts, removing duplicate
    implementations in both calendar views
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.

1 participant