thumb|upright=1.3|The graphic matroid of the [[cycle graph , which is the uniform matroid <math>U{}^3_4</math>. More generally, the graphic matroid of is <math>U{}^{n-1}_{n}</math>.]]
In the mathematical theory of matroids, a graphic matroid (also called a cycle matroid or polygon 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 (but this should not be confused with matroids of rank 3, which generalize planar point configurations); these are exactly the graphic matroids formed from planar graphs.
Definition
A matroid may be defined as a family of finite sets (called the "independent sets" of the matroid) that is closed under subsets and that satisfies the "exchange property": if sets <math>A</math> and <math>B</math> are both independent, and <math>A</math> is larger than <math>B</math>, then there is an element <math>x\in A\setminus B</math> such that <math>B\cup\{x\}</math> remains independent. If <math>G</math> is an undirected graph, and <math>F</math> is the family of sets of edges that form forests in <math>G</math>, then <math>F</math> is clearly closed under subsets (removing edges from a forest leaves another forest). It also satisfies the exchange property: if <math>A</math> and <math>B</math> are both forests, and <math>A</math> has more edges than <math>B</math>, then it has fewer connected components, so by the pigeonhole principle there is a component <math>C</math> of <math>A</math> that contains vertices from two or more components of <math>B</math>. Along any path in <math>C</math> from a vertex in one component of <math>B</math> to a vertex of another component, there must be an edge with endpoints in two components, and this edge may be added to <math>B</math> to produce a forest with more edges. Thus, <math>F</math> forms the independent sets of a matroid, called the graphic matroid of <math>G</math> or <math>M(G)</math>. More generally, a matroid is called graphic whenever it is isomorphic to the graphic matroid of a graph, regardless of whether its elements are themselves edges in a graph. <!-- test -->
Representation
The graphic matroid of a graph <math>G</math> can be defined as the column matroid of any oriented incidence matrix of <math>G</math>. Such a matrix has one row for each vertex, and one column for each edge. The column for edge <math>e</math> has <math>+1</math> in the row for one endpoint, <math>-1</math> in the row for the other endpoint, and <math>0</math> elsewhere; the choice of which endpoint to give which sign is arbitrary. The column matroid of this matrix has as its independent sets the linearly independent subsets of columns.
If a set of edges contains a cycle, then the corresponding columns (multiplied by <math>-1</math> if necessary to reorient the edges consistently around the cycle) sum to zero, and is not independent. Conversely, if a set of edges forms a forest, then by repeatedly removing leaves from this forest it can be shown by induction that the corresponding set of columns is independent. Therefore, the column matrix is isomorphic to <math>M(G)</math>.
This method of representing graphic matroids works regardless of the field over which the incidence is defined. Therefore, graphic matroids form a subset of the regular matroids, matroids that have representations over all possible fields. The first three of these are the forbidden minors for the regular matroids, and the duals of <math>M(K_5)</math> and <math>M(K_{3,3})</math> are regular but not graphic.
If a matroid is graphic, its dual (a "co-graphic matroid") cannot contain the duals of these five forbidden minors. Thus, the dual must also be regular, and cannot contain as minors the two graphic matroids <math>M(K_5)</math> and <math>M(K_{3,3})</math>. or in linear time in a model of computation in which the edge weights are small integers and bitwise operations are allowed on their binary representations. The fastest known time bound that has been proven for a deterministic algorithm is slightly superlinear.
Several authors have investigated algorithms for testing whether a given matroid is graphic. For instance, an algorithm of solves this problem when the input is known to be a binary matroid. solves this problem for arbitrary matroids given access to the matroid only through an independence oracle, a subroutine that determines whether or not a given set is independent.
Related classes of matroids
Some classes of matroid have been defined from well-known families of graphs, by phrasing a characterization of these graphs in terms that make sense more generally for matroids. These include the bipartite matroids, in which every circuit is even, and the Eulerian matroids, which can be partitioned into disjoint circuits. A graphic matroid is bipartite if and only if it comes from a bipartite graph and a graphic matroid is Eulerian if and only if it comes from an Eulerian graph. Within the graphic matroids (and more generally within the binary matroids) these two classes are dual: a graphic matroid is bipartite if and only if its dual matroid is Eulerian, and a graphic matroid is Eulerian if and only if its dual matroid is bipartite.
Graphic matroids are one-dimensional rigidity matroids, matroids describing the degrees of freedom of structures of rigid beams that can rotate freely at the vertices where they meet. In one dimension, such a structure has a number of degrees of freedom equal to its number of connected components (the number of vertices minus the matroid rank) and in higher dimensions the number of degrees of freedom of a d-dimensional structure with n vertices is dn minus the matroid rank. In two-dimensional rigidity matroids, the Laman graphs play the role that spanning trees play in graphic matroids, but the structure of rigidity matroids in dimensions greater than two is not well understood.
