Quantcast
Channel: Graph theory algorithm to find vertex with out-degree 0 and in-degree (n-1) - Stack Overflow
Browsing all 4 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Answer by ayushkamadji for Graph theory algorithm to find vertex with...

It can be done in O(n) if you represent the directed graph with two adjacency list, one representing going into the node and another going out of the node.In-listA -> B, CB -> DC -> D ->...

View Article



Answer by Ghasem for Graph theory algorithm to find vertex with out-degree 0...

I agree with Beta, there is no way you can solve this problem by o(n), because you have to visit each edge at least once to verify that it is a get-stuck node.

View Article

Answer by Beta for Graph theory algorithm to find vertex with out-degree 0...

(I assume that n is vertices and m is edges.)Note that there is at most one get-stuck vertex in a graph.Suppose we have an O(n) algorithm. If m is large, we must reach a conclusion without considering...

View Article

Graph theory algorithm to find vertex with out-degree 0 and in-degree (n-1)

I'm wondering how to determine whether a directed graph has a get-stuck vertex, which is defined as a vertex with in-degree n-1 and out-degree 0. I guess the dumb way would be to print the in-degree...

View Article
Browsing all 4 articles
Browse latest View live


Latest Images