When generating a fundamental cycle in a graph, addition of a
single edge to a spanning tree gives a "hairy" cycle, that is,
a single cycle with some dangling branches of the tree. This
routine removes iteratively all leaves from this "hairy" tree
until only a 2-regular, connected cycle remains, which is a
fundamental cycle of the graph with respect the given spanning
tree.