Skip to main content

Module simple_cycles

Module simple_cycles 

Source
Expand description

Enumerate all simple cycles — Johnson’s algorithm (ALGO-CY-003).

Counterpart of igraph_simple_cycles() from references/igraph/src/cycles/simple_cycles.c.

A simple cycle is a closed path without repeated vertices. Uses Johnson’s algorithm (1975) which systematically enumerates all elementary circuits of a directed graph. For undirected graphs, the algorithm treats them as symmetric directed graphs with duplicate-cycle suppression.

Reference: Johnson DB, “Finding all the elementary circuits of a directed graph.” SIAM J. Comput. 4(1):77–84, 1975.

Structs§

SimpleCycle
A single simple cycle found by Johnson’s algorithm.

Enums§

SimpleCycleMode
Mode for following edges during cycle search.

Functions§

simple_cycles
Finds all simple cycles in the graph using Johnson’s algorithm.