Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8. Typically departments in universities (like Carleton) offer many courses, but to register in a course, one needs to have completed all the required prerequisite

image text in transcribed

8. Typically departments in universities (like Carleton) offer many courses, but to register in a course, one needs to have completed all the required prerequisite courses. We can easily model this relationship as a directed graph, where each course is a vertex, and a directed edge from course u to v if and only if u is a prerequisite course for taking w. It should be clear that this graph should not contain any directed cycles (otherwise we won't graduate!). (For example, if COMP 1405 and COMP 1805 are required for taking COMP 2402, and COMP 2402 is required for taking COMP 3804, we will have directed edges from vertices corresponding to COMP 1805 and COMP 1405 to COMP 2402, and a directed edge from COMP 2402 to COMP 3804.) Given a directed graph G- (V, E) in adjacency list representation, representing the courses and their prerequisites, your task is to compute minimum number of terms one needs to spend in the department to complete the degree, where you can assume that you can do any number of courses in any term, provided that the prerequisite conditions are met

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions