leave-optimizer
Leave strategy optimizer using the gap-merging algorithm.
Finds the best vacation strategies by bridging work gaps between rest blocks: "If I take N days off, what's the longest continuous break I can get?"
How it works
- Build daily status for each day from today to Dec 31 (shift + holidays + weekends)
- Identify "rest blocks" (consecutive off days) and "work gaps" between them
- For each work gap ≤ max_leave_days: bridge it → merge adjacent rest blocks
- Score each strategy: 50% efficiency + 25% length + 25% family overlap
- Deduplicate (same break range → keep fewest leave days) and sort by score
Example
use default_config;
use find_best_leave_plans;
use NaiveDate;
let config = default_config;
let today = from_ymd_opt.unwrap;
let plans = find_best_leave_plans;
for in plans.iter.take.enumerate