Circuit Rank
   HOME

TheInfoList



OR:

In
graph theory In mathematics and computer science, graph theory is the study of ''graph (discrete mathematics), graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of ''Vertex (graph ...
, a branch of
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, the cyclomatic number, circuit rank, cycle rank, or nullity of an
undirected graph In discrete mathematics, particularly in graph theory, a graph is a structure consisting of a set of objects where some pairs of the objects are in some sense "related". The objects are represented by abstractions called '' vertices'' (also call ...
is the minimum number of edges that must be removed from the graph to break all its cycles, making it into a
tree In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, e.g., including only woody plants with secondary growth, only ...
or
forest A forest is an ecosystem characterized by a dense ecological community, community of trees. Hundreds of definitions of forest are used throughout the world, incorporating factors such as tree density, tree height, land use, legal standing, ...
.


Formula

The cyclomatic number of a graph equals the number of independent cycles in the graph, the size of a
cycle basis In graph theory, a branch of mathematics, a cycle basis of an undirected graph is a set of simple cycles that forms a basis of the cycle space of the graph. That is, it is a minimal set of cycles that allows every even-degree subgraph to be exp ...
. Unlike the corresponding feedback arc set problem for directed graphs, the cyclomatic number is easily computed using the formula: r = e - v + c, where is the number of edges in the given graph, is the number of vertices, and is the number of connected components. . It is possible to construct a minimum-size set of edges that breaks all cycles efficiently, either using a
greedy algorithm A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locally ...
or by complementing a
spanning forest In the mathematical field of graph theory, a spanning tree ''T'' of an undirected graph ''G'' is a subgraph that is a tree which includes all of the vertices of ''G''. In general, a graph may have several spanning trees, but a graph that is not ...
. The cyclomatic number can be explained in terms of algebraic graph theory as the
dimension In physics and mathematics, the dimension of a mathematical space (or object) is informally defined as the minimum number of coordinates needed to specify any point within it. Thus, a line has a dimension of one (1D) because only one coo ...
of the
cycle space In graph theory, a branch of mathematics, the (binary) cycle space of an undirected graph is the set of its even-degree subgraphs. This set of subgraphs can be described algebraically as a vector space over the two-element finite field. The dime ...
of a graph, in terms of
matroid theory In combinatorics, a matroid is a structure that abstracts and generalizes the notion of linear independence in vector spaces. There are many equivalent ways to define a matroid Axiomatic system, axiomatically, the most significant being in terms ...
as the corank of a
graphic matroid In the mathematical theory of Matroid theory, matroids, a graphic matroid (also called a cycle matroid or polygon matroid) is a matroid whose independent sets are the tree (graph theory), forests in a given finite undirected graph. The dual matr ...
, and in terms of
topology Topology (from the Greek language, Greek words , and ) is the branch of mathematics concerned with the properties of a Mathematical object, geometric object that are preserved under Continuous function, continuous Deformation theory, deformat ...
as one of the
Betti number In algebraic topology, the Betti numbers are used to distinguish topological spaces based on the connectivity of ''n''-dimensional simplicial complexes. For the most reasonable finite-dimensional spaces (such as compact manifolds, finite simplicia ...
s of a
topological space In mathematics, a topological space is, roughly speaking, a Geometry, geometrical space in which Closeness (mathematics), closeness is defined but cannot necessarily be measured by a numeric Distance (mathematics), distance. More specifically, a to ...
derived from the graph. It counts the ears in an ear decomposition of the graph, forms the basis of
parameterized complexity In computer science, parameterized complexity is a branch of computational complexity theory that focuses on classifying computational problems according to their inherent difficulty with respect to ''multiple'' parameters of the input or output. ...
on almost-trees, and has been applied in
software metric In software engineering and development, a software metric is a standard of measure of a degree to which a software system or process possesses some property. Even if a metric is not a measurement (metrics are functions, while measurements are t ...
s as part of the definition of cyclomatic complexity of a piece of code. The concept was introduced and called the cyclomatic number by
Gustav Kirchhoff Gustav Robert Kirchhoff (; 12 March 1824 – 17 October 1887) was a German chemist, mathematician, physicist, and spectroscopist who contributed to the fundamental understanding of electrical circuits, spectroscopy and the emission of black-body ...
.


For hypergraphs

The cyclomatic number of a
hypergraph In mathematics, a hypergraph is a generalization of a Graph (discrete mathematics), graph in which an graph theory, edge can join any number of vertex (graph theory), vertices. In contrast, in an ordinary graph, an edge connects exactly two vert ...
can be derived by its Levi graph, with the same cyclomatic number but reduced to a simple graph. It is r = g - (v + e) + c, where is the degree sum (and the number of edges in the Levi graph), is the number of hyperedges in the given hypergraph, is the number of vertices, and is the number of connected components. The ''degree sum'' of a hypergraph is the sum of the degrees of all the vertices, reducing to for a simple graph, or for a -uniform hypergraph. This formula is symmetric between vertices and edges which demonstrates a hypergraph and its dual hypergraph have the same cyclomatic number.


Matroid rank and construction of a minimum feedback edge set

The cyclomatic number of a graph may be described using
matroid theory In combinatorics, a matroid is a structure that abstracts and generalizes the notion of linear independence in vector spaces. There are many equivalent ways to define a matroid Axiomatic system, axiomatically, the most significant being in terms ...
as the corank of the
graphic matroid In the mathematical theory of Matroid theory, matroids, a graphic matroid (also called a cycle matroid or polygon matroid) is a matroid whose independent sets are the tree (graph theory), forests in a given finite undirected graph. The dual matr ...
of . Using the greedy property of matroids, this means that one can find a minimum set of edges that breaks all cycles using a
greedy algorithm A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locally ...
that at each step chooses an edge that belongs to at least one cycle of the remaining graph. Alternatively, a minimum set of edges that breaks all cycles can be found by constructing a
spanning forest In the mathematical field of graph theory, a spanning tree ''T'' of an undirected graph ''G'' is a subgraph that is a tree which includes all of the vertices of ''G''. In general, a graph may have several spanning trees, but a graph that is not ...
of and choosing the complementary set of edges that do not belong to the spanning forest.


The number of independent cycles

In algebraic graph theory, the cyclomatic number is also the dimension of the
cycle space In graph theory, a branch of mathematics, the (binary) cycle space of an undirected graph is the set of its even-degree subgraphs. This set of subgraphs can be described algebraically as a vector space over the two-element finite field. The dime ...
of G. Intuitively, this can be explained as meaning that the cyclomatic number counts the number of independent cycles in the graph, where a collection of cycles is independent if it is not possible to form one of the cycles as the
symmetric difference In mathematics, the symmetric difference of two sets, also known as the disjunctive union and set sum, is the set of elements which are in either of the sets, but not in their intersection. For example, the symmetric difference of the sets \ and ...
of some subset of the others. This count of independent cycles can also be explained using
homology theory In mathematics, the term homology, originally introduced in algebraic topology, has three primary, closely-related usages. The most direct usage of the term is to take the ''homology of a chain complex'', resulting in a sequence of abelian grou ...
, a branch of topology. Any graph may be viewed as an example of a
simplicial complex In mathematics, a simplicial complex is a structured Set (mathematics), set composed of Point (geometry), points, line segments, triangles, and their ''n''-dimensional counterparts, called Simplex, simplices, such that all the faces and intersec ...
, a type of topological space formed by representing each graph edge by a
line segment In geometry, a line segment is a part of a line (mathematics), straight line that is bounded by two distinct endpoints (its extreme points), and contains every Point (geometry), point on the line that is between its endpoints. It is a special c ...
and gluing these line segments together at their endpoints. The cyclomatic number is the
rank A rank is a position in a hierarchy. It can be formally recognized—for example, cardinal, chief executive officer, general, professor—or unofficial. People Formal ranks * Academic rank * Corporate title * Diplomatic rank * Hierarchy ...
of the first (
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
)
homology group In mathematics, the term homology, originally introduced in algebraic topology, has three primary, closely-related usages. The most direct usage of the term is to take the ''homology of a chain complex'', resulting in a sequence of abelian grou ...
of this complex, r = \operatorname\left _1(G,\Z)\right Because of this topological connection, the cyclomatic number of a graph is also called the first
Betti number In algebraic topology, the Betti numbers are used to distinguish topological spaces based on the connectivity of ''n''-dimensional simplicial complexes. For the most reasonable finite-dimensional spaces (such as compact manifolds, finite simplicia ...
of . More generally, the first Betti number of any topological space, defined in the same way, counts the number of independent cycles in the space.


Applications


Meshedness coefficient

A variant of the cyclomatic number for
planar graph In graph theory, a planar graph is a graph (discrete mathematics), graph that can be graph embedding, embedded in the plane (geometry), plane, i.e., it can be drawn on the plane in such a way that its edges intersect only at their endpoints. ...
s, normalized by dividing by the maximum possible cyclomatic number of any planar graph with the same vertex set, is called the meshedness coefficient. For a connected planar graph with edges and vertices, the meshedness coefficient can be computed by the formula :\frac. Here, the numerator m-n+1 of the formula is the cyclomatic number of the given graph, and the denominator 2n-5 is the largest possible cyclomatic number of an -vertex planar graph. The meshedness coefficient ranges between 0 for trees and 1 for maximal planar graphs.


Ear decomposition

The cyclomatic number controls the number of ears in an ear decomposition of a graph, a partition of the edges of the graph into paths and cycles that is useful in many graph algorithms. In particular, a graph is 2-vertex-connected if and only if it has an open ear decomposition. This is a sequence of subgraphs, where the first subgraph is a simple cycle, the remaining subgraphs are all simple paths, each path starts and ends on vertices that belong to previous subgraphs, and each internal vertex of a path appears for the first time in that path. In any biconnected graph with circuit rank r, every open ear decomposition has exactly r ears.


Almost-trees

A graph with cyclomatic number r is also called an ''-almost-tree'', because only edges need to be removed from the graph to make it into a tree or forest. A 1-almost-tree is a ''near-tree'', and a connected near-tree is a pseudotree, a cycle with a (possibly trivial) tree rooted at each vertex. Several authors have studied the
parameterized complexity In computer science, parameterized complexity is a branch of computational complexity theory that focuses on classifying computational problems according to their inherent difficulty with respect to ''multiple'' parameters of the input or output. ...
of graph algorithms on -near-trees, parameterized by r.


Generalizations to directed graphs

The cycle rank is an invariant of directed graphs that measures the level of nesting of cycles in the graph. It has a more complicated definition than cyclomatic number (closely related to the definition of tree-depth for undirected graphs) and is more difficult to compute. Another problem for directed graphs related to the cyclomatic number is the minimum feedback arc set, the smallest set of edges whose removal breaks all directed cycles. Both cycle rank and the minimum feedback arc set are
NP-hard In computational complexity theory, a computational problem ''H'' is called NP-hard if, for every problem ''L'' which can be solved in non-deterministic polynomial-time, there is a polynomial-time reduction from ''L'' to ''H''. That is, assumi ...
to compute. It is also possible to compute a simpler invariant of directed graphs by ignoring the directions of the edges and computing the circuit rank of the underlying undirected graph. This principle forms the basis of the definition of cyclomatic complexity, a software metric for estimating how complicated a piece of computer code is.


Computational chemistry

In the fields of
chemistry Chemistry is the scientific study of the properties and behavior of matter. It is a physical science within the natural sciences that studies the chemical elements that make up matter and chemical compound, compounds made of atoms, molecules a ...
and
cheminformatics Cheminformatics (also known as chemoinformatics) refers to the use of physical chemistry theory with computer and information science techniques—so called "'' in silico''" techniques—in application to a range of descriptive and prescriptive ...
, the cyclomatic number of a
molecular graph In chemical graph theory and in mathematical chemistry, a molecular graph or chemical graph is a representation of the structural formula of a chemical compound in terms of graph theory. A chemical graph is a labeled graph whose vertices correspo ...
(the number of rings in the smallest set of smallest rings) is sometimes referred to as the Frèrejacque number.


Parametrized complexity

Some computational problems on graphs are NP-hard in general, but can be solved in
polynomial time In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations p ...
for graphs with a small cyclomatic number. An example is the path reconfiguration problem.


Related concepts

Other numbers defined in terms of deleting things from graphs are: * Edge connectivity - the minimum number of edges to delete in order to disconnect the graph; * Matching preclusion - the minimum number of edges to delete in order to prevent the existence of a
perfect matching In graph theory, a perfect matching in a graph is a matching that covers every vertex of the graph. More formally, given a graph with edges and vertices , a perfect matching in is a subset of , such that every vertex in is adjacent to exact ...
; * Feedback vertex set number - the minimum number of vertices to delete in order to make the graph acyclic; * Feedback arc set - the minimum number of arcs to delete from a directed graph, in order to make it acyclic.


References

{{reflist Graph invariants Matroid theory Spanning tree