I am not asking an algorithm, I am asking definitions.
There is this question: given a graph to detect if it is a tree or not in directed and undirected graphs? According to the selected answer, I came up with the following:
For a directed graph to be a valid tree, it must satisfy all the facts:
- The graph must have only 1 vertex that has purely outgoing edges.
- The graph is connected.
- The undirected version of this graph has no cycles.
I searched online for this and seems like most people agree with these points.
However I am still confused. For example, are the following graphs valid trees?:
G1:
G2:
If yes, why? If no, why?
Any help is appreciated! Thanks!