Parallel Task Scheduler

Hard
scheduling topological-sort parallel-processing graph
Problem Description

Given tasks with dependencies and durations, find minimum time to complete all tasks using k parallel workers. Tasks can only start after their dependencies are completed.

Input Format
First line: n k (tasks, workers). Second line: n task durations. Third line: m (dependencies). Next m lines: dependency pairs.
Output Format
Minimum time to complete all tasks with k parallel workers.
Constraints
• 1 ≤ n ≤ 100
• 1 ≤ k ≤ 10
• 1 ≤ task duration ≤ 100
• 0 ≤ m ≤ n*(n-1)/2
• No circular dependencies
• Tasks numbered 0 to n-1
Sample Input/Output
Input:
4 2
3 2 4 1
3
0 1
0 2
1 3
Output:
7
Explanation

Task dependencies and parallel execution with 2 workers to find minimum completion time.

Solution Hints
170
Points
4000ms
Time Limit
512MB
Memory Limit
Code Editor
Register to Submit
Register to Access Code Editor

Create a free account to solve coding problems and track your progress.

Register Now
Feedback