You start from a vertex, then if you reach that vertex before dfs on that vertex finishes, then the edge u used to reach it is a back edge. And if you reach after the dfs finishes on that node, it's a cross edge.
-------------------------------------------------- Rohit Saraf Second Year Undergraduate, Dept. of Computer Science and Engineering IIT Bombay http://www.cse.iitb.ac.in/~rohitfeb14 On Sun, Jun 20, 2010 at 6:23 PM, Piyush Verma <[email protected]> wrote: > back edge is usefull to find a cycle in graph > in finding cycle algorithm ( using DFS) we mark every edge as "back edge" > or "tree edge" > then traverse again total number of back edges give the number of cycle > present in directed graph. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
