cyclomatic_number#
- cyclomatic_number(domain, network_name)#
Calculate the cyclomatic number of a network. The cyclomatic number counts the number of elementary cycles.
- Parameters:
- domainobject
The domain containing the networks.
- network_namestr
The name of the network within the domain.
- Returns:
- int
The cyclomatic number of the specified network.
- Raises:
- RuntimeError
If the network name is not found in the list of generated networks.
Notes
The cyclomatic number is calculated using the formula: cyclomatic_number = E - N + C for C the number of connected components, E the number of edges, and N the number of nodes.
This is a measure of the complexity of the network, indicating the number of independent paths through the network. The cyclomatic number is also known as the first Betti number in algebraic topology.