Finding backedges in a graph, with special conditions.

Posted by Morteza M. on Stack Overflow See other posts from Stack Overflow or by Morteza M.
Published on 2010-06-05T08:35:02Z Indexed on 2010/06/05 8:42 UTC
Read the original article Hit count: 329

Filed under:
|

There is a vertex v, such that from the subtree rooted at v, there are at least two backedges to proper ancestors of v.

The problem is finding whether such backedges exist or not ( finding v is not important at all). I run DFS algorithm, I can find backedges and save them in an array. I know which backedges in this array belong to a common tree. but I have problem on matching this condition in O(E) time.

can anyone help me with that?

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about graph