Question: Let G=(V,E) be a directed graph with n vertices. A vertex s is a drain if, for every v in V except for s, thre
Let G=(V,E) be a directed graph with n vertices. A vertex s is a drain if, for every v in V except for s, thre is an edge from v to s, and there is no edge from s to v. Give an O(n) algorithm to determine whether or not G has a drain assuming that G is given by its n by n adjacency matrix.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
