enumerate_cycle_nodes

Enumerates the cycles in a graph and returns the nodes of the cycles.

sasviya.network.algorithms.cycles.enumerate_cycle_nodes(g, maxcycles='ALL', minlength=1, maxlength=None, node_weight=None, edge_weight=None, minedgewt=None, maxedgewt=None, minnodewt=None, maxnodewt=None, maxtime=None, source=None)

Parameters

g : SAS graph object

Specifies the input graph for which to count cycles.

maxcycles : int or ‘ALL’, optional

Specifies the maximum number of cycles to count. The default is ‘ALL’.

minlength : int, optional

Specifies the minimum number of edges in cycles that are counted. The default is 1.

maxlength : int, optional

Specifies the maximum number of edges in cycles that are counted. The default is None.

node_weight : str or None, optional

Specifies the node attribute that corresponds to the node weight. The default is None. When the value is None, a weight of 1 is assumed for all nodes.

edge_weight : str or None, optional

Specifies the edge attribute that corresponds to the edge weight. The default is None. When the value is None, a weight of 1 is assumed for all edges.

minedgewt : float or None, optional

Specifies the minimum sum of edge weights in a cycle. The default is None.

maxedgewt : float or None, optional

Specifies the maximum sum of edge weights in a cycle. The default is None.

minnodewt : float or None, optional

Specifies the minimum sum of node weights in a cycle. The default is None.

maxnodewt : float or None, optional

Specifies the maximum sum of node weights in a cycle. The default is None.

maxtime : float or None, optional

Specifies the approximate maximum number of seconds to spend on enumeration. The default is None.

source : node or None, optional

Specifies the source node for cycle calculations. The default is None.

Yields

generator

Yields a generator of cycles, each of which is given as a list of the cycles’ nodes. The generator has the solution_summary attribute, which contains information about the results of the algorithm.

Last updated: July 28, 2026