Count all cycles in simple undirected graph (Scripts) Publisher's description
from Jeff Howbert
Counts all cycles in input graph up to (optional) specified size limit
Counts all cycles in input graph up to (optional) specified size limit, using a backtracking algorithm. Designed for undirected graphs with no self-loops or multiple edges. Returns count of each size cycle from 3 up to size limit, and elapsed time.
Algorithm is guaranteed to find each cycle exactly once. It is essentially equivalent to Johnson (SIAM J. Comput. (1975), 4, 77), but for undirected graphs, and without the look-ahead feature. The lack of look-ahead is expected to have negligible performance impact on dense random graphs.
Reads input graph using separate m-file readGraph(), which supports reading a graph from a file or workspace array in four different formats. A test file for each format is included.
In practice this algorithm is much faster than the ILCA cycle counting algorithm posted by Joe Kirk (run_loops.m).
System Requirements:MATLAB 7.12 (2011a)
Program Release Status: New Release
Program Install Support: Install and Uninstall