1. If v is visited for the first time as we traverse the edge (u,v), then the edge is a treeedge. 
2. Else, v has already been visited: 
(a) If v is an ancestor of u, then edge (u,v) is a backedge. 
(b) Else, if v is a descendant of u, then edge (u,v) is a forwardedge. 
(c) Else, if v is neither an ancestor or descendant of u, then edge (u,v) is a crossedge.