Bipartite graph

When modelling relations between two different classes of objects, bipartite graphs very often arise naturally.

Ancient coins are made using two positive impressions of the design (the obverse and reverse).

The charts numismatists produce to represent the production of coins are bipartite graphs.

[8] More abstract examples include the following: Bipartite graphs may be characterized in several different ways: In bipartite graphs, the size of minimum vertex cover is equal to the size of the maximum matching; this is Kőnig's theorem.

Perfection of bipartite graphs is easy to see (their chromatic number is two and their maximum clique size is also two) but perfection of the complements of bipartite graphs is less trivial, and is another restatement of Kőnig's theorem.

This was one of the results that motivated the initial definition of perfect graphs.

For example, the complete bipartite graph K3,5 has degree sequence

(Trailing zeros may be ignored since they are trivially realized by adding an appropriate number of isolated vertices to the digraph.)

As a special case of this correspondence between bipartite graphs and hypergraphs, any multigraph (a graph in which there may be two or more edges between the same two vertices) may be interpreted as a hypergraph in which some hyperedges have equal sets of endpoints, and represented by a bipartite graph that does not have multiple adjacencies and in which the vertices on one side of the bipartition all have degree two.

[26] A similar reinterpretation of adjacency matrices may be used to show a one-to-one correspondence between directed graphs (on a given number of labeled vertices, allowing self-loops) and balanced bipartite graphs, with the same number of vertices on both sides of the bipartition.

In a depth-first search forest, one of the two endpoints of every non-forest edge is an ancestor of the other endpoint, and when the depth first search discovers an edge of this type it should check that these two vertices have different colors.

If they do not, then the path in the forest from ancestor to descendant, together with the miscolored edge, form an odd cycle, which is returned from the algorithm together with the result that the graph is not bipartite.

However, if the algorithm terminates without detecting an odd cycle of this type, then every edge must be properly colored, and the algorithm returns the coloring together with the result that the graph is bipartite.

Again, each node is given the opposite color to its parent in the search forest, in breadth-first order.

If, when a vertex is colored, there exists an edge connecting it to a previously-colored vertex with the same color, then this edge together with the paths in the breadth-first search forest connecting its two endpoints to their lowest common ancestor forms an odd cycle.

If the algorithm terminates without finding an odd cycle in this way, then it must have found a proper coloring, and can safely conclude that the graph is bipartite.

line segments or other simple shapes in the Euclidean plane, it is possible to test whether the graph is bipartite and return either a two-coloring or an odd cycle in time

[30] Odd cycle transversal is an NP-complete algorithmic problem that asks, given a graph G = (V,E) and a number k, whether there exists a set of k vertices whose removal from G would cause the resulting graph to be bipartite.

[31] The problem is fixed-parameter tractable, meaning that there is an algorithm whose running time can be bounded by a polynomial function of the size of the graph multiplied by a larger function of k.[32] The name odd cycle transversal comes from the fact that a graph is bipartite if and only if it has no odd cycles.

Hence, to delete vertices from a graph in order to obtain a bipartite graph, one needs to "hit all odd cycle", or find a so-called odd cycle transversal set.

In the illustration, every odd cycle in the graph contains the blue (the bottommost) vertices, so removing those vertices kills all odd cycles and leaves a bipartite graph.

A matching in a graph is a subset of its edges, no two of which share an endpoint.

[37] A perfect matching describes a way of simultaneously satisfying all job-seekers and filling all jobs; Hall's marriage theorem provides a characterization of the bipartite graphs which allow perfect matchings.

The National Resident Matching Program applies graph matching methods to solve this problem for U.S. medical student job-seekers and hospital residency jobs.

[39] Bipartite graphs are extensively used in modern coding theory, especially to decode codewords received from the channel.

A Tanner graph is a bipartite graph in which the vertices on one side of the bipartition represent digits of a codeword, and the vertices on the other side represent combinations of digits that are expected to sum to zero in a codeword without errors.

[40] A factor graph is a closely related belief network used for probabilistic decoding of LDPC and turbo codes.

[41] In computer science, a Petri net is a mathematical modeling tool used in analysis and simulations of concurrent systems.

There are additional constraints on the nodes and edges that constrain the behavior of the system.

Petri nets utilize the properties of bipartite directed graphs and other properties to allow mathematical proofs of the behavior of systems while also allowing easy implementation of simulations of the system.

A complete bipartite graph with m = 5 and n = 3
The Heawood graph is bipartite.
A graph with an odd cycle transversal of size 2: removing the two blue bottom vertices leaves a bipartite graph.