search
Log In
3 votes
107 views

You are going abroad and you have to complete a number of formalities before you leave. Each task takes a full day to complete. Fortunately, you have an army of friends to help you and each task can be done by either you or any of your friends, so you can complete as many tasks as possible in parallel, on the same day.
Some tasks depend on others: for instance, you cannot purchase foreign exchange till you have bought your ticket. If task $B$ depends on task $A$, you can start $B$ only after you complete $A$. A set of tasks with no pending dependencies can be completed in parallel.
You are given a list of $n$ such tasks to be completed, where each task comes with a set of other tasks that it depends on. The set of tasks is feasible: there are no circular dependencies. You want to compute the minimum number of days needed to complete all the tasks, given the constraints.

  1. Model this problem formally using graphs.
  2. Describe an efficient algorithm for the problem and analyze the worst-case complexity of your algorithm.
in Algorithms 107 views

Please log in or register to answer this question.

Related questions

29 votes
4 answers
1
2.5k views
You have $n$ lists, each consisting of $m$ integers sorted in ascending order. Merging these lists into a single sorted list will take time: $O(nm \log m)$ $O(mn \log n)$ $O(m + n)$ $O(mn)$
asked May 23, 2016 in Algorithms jothee 2.5k views
2 votes
1 answer
2
429 views
Your final exams are over and you are catching up on watching sports on TV. You have a schedule of interesting matches coming up all over the world during the next week. You hate to start or stop watching a match midway, so your aim is to watch ... on dynamic programming to compute the maximum number of complete matches you can watch next week. Analyze the worse-case complexity of your algorithm.
asked Jun 8, 2016 in Algorithms Arjun 429 views
1 vote
1 answer
3
301 views
Your final exams are over and you are catching up on watching sports on TV. You have a schedule of interesting matches coming up all over the world during the next week. You hate to start or stop watching a match midway, so your aim is to watch as ... next match whose starting time is strictly later than the finishing time of the current match? Analyze the worse-case complexity of your algorithm.
asked May 23, 2016 in Algorithms jothee 301 views
6 votes
0 answers
4
355 views
You are given two sorted lists of integers of size $m$ and $n$. Describe a divide and conquer algorithm for computing the $k$-th smallest element in the union of the two lists in time $O(\log m + \log n)$.
asked May 23, 2016 in Algorithms jothee 355 views
...