Question: A vertex u in a directed graph is defined as a black-hole vertex if there is an edge from every other vertex to u,

A vertex u in a directed graph is defined as a black-hole 

A vertex u in a directed graph is defined as a black-hole vertex if there is an edge from every other vertex to u, and there is no edge from u to any other vertex. Given the adjacency matrix representation G, design an algorithm to decide if G contains a black-hole vertex. Your algorithm should run in O(|V|) time. (The time to load the adjacency matrix does not count towards to the running time.)

Step by Step Solution

3.43 Rating (143 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

As described in the problem a Black Hole vertex is the one having indegree V1 and outdegree as 0 In ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!