Question: Revisit this problem ( look up the solution, it should be solved already ) : - - - - - - - - - -

Revisit this problem (look up the solution, it should be solved already):
---------------------------------------------
You are designing the curriculum for a set of courses, each with prerequisites.
Additionally, some courses must be taken simultaneously, meaning that students can-not split them across different semesters. Your goal is to determine if its possible to schedule the courses in a way that satisfies the prerequisites and accommodates the simultaneous course requirements.
Let C denote the set of courses. Let P re : C ->2C represent the prerequisites, i.e.,
for each course c in C, P re(c) C is the set of courses that must be taken before
c. Finally, S 2C is the set where each element of S is a set of courses that must
be taken simultaneously. Write an efficient algorithm that takes C, P re, and S as
input and returns true if it is possible to schedule the courses in a way that satisfies
the prerequisites and accommodates the simultaneous course requirements and returns false otherwise. Analyze the runtime of your algorithm using Big-O notation
------------------------------------------------
So, no that you have reviewed that problem, Let us revisit Problem 3. Write an efficient algorithm to determine the minimum number of semesters required to complete the curriculum while satisfying prerequisites and simultaneous course requirements. Analyze the runtime of your algorithm using Big-O notation.
Hint: Consider a graph G =(V, E). Let L : V -> N denote a function such that for
any vertex v in V , L(v) is the length of the longest path in G that ends at v. A key
observation to solve this problem is that for any given vertex v, we have
L(v)={0 if there is no incoming edge to v, max* L(v)+1 otherwise }
*v in V s.t.(v,v) in E

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!