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: Figure 2: Example of 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. CS 111 CS 141 CS 151 CS 261 CS 362 CS 211 CS 361 CS 401 CS 251 CS 342 CS 301 Figure 3: UIC CS Courses a Is the following ordering a topological sort of G? Justify your answer. CS 111, CS 141, CS 211, CS 261, CS 362, CS 361, CS 151, CS 251, CS 401, CS 342, CS 301. b Give two different topological sorts of G. c 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
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:
Figure 2: Example of 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.
CS 111
CS 141
CS 151
CS 261
CS 362
CS 211
CS 361
CS 401
CS 251
CS 342
CS 301
Figure 3: UIC CS Courses
a Is the following ordering a topological sort of G? Justify your answer. CS 111, CS 141, CS 211, CS
261, CS 362, CS 361, CS 151, CS 251, CS 401, CS 342, CS 301.
b Give two different topological sorts of G.
c 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: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: Figure 2: Example of 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. CS 111 CS 141 CS 151 CS 261 CS 362 CS 211 CS 361 CS 401 CS 251 CS 342 CS 301 Figure 3: UIC CS Courses a Is the following ordering a topological sort of G? Justify your answer. CS 111, CS 141, CS 211, CS 261, CS 362, CS 361, CS 151, CS 251, CS 401, CS 342, CS 301. b Give two different topological sorts of G. c 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
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
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