Abbreviations
(16 points) Suppose is a directed acyclic graph represented by a adjacency lists. Divise a linear time algorithm that, given such a
, returns the length of the longest path in
. Prove your algorithm runs in
-time
(16 points) Suppose is a directed graph represented by a adjacency lists. Divise a linear time algorithm that, given such a
, returns a list of all the source vertices of
. (Note, this list may be empty.) Prove your algorithm runs in
-time.
Hint: There is a simple solution that does not involve any DFS’s or BFS’s.
(16 points) DPV Problem 3.18
(16 points) DPV Problem 3.22
Hint: First consider the special case of G being an directed acyclic graph.
(16 points) DPV Problem 3.23
(20 points) DPV Problem 4.1