given a directed acyclic graph G(V, E) such that the vertices of G correspond to tasks. If there is an edge from one task to another, that task is a prerequisite for the other task. Design an O(V+E) time algorithm that computes the smallest number of batches required to complete all tasks. A task can be assigned to a batch i if and only if all tasks that are its prerequisites have already been assigned to batches 1 to (i-1).