How does the weekly plan algorithm work and how is the target end date calculated? #649
-
|
When I enroll in a roadmap I get a weekly schedule with topics assigned to each week and a target end date. How is this calculated? Does it account for the number of hours each topic takes? And what happens when I recompute my pace? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The weekly plan is built using a greedy packing algorithm in roadmap.service.ts. Here is exactly how it works: How topics are packed into weeks Target end date calculation What recompute pace does Example |
Beta Was this translation helpful? Give feedback.
The weekly plan is built using a greedy packing algorithm in roadmap.service.ts. Here is exactly how it works:
How topics are packed into weeks
Each topic has an estimatedHours value set by the AI. The algorithm iterates through topics in order and keeps adding them to the current week until the total hours in that week would exceed hoursPerWeek. When adding the next topic would overflow, a new week starts.
Target end date calculation
Once all topics are packed, the algorithm knows how many weeks are needed. It multiplies that by 7 days and adds it to the enrollment start date (today) to produce the targetEndDate.
What recompute pace does
When you call recompute pace with a new hoursPerWe…