Circuit rank

Last updated
This graph has circuit rank r = 2 because it can be made into a tree by removing two edges, for instance the edges 1-2 and 2-3, but removing any one edge leaves a cycle in the graph. 6n-graf.svg
This graph has circuit rank r = 2 because it can be made into a tree by removing two edges, for instance the edges 1–2 and 2–3, but removing any one edge leaves a cycle in the graph.

In graph theory, a branch of mathematics, the circuit rank, cyclomatic number, cycle rank, or nullity of an undirected graph is the minimum number of edges that must be removed from the graph to break all its cycles, making it into a tree or forest. It is equal to the number of independent cycles in the graph (the size of a cycle basis). Unlike the corresponding feedback arc set problem for directed graphs, the circuit rank r is easily computed using the formula

Contents

,

where m is the number of edges in the given graph, n is the number of vertices, and c is the number of connected components. [1] It is also possible to construct a minimum-size set of edges that breaks all cycles efficiently, either using a greedy algorithm or by complementing a spanning forest.

The circuit rank can be explained in terms of algebraic graph theory as the dimension of the cycle space of a graph, in terms of matroid theory as the corank of a graphic matroid, and in terms of topology as one of the Betti numbers of a topological space derived from the graph. It counts the ears in an ear decomposition of the graph, forms the basis of parameterized complexity on almost-trees, and has been applied in software metrics as part of the definition of cyclomatic complexity of a piece of code. Under the name of cyclomatic number, the concept was introduced by Gustav Kirchhoff. [2] [3]

Matroid rank and construction of a minimum feedback edge set

The circuit rank of a graph G may be described using matroid theory as the corank of the graphic matroid of G. [4] 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 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 of G 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 circuit rank is also the dimension of the cycle space of . Intuitively, this can be explained as meaning that the circuit rank 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 of some subset of the others. [1]

This count of independent cycles can also be explained using homology theory, a branch of topology. Any graph G may be viewed as an example of a 1-dimensional simplicial complex, a type of topological space formed by representing each graph edge by a line segment and gluing these line segments together at their endpoints. The cyclomatic number is the rank of the first (integer) homology group of this complex, [5]

Because of this topological connection, the cyclomatic number of a graph G is also called the first Betti number of G. [6] 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 circuit rank for planar graphs, normalized by dividing by the maximum possible circuit rank of any planar graph with the same vertex set, is called the meshedness coefficient. For a connected planar graph with m edges and n vertices, the meshedness coefficient can be computed by the formula [7]

Here, the numerator of the formula is the circuit rank of the given graph, and the denominator is the largest possible circuit rank of an n-vertex planar graph. The meshedness coefficient ranges between 0 for trees and 1 for maximal planar graphs.

Ear decomposition

The circuit rank 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 , every open ear decomposition has exactly ears. [8]

Almost-trees

A graph with cyclomatic number is also called a r-almost-tree, because only r edges need to be removed from the graph to make it into a tree or forest. A 1-almost-tree is a near-tree: a connected near-tree is a pseudotree, a cycle with a (possibly trivial) tree rooted at each vertex. [9]

Several authors have studied the parameterized complexity of graph algorithms on r-near-trees, parameterized by . [10] [11]

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 circuit rank (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 circuit rank 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 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 and cheminformatics, the circuit rank of a molecular graph (the number of rings in the smallest set of smallest rings) is sometimes referred to as the Frèrejacque number. [12] [13] [14]

Parametrized complexity

Some computational problems on graphs are NP-hard in general, but can be solved in polynomial time for graphs with a small circuit rank. An example is the path reconfiguration problem. [15]

Other numbers defined in terms of deleting things from graphs are:

Related Research Articles

<span class="mw-page-title-main">Graph theory</span> Area of discrete mathematics

In mathematics and computer science, graph theory is the study of graphs, which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of vertices which are connected by edges. A distinction is made between undirected graphs, where edges link two vertices symmetrically, and directed graphs, where edges link two vertices asymmetrically. Graphs are one of the principal objects of study in discrete mathematics.

<span class="mw-page-title-main">Hamiltonian path</span> Path in a graph that visits each vertex exactly once

In the mathematical field of graph theory, a Hamiltonian path is a path in an undirected or directed graph that visits each vertex exactly once. A Hamiltonian cycle is a cycle that visits each vertex exactly once. A Hamiltonian path that starts and ends at adjacent vertices can be completed by adding one more edge to form a Hamiltonian cycle, and removing any edge from a Hamiltonian cycle produces a Hamiltonian path. The computational problems of determining whether such paths and cycles exist in graphs are NP-complete; see Hamiltonian path problem for details.

<span class="mw-page-title-main">Component (graph theory)</span> Maximal subgraph whose vertices can reach each other

In graph theory, a component of an undirected graph is a connected subgraph that is not part of any larger connected subgraph. The components of any graph partition its vertices into disjoint sets, and are the induced subgraphs of those sets. A graph that is itself connected has exactly one component, consisting of the whole graph. Components are sometimes called connected components.

In graph theory, a branch of mathematics, the (binary) cycle space of an undirected graph is the set of its even-degree subgraphs.

This is a glossary of graph theory. Graph theory is the study of graphs, systems of nodes or vertices connected in pairs by lines or edges.

<span class="mw-page-title-main">Spanning tree</span> Tree which includes all vertices of a graph

In the mathematical field of graph theory, a spanning treeT 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 connected will not contain a spanning tree. If all of the edges of G are also edges of a spanning tree T of G, then G is a tree and is identical to T.

In the mathematical theory of matroids, a graphic matroid is a matroid whose independent sets are the forests in a given finite undirected graph. The dual matroids of graphic matroids are called co-graphic matroids or bond matroids. A matroid that is both graphic and co-graphic is sometimes called a planar matroid ; these are exactly the graphic matroids formed from planar graphs.

<span class="mw-page-title-main">Bridge (graph theory)</span> Edge in node-link graph whose removal would disconnect the graph

In graph theory, a bridge, isthmus, cut-edge, or cut arc is an edge of a graph whose deletion increases the graph's number of connected components. Equivalently, an edge is a bridge if and only if it is not contained in any cycle. For a connected graph, a bridge can uniquely determine a cut. A graph is said to be bridgeless or isthmus-free if it contains no bridges.

In the mathematical discipline of graph theory, a feedback vertex set (FVS) of a graph is a set of vertices whose removal leaves a graph without cycles. Equivalently, each FVS contains at least one vertex of any cycle in the graph. The feedback vertex set number of a graph is the size of a smallest feedback vertex set. The minimum feedback vertex set problem is an NP-complete problem; it was among the first problems shown to be NP-complete. It has wide applications in operating systems, database systems, and VLSI chip design.

<span class="mw-page-title-main">Feedback arc set</span> Edges that hit all cycles in a graph

In graph theory and graph algorithms, a feedback arc set or feedback edge set in a directed graph is a subset of the edges of the graph that contains at least one edge out of every cycle in the graph. Removing these edges from the graph breaks all of the cycles, producing an acyclic subgraph of the given graph, often called a directed acyclic graph. A feedback arc set with the fewest possible edges is a minimum feedback arc set and its removal leaves a maximum acyclic subgraph; weighted versions of these optimization problems are also used. If a feedback arc set is minimal, meaning that removing any edge from it produces a subset that is not a feedback arc set, then it has an additional property: reversing all of its edges, rather than removing them, produces a directed acyclic graph.

The arboricity of an undirected graph is the minimum number of forests into which its edges can be partitioned. Equivalently it is the minimum number of spanning forests needed to cover all the edges of the graph. The Nash-Williams theorem provides necessary and sufficient conditions for when a graph is k-arboric.

<span class="mw-page-title-main">Dual graph</span> Graph representing faces of another graph

In the mathematical discipline of graph theory, the dual graph of a planar graph G is a graph that has a vertex for each face of G. The dual graph has an edge for each pair of faces in G that are separated from each other by an edge, and a self-loop when the same face appears on both sides of an edge. Thus, each edge e of G has a corresponding dual edge, whose endpoints are the dual vertices corresponding to the faces on either side of e. The definition of the dual depends on the choice of embedding of the graph G, so it is a property of plane graphs rather than planar graphs. For planar graphs generally, there may be multiple dual graphs, depending on the choice of planar embedding of the graph.

In graph theory, a path decomposition of a graph G is, informally, a representation of G as a "thickened" path graph, and the pathwidth of G is a number that measures how much the path was thickened to form G. More formally, a path-decomposition is a sequence of subsets of vertices of G such that the endpoints of each edge appear in one of the subsets and such that each vertex appears in a contiguous subsequence of the subsets, and the pathwidth is one less than the size of the largest set in such a decomposition. Pathwidth is also known as interval thickness, vertex separation number, or node searching number.

<span class="mw-page-title-main">Peripheral cycle</span> Graph cycle which does not separate remaining elements

In graph theory, a peripheral cycle in an undirected graph is, intuitively, a cycle that does not separate any part of the graph from any other part. Peripheral cycles were first studied by Tutte (1963), and play important roles in the characterization of planar graphs and in generating the cycle spaces of nonplanar graphs.

<span class="mw-page-title-main">Pseudoforest</span> Graph with at most one cycle per component

In graph theory, a pseudoforest is an undirected graph in which every connected component has at most one cycle. That is, it is a system of vertices and edges connecting pairs of vertices, such that no two cycles of consecutive edges share any vertex with each other, nor can any two cycles be connected to each other by a path of consecutive edges. A pseudotree is a connected pseudoforest.

<span class="mw-page-title-main">Branch-decomposition</span> Hierarchical clustering of graph edges

In graph theory, a branch-decomposition of an undirected graph G is a hierarchical clustering of the edges of G, represented by an unrooted binary tree T with the edges of G as its leaves. Removing any edge from T partitions the edges of G into two subgraphs, and the width of the decomposition is the maximum number of shared vertices of any pair of subgraphs formed in this way. The branchwidth of G is the minimum width of any branch-decomposition of G.

<span class="mw-page-title-main">Cycle basis</span> Cycles in a graph that generate all cycles

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 expressed as a symmetric difference of basis cycles.

In graph theory, the tree-depth of a connected undirected graph is a numerical invariant of , the minimum height of a Trémaux tree for a supergraph of . This invariant and its close relatives have gone under many different names in the literature, including vertex ranking number, ordered chromatic number, and minimum elimination tree height; it is also closely related to the cycle rank of directed graphs and the star height of regular languages. Intuitively, where the treewidth of a graph measures how far it is from being a tree, this parameter measures how far a graph is from being a star.

<span class="mw-page-title-main">Ear decomposition</span> Partition of graph into sequence of paths

In graph theory, an ear of an undirected graph G is a path P where the two endpoints of the path may coincide, but where otherwise no repetition of edges or vertices is allowed, so every internal vertex of P has degree two in G. An ear decomposition of an undirected graph G is a partition of its set of edges into a sequence of ears, such that the one or two endpoints of each ear belong to earlier ears in the sequence and such that the internal vertices of each ear do not belong to any earlier ear. Additionally, in most cases the first ear in the sequence must be a cycle. An open ear decomposition or a proper ear decomposition is an ear decomposition in which the two endpoints of each ear after the first are distinct from each other.

<span class="mw-page-title-main">Matroid parity problem</span> Largest independent set of paired elements

In combinatorial optimization, the matroid parity problem is a problem of finding the largest independent set of paired elements in a matroid. The problem was formulated by Lawler (1976) as a common generalization of graph matching and matroid intersection. It is also known as polymatroid matching, or the matchoid problem.

References

  1. 1 2 Berge, Claude (2001), "Cyclomatic number", The Theory of Graphs, Courier Dover Publications, pp. 27–30, ISBN   9780486419756 .
  2. Peter Robert Kotiuga (2010), A Celebration of the Mathematical Legacy of Raoul Bott, American Mathematical Soc., p. 20, ISBN   978-0-8218-8381-5
  3. Per Hage (1996), Island Networks: Communication, Kinship, and Classification Structures in Oceania, Cambridge University Press, p. 48, ISBN   978-0-521-55232-5
  4. Berge, Claude (1976), Graphs and Hypergraphs, North-Holland Mathematical Library, vol. 6, Elsevier, p. 477, ISBN   9780720424539 .
  5. Serre, Jean-Pierre (2003), Trees, Springer Monographs in Mathematics, Springer, p. 23, ISBN   9783540442370 .
  6. Gregory Berkolaiko; Peter Kuchment (2013), Introduction to Quantum Graphs, American Mathematical Soc., p. 4, ISBN   978-0-8218-9211-4
  7. Buhl, J.; Gautrais, J.; Sole, R.V.; Kuntz, P.; Valverde, S.; Deneubourg, J.L.; Theraulaz, G. (2004), "Efficiency and robustness in ant networks of galleries", The European Physical Journal B, 42 (1), Springer-Verlag: 123–129, Bibcode:2004EPJB...42..123B, doi:10.1140/epjb/e2004-00364-9 .
  8. Whitney, H. (1932), "Non-separable and planar graphs", Transactions of the American Mathematical Society , 34 (2): 339–362, doi: 10.2307/1989545 , JSTOR   1989545, PMC   1076008 , PMID   16587624 . See in particular Theorems 18 (relating ear decomposition to circuit rank) and 19 (on the existence of ear decompositions).
  9. Brualdi, Richard A. (2006), Combinatorial Matrix Classes, Encyclopedia of Mathematics and Its Applications, vol. 108, Cambridge: Cambridge University Press, p.  349, ISBN   0-521-86565-4, Zbl   1106.05001
  10. Coppersmith, Don; Vishkin, Uzi (1985), "Solving NP-hard problems in 'almost trees': Vertex cover", Discrete Applied Mathematics, 10 (1): 27–45, doi: 10.1016/0166-218X(85)90057-5 , Zbl   0573.68017 .
  11. Fiala, Jiří; Kloks, Ton; Kratochvíl, Jan (2001), "Fixed-parameter complexity of λ-labelings", Discrete Applied Mathematics, 113 (1): 59–72, doi: 10.1016/S0166-218X(00)00387-5 , Zbl   0982.05085 .
  12. May, John W.; Steinbeck, Christoph (2014), "Efficient ring perception for the Chemistry Development Kit", Journal of Cheminformatics , 6 (3): 3, doi: 10.1186/1758-2946-6-3 , PMC   3922685 , PMID   24479757
  13. Downs, G.M.; Gillet, V.J.; Holliday, J.D.; Lynch, M.F. (1989), "A review of Ring Perception Algorithms for Chemical Graphs", J. Chem. Inf. Comput. Sci. , 29 (3): 172–187, doi:10.1021/ci00063a007
  14. Frèrejacque, Marcel (1939), "No. 108-Condensation d'une molecule organique" [Condenstation of an organic molecule], Bull. Soc. Chim. Fr. , 5: 1008–1011
  15. Demaine, Erik D.; Eppstein, David; Hesterberg, Adam; Jain, Kshitij; Lubiw, Anna; Uehara, Ryuhei; Uno, Yushi (2019), "Reconfiguring Undirected Paths", in Friggstad, Zachary; Sack, Jörg-Rüdiger; Salavatipour, Mohammad R. (eds.), Algorithms and Data Structures – 16th International Symposium, WADS 2019, Edmonton, AB, Canada, August 5-7, 2019, Proceedings, Lecture Notes in Computer Science, vol. 11646, Springer, pp. 353–365, arXiv: 1905.00518 , doi:10.1007/978-3-030-24766-9_26, ISBN   978-3-030-24765-2