In order to find the kind of the edges of a graph, at which we applied the Depth-first search algorithm, we could use this:
tree edges: x -> y when [d[y],f[y]] ⊂ [d[x],f[x]]
forward edges: x -> y when [d[x],f[x]] ⊂ [d[y],f[y]]
back edges: x -> y when [d[y],f[y]] ⊂ [d[x],f[x]]
Cross edges: x -> y when [d[x],f[x]] ∩ [d[y],f[y]]=∅
Discovery Time: The discovery time d[v] is the number of nodes discovered or finished before first seeing v.
Finishing Time: The finishing time f[v] is the number of nodes discovered or finished before finishing the expansion of $v$.
That's the graph I am looking at:

And here are the discovery and finish times I found:

Algorithm:
Depthfirstsearch(G)
for each v ∈ V
color[v]=white
p[v]=NIL
time=0
for each v ∈ V
if color[v]=white then
Visit(v)
Visit(u)
color[u]=gray
time=time+1
d[u]=time
for each v ∈ Adj[u]
if color[v]=white then
p[v]=u
Visit(v)
color[u]=black
time=time+1
f[u]=time
When we have for example the case [d[y],f[y]] ⊂ [d[x],f[x]] how can we know if it is a tree edge or a back edge?
Do we have to mark the parent of each node, like that:

and if there is red edge we know that it is a tree edge? If so, could you explain me why?
Also, aren't jh,ia forward edges and ag a back edge? Or am I wrong?
