Reputation: 2311
I can't find a formal definition of cycle in an undirected graph. The CLRS only reports a definition of symple cycles that i can't manage to generalize for a generic cycle.
This is the CLRS definition: a symple cycle in a undirected graph is a path <v0,v1,..,vk>
so that:
k >= 3
v0 = vk
v1,..,vk
are distinctsSo i tried to remove the 3
condition to define a generic cycle but this can't work because we can have something like this: <a, b, c, b, a>
that is obviously not a cycle.
Upvotes: 2
Views: 2195
Reputation: 5448
Path in graph theory means list of edges or/and vertices satisfying some connectivity conditions. Cycle is closed path, first and last list element are same. Wikipedia article
Path or cycle is called simple if there are no repeated vertices or edges other than the starting and ending vertices. Your example is cycle, but not simple cycle.
Upvotes: 0
Reputation: 7044
I think you can generalize 3 as follows:
Upvotes: 1