sink-vertex

Graphs: find a sink in less than O(|V|) - or show it can't be done

耗尽温柔 提交于 2021-02-05 18:57:44
问题 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, how do we prove it? Sink vertex is a vertex that has incoming edges from other nodes and no outgoing edges. 回答1: Suppose to the contrary that there exists an algorithm that queries fewer than (n-2)/2 edges, and let the adversary answer these queries arbitrarily. By the Pigeonhole Principle, there exist (at least) two nodes v, w that are not an endpoint of any edge

Graphs: find a sink in less than O(|V|) - or show it can't be done

限于喜欢 提交于 2021-02-05 18:56:42
问题 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, how do we prove it? Sink vertex is a vertex that has incoming edges from other nodes and no outgoing edges. 回答1: Suppose to the contrary that there exists an algorithm that queries fewer than (n-2)/2 edges, and let the adversary answer these queries arbitrarily. By the Pigeonhole Principle, there exist (at least) two nodes v, w that are not an endpoint of any edge