I have a graph with n nodes as an adjacency matrix.
Is it possible to detect a sink in less than O(n) time?
If yes, how? If no
Reading the link provided by SPWorley I was reminded of tournament tree algo for finding the minimum element in an array of numbers. The node at the top of the tree is a minimum element. Since the algorithm in the link also speaks about competition between two nodes (v,w) which is succeeded by w if v->w otherwise by v. We can use an algorithm similar to finding minimum element to find out a sink. However, a node is returned irrespective of the existence of a sink. Though, if a sink exists it is always returned. Hence, we finally have to check that the returned node is a sink.
//pseudo code
//M -> adjacency matrix
int a=0
for(int i=1;i