Let G = (V, E) be a directed graph. A black hole is a vertex v ? V such that and
ID: 3587907 • Letter: L
Question
Let G = (V, E) be a directed graph. A black hole is a vertex v ? V such that
and v has no outgoing edge.
(a) Prove or disprove: in a directed graph, there is at most one black hole.
(b) Design an algorithm which can detect whether or not there is a black hole in a directed graph. Your score on this question will depend on how efficient your algorithm is. You must describe your algorithm in plain English (no pseudocode). You must clearly state what graph representation you are working with (adjacency matrix or adjacency lists). You must give the running time of your algorithm and explain why you get this running time. Maximum one page.
Explanation / Answer
Solution:
This can be proved by contradiction that in a directed graph, there is at most one black hole.
b)
G= (V, E) be a directed graph. A black hole is a vertex v belongs to V
An algorithm, which detect if there is a black hole in a directed graph.
The algorithm is as follows:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.