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

前端 未结 7 982
死守一世寂寞
死守一世寂寞 2021-02-01 10:17

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

7条回答
  •  迷失自我
    2021-02-01 10:20

    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 queried. If the algorithm outputs v, then the adversary makes it wrong by putting in every edge with sink w, and similarly if the algorithm outputs w.

提交回复
热议问题