Additional Topics: Topological Sort A strict order relation can be represented by a directed acyclic graph (or DAG), which is a directed graph with no cycles. For example, the following directed graph is a DAG: A topological sort of a DAG is an ordering of the vertices that is consistent with the edges of the graph. That is, if there is an edge (u, v) in the graph, then u should appear before v in the topological sort. For example, 1, 2, 3 and 1,3, 2 are topological sorts of the DAG shown above, but 2, 1,3 is not a topological sort because 2 cannot be listed before 1. 7. Given the following DAG G representing UIC's Computer Science courses and prerequisites (note that edges implied by the transitive property are omitted): Cs 261 Cs 302 Cs 141 CS 111 CS 211 Cs 361 CS 401 CS 151 CS 251 CS 342 Cs 301 Answer the following questions: а. Give two different topological sorts of G. b. Is each of the following orderings a topological sort of G? Justify your answer. Cs111, CS151, CS301, CS251, CS342, CS141, CS211, cS261, CS361, CS362, CS401. Cs111, CS141, CS211, CS261, CS361, CS362, CS151, CS251, CS342, cs401, CS301. If a student can take an unlimited number of courses per semester, what is the fewest number of semesters required to complete these courses? Justify your answer.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
Additional Topics: Topological Sort
A strict order relation can be represented by a directed acyclic graph (or DAG), which is a directed
graph with no cycles. For example, the following directed graph is a DAG:
A topological sort of a DAG is an ordering of the vertices that is consistent with the edges of the
graph. That is, if there is an edge (u, v) in the graph, then u should appear before v in the
topological sort. For example, 1,2,3 and 1,3, 2 are topological sorts of the DAG shown above, but
2,1,3 is not a topological sort because 2 cannot be listed before 1.
7.
Given the following DAG G representing UIC's Computer Science courses and
prerequisites (note that edges implied by the transitive property are omitted):
CS 261
CS 362
CS 141
CS 11
CS 211
Cs 361
CS 401
CS 151
CS 251
CS 342
Cs 301
Answer the following questions:
a.
Give two different topological sorts of G.
b.
Is each of the following orderings a topological sort of G? Justify your answer.
CS111, CS151, CS301, CS251, CS342, CS141, CS211, CS261, CS361, cs362, CS401.
• CS111, CS141, CS211, CS261, cs361, CS362, CS151, CS251, CS342, CS401, CS301.
If a student can take an unlimited number of courses per semester, what is the
fewest number of semesters required to complete these courses? Justify your answer.
с.
Transcribed Image Text:Additional Topics: Topological Sort A strict order relation can be represented by a directed acyclic graph (or DAG), which is a directed graph with no cycles. For example, the following directed graph is a DAG: A topological sort of a DAG is an ordering of the vertices that is consistent with the edges of the graph. That is, if there is an edge (u, v) in the graph, then u should appear before v in the topological sort. For example, 1,2,3 and 1,3, 2 are topological sorts of the DAG shown above, but 2,1,3 is not a topological sort because 2 cannot be listed before 1. 7. Given the following DAG G representing UIC's Computer Science courses and prerequisites (note that edges implied by the transitive property are omitted): CS 261 CS 362 CS 141 CS 11 CS 211 Cs 361 CS 401 CS 151 CS 251 CS 342 Cs 301 Answer the following questions: a. Give two different topological sorts of G. b. Is each of the following orderings a topological sort of G? Justify your answer. CS111, CS151, CS301, CS251, CS342, CS141, CS211, CS261, CS361, cs362, CS401. • CS111, CS141, CS211, CS261, cs361, CS362, CS151, CS251, CS342, CS401, CS301. If a student can take an unlimited number of courses per semester, what is the fewest number of semesters required to complete these courses? Justify your answer. с.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education