Interactive step-by-step visualization of the DFS + bitmask engine that powers conflict-free university scheduling.
yu-sync.com — the production scheduler this engine runs in
This is the open-source companion to YU-Sync — a university course scheduler. The visualizer exposes the algorithm internals so you can watch it think: every DFS branch explored, every bitmask conflict detected, every backtrack taken.
git clone https://github.com/this-demir/yu-sync-info
cd yu-sync-info/app
npm install
npm run dev # opens at http://localhost:5173Once running, head to the Visualizer page. Load a preset scenario or configure your own courses, then hit play — or step through the DFS one move at a time. The state-space tree grows live as the engine explores and prunes branches.
For the full documentation — algorithm walkthrough, complexity analysis, bitmask math, generator pattern explanation, and an interactive parity benchmark you can run directly in the browser — open the Docs page inside the app.
| Feature | Description |
|---|---|
| Step-by-step simulation | Play, pause, step forward/back through the DFS with variable speed |
| Bitmask conflict detection | See the bitwise AND operations live on the timetable grid |
| State-space tree | Watch the decision tree grow — successful paths and pruned branches |
| Parity benchmarking | Run the production engine vs. visualizer engine side-by-side to verify 100% deterministic equality |
| Test scenarios | Pre-configured edge cases: cross-semester collisions, heavy lab blocks |
| Interactive whitepaper | Academic-grade documentation with Boolean algebra and DFS proofs, built into the app |
The scheduler uses zero-allocation bitmask conflict detection combined with DFS backtracking:
For each course, iterate candidate sections:
mask = scheduledDays[day] & section.timeMask
if mask === 0 → no conflict → recurse deeper
else → conflict detected in O(1) → backtrack
Each day's schedule is a single integer. An AND with a section's bitmask detects any overlap in constant time — no iteration over time slots, no allocation.
Detailed write-up: docs/algorithm.md · docs/architecture.md
- React 19 + Vite 7 — UI and build
- TypeScript 5.9 — strict throughout
- Zustand — generator-driven simulation state via Observer pattern
- Tailwind CSS v3 — styling
- Vitest — mathematical core parity tests (no mocks)
yu-sync-info/
├── app/ # the full React + Vite frontend
│ ├── src/
│ │ ├── core/ # SimulationEngine.ts · scheduler.ts · time.ts · types.ts
│ │ ├── store/ # useSimulationStore · useRouteStore
│ │ ├── pages/ # Landing · Visualizer · Docs · Media
│ │ └── components/
│ ├── public/
│ ├── index.html
│ └── package.json
└── docs/ # algorithm and architecture write-ups
├── algorithm.md
└── architecture.md
# from app/
npm run test # Vitest watch mode
npm run coverage # V8 coverage report
npm run build # type-check + production buildKey invariant: scheduler.ts and SimulationEngine.ts must always produce identical schedules. EngineParity.test.ts enforces this automatically.
