Number of cycles in a graph?


Answered By : Shaull

Assuming you mean simple cycles (otherwise the number is infinite) – yes, of course the number can be exponential: consider the complete graph on $n$ vertices, then every sequence of distinct vertices can be completed to a simple cycle. So you get at least $n!$ cycles. Even if you ignore cyclic permutations of a cycle, this is still exponential: you can take only cycles of length $n/2$, and you have more than ${nchoose n/2}$ such cycles.
Problem Detail: Can the number of cycles in a graph (undirected/directed) be exponential in the number of edges/vertices? I’m looking for a polynomial algorithm for finding all cycles in a graph and was wondering if it’s even possible.

Asked By : Shmoopy
Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/10427

Leave a Reply