Find cycles in graphs which do not contain other cycles

The term smallest cycle is not defined well. Informally, graphs are used when we only care about the the relations between vertices (whether there are edges or not) only. Look at the graphs that I posted. For you, are these graphs different ?enter image description here

In the left graph, imagine rotating the points 5,6 around the imaginary line joining vertices 2,4 180 degrees. Now we get the graph on the right. In fact, these two graphs are isomorphic. Now in the right graph I guess you would select the cycle 12643 and leave 12543. In the right graph, you would do the opposite . But the two graphs are really the same.

Thus, your definition of shortest cycles is not a graph property since two isomorphic graphs may not satisfy it together.

Note: If you do not consider the right and left objects the same, then it is not possible to treat them as graphs for your application. Maybe you will need to talk about the coordinates of the vertices.


Minimal cycles (those that contain no cycles as strict subsets) are called circuits.

Itai and Rodeh gave an algorithm in 1977 that finds a circuit of minimal size.

Boros et alii in 2006 gave a general algorithm that finds (enumerates) all circuits with up to $k$ nodes in incremental polynomial time, for a more general situation (in matroids). The degree of the polynomial depends on $k$. So the task of finding all circuits of size $\le k = 10$ for a graph with $n = 1000$ nodes may be computationally infeasible. I think there are exceptions for certain type of graphs, perhaps planar ones.


I think the problem is a bit incorrectly specified. And amr is completely right..

You could get a criterion like this:

For a particular cycle there are no other shorter(less edges) cycles on its subset of vertices. (If this is true, that particular cycle is "simple")

Check in you array of result circles, which ones comprise the shorter ones and delete them.

However, that won't deal with the described problem of isomorphism and you would get 3 subgraphs from amr's picture

Tags:

Graph Theory