Simple Paths and Cycles
A simple path repeats no vertices (except that the first can be the last):
- p = {Seattle, Salt Lake City, San Francisco, Dallas}
- p = {Seattle, Salt Lake City, Dallas, San Francisco, Seattle}
-
A cycle is a path that starts and ends at the same node:
- p = {Seattle, Salt Lake City, Dallas, San Francisco, Seattle}
A simple cycle is a cycle that repeats no vertices except that the first vertex is also the last (in undirected graphs, no edge can be repeated)