Skip to content

Cyclomatic number

The dimension of an undirected graph's cycle space, equal to the minimum number of edges whose removal makes it acyclic and computed as edges minus vertices plus connected components.

Version
v2 · 2026-09-19 · History
Domain-specific #
4015
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomain
Graph Theory → Mathematics

Core Idea

Also called circuit rank or cycle rank, the number counts independent cycles, is additive over components and equals the number of non-tree edges relative to any spanning forest. A spanning forest contributes one fewer edge than vertices in each component; every remaining edge closes one independent fundamental cycle, yielding e-v+c basis elements. The abstraction is therefore identified by a declared carrier, a transformation or constraint over that carrier, and an invariant that tells an analyst whether the named structure is genuinely present.

How would you explain it like I'm…

Extra Roads, Extra Loops

Imagine towns connected by roads. First you keep just enough roads so you can still get from any town to any town connected to it, with no loops. Every extra road you add back makes a new loop you could drive around. The cyclomatic number is how many of those extra roads there are.

Counting a Graph's Loops

In math, a graph is a set of dots connected by lines. The cyclomatic number counts how many independent loops the graph has. To find it, first keep only enough lines to connect everything without making any loop; this is called a spanning tree, or a spanning forest if the graph is in separate pieces. Each leftover line closes exactly one new loop. So the cyclomatic number equals the number of lines, minus the number of dots, plus the number of separate pieces.

Graph Circuit Rank

The cyclomatic number of a graph, also called its circuit rank or cycle rank, counts its independent cycles. Take any spanning forest, a subset of edges connecting each component with no cycles; in each component it uses one fewer edge than the number of vertices. Every edge left over closes exactly one fundamental cycle, and these cycles are independent. That gives the formula e − v + c, where e is the number of edges, v the number of vertices, and c the number of connected components. It is also the minimum number of edges you must remove to destroy every cycle, and it adds up across separate components. Conventions about loops and repeated edges should be stated, since they change e.

 

The cyclomatic number (circuit rank, cycle rank) of a finite undirected graph G is r = e − v + c, where e, v, and c are the numbers of edges, vertices, and connected components. The derivation uses a spanning forest: in each component a spanning tree has one fewer edge than vertices, so the forest has v − c edges, and each of the remaining e − v + c non-tree edges closes a unique fundamental cycle with the forest. These fundamental cycles form a basis of the cycle space, the vector space of edge sets with even degree at every vertex, over GF(2) (or the analogous space over other coefficient fields), so r is its dimension. Equivalently, r is the minimum number of edges whose removal leaves a forest. The number is additive over components and independent of which spanning forest is chosen. Whether self-loops and parallel edges are allowed must be fixed, as each contributes to e and to the cycle count.

Scope of Application

Cyclomatic number belongs to graph theory and is useful where the analyst can specify the typed graph theory carrier, defining objects and relations, parameters, conventions, evidence, boundary cases, and comparison targets, then evaluate the finite undirected graph, loop and parallel-edge convention, vertex and edge counts, connected components, spanning forest, cycle-space coefficient field, independent-cycle basis, edge-removal interpretation, and formula are explicit. The scope is broad within that domain but bounded by the need for the finite undirected graph, loop and parallel-edge convention, vertex and edge counts, connected components, spanning forest, cycle-space coefficient field, independent-cycle basis, edge-removal interpretation, and formula are explicit. The entry records a descriptive analytical identity; practical use requires the governing domain's evidence, standards, and safety obligations.

Clarity

The abstraction clarifies a crowded vocabulary by making the finite undirected graph, loop and parallel-edge convention, vertex and edge counts, connected components, spanning forest, cycle-space coefficient field, independent-cycle basis, edge-removal interpretation, and formula are explicit the center of the account. A claim should name the carrier, the governing operation or relation, the applicable assumptions, and the recognition test. A bare label is insufficient because the name Cyclomatic number can be used for a formal identity, an implementation, or a neighboring result unless carrier and convention are stated.

Manages Complexity

Without the abstraction, an analyst must reason directly over many local details: the carrier roles, admissibility assumptions, competing conventions, derived invariants, boundary cases, and proof or validation obligations specific to Cyclomatic number. Cyclomatic number compresses them into the roles in the structural signature. That compression permits comparison across instances without erasing the variables that determine validity. It also exposes which details may be varied safely and which are constitutive.

Abstract Reasoning

  1. Identify the carrier. State what the elements, states, objects, or observations are: the typed graph theory carrier, defining objects and relations, parameters, conventions, evidence, boundary cases, and comparison targets. Reject examples whose alleged carrier belongs to a different problem.
  2. Lock the constitutive rule. Express the finite undirected graph, loop and parallel-edge convention, vertex and edge counts, connected components, spanning forest, cycle-space coefficient field, independent-cycle basis, edge-removal interpretation, and formula are explicit independently of one notation or implementation.

Knowledge Transfer

Knowledge transfers strongly among subfields of graph theory because they reuse the typed graph theory carrier, defining objects and relations, parameters, conventions, evidence, boundary cases, and comparison targets, A spanning forest contributes one fewer edge than vertices in each component; every remaining edge closes one independent fundamental cycle, yielding e-v+c basis elements., and type the carrier, state every parameter and convention in the definition, test that the finite undirected graph, loop and parallel-edge convention, vertex and edge counts, connected components, spanning forest, cycle-space coefficient field, independent-cycle basis, edge-removal interpretation, and formula are explicit, compare the nearest accepted identity, and report counterexamples, uncertainty, and limiting cases.

Relationships to Other Abstractions

Local relationship map for Cyclomatic numberParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Cyclomatic numberDOMAINPrime abstraction: Dimension — is a kind ofDimensionPRIME

Current abstraction Cyclomatic number Domain-specific

Parents (1) — outgoing typed relations

  • Cyclomatic number is a kind of Dimension Prime

    It remains its own entry because its identity is fixed by the finite undirected graph, loop and parallel-edge convention, vertex and edge counts, connected components, spanning forest, cycle-space coefficient field, independent-cycle basis, edge-removal interpretation, and formula.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

Cyclomatic number sits in a crowded region of the domain-specific corpus (3rd percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.

Family — Graph Theory Structures & Invariants (48 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-25