Find the minimum time to finish tasks with dependencies and per-type cooldown.
Unlock detailed company stats for this questionUpgrade
You are given n tasks. Each task has a type (string/character) and a list of dependencies (other tasks that must finish first). Each task takes 1 unit of time. Tasks of the same type must be separated by a cooldown of k units: after executing a task of type X at time t, the next task of type X can only run at time >= t + k + 1. A task is ready only after all its dependencies have completed. If no task is ready or all ready tasks are blocked by cooldown, time advances (idle). Find the minimum time to complete all the tasks. Example: tasks {t1->A, t2->A, t3->B, t4->A, t5->B}, dependencies [[t3,t1],[t4,t2]], cooldown 2 gives 7.
Community answers
No answers contributed by the community yet.
Related questions
Find the minimum semesters to finish courses with prerequisites and K courses per semester.Find the minimum time to execute all tasks given type and memory constraints.Given tasks with durations and dependencies, return the total time to complete all tasks and the order they complete in.Related courses

Course

Course
Course
