Can forests have circuits?

79 Views Asked by At

One condition for a graph to be a forest is to not have loops. However, I couldn't understand if it can't have circuits either. So my question, if the circuit isn't a loop, can it have a circuit and still be a tree?

1

There are 1 best solutions below

5
On

No, a forest cannot have a circuit, because a circuit cannot repeat any edge. As a result, any graph that contains a circuit also contains a cycle.

Added: Either the circuit is a cycle, or it has more than one vertex that repeats. Among all repetitions, take the shortest; say that it’s from vertex $v$ back to vertex $v$. The part of the circuit from $v$ back to $v$ is then a cycle: the choice of $v$ ensures that $v$ is the only vertex repeated in that segment.