In the book I am reading it tells me to choose a vertex with depth 0 but I do not understand how depth is calculated in a graph.
Looking at above example, it chooses vertex A as its starting point and explains that it has depth 0. In my understanding it has depth 0 because it has 0 in-degree (no incoming edges).
But what if the graph is un-directed how do we calculate its depth?
If I think of it as a tree where A is the root it seems to me that I assign G to be the root and thus this time G would have depth 0 thus become a starting point.
I've watched lectures, read articles but cannot figure out how to find a starting point in an un-directed graph and for directed graph is my understanding correct (0 depth => 0 in-degree)?
Thanks in advance.