# Rainbow matching

In the mathematical discipline of graph theory, a rainbow matching in an edge-colored graph is a matching in which all the edges have distinct colors.

## Definition

Given an edge-colored graph G = (V,E), a rainbow matching M in G is a set of pairwise non-adjacent edges, that is, no two edges share a common vertex, such that all the edges in the set have distinct colors.
A maximum rainbow matching is a rainbow matching that contains the largest possible number of edges.

## History

Rainbow matchings are of particular interest given their connection to transversals of Latin squares.
Denote by K$_{n,n}$ the complete bipartite graph on n + n vertices. Every proper n-edge coloring of K$_{n,n}$ corresponds to a Latin square of order n. A rainbow matching then corresponds to a transversal of the Latin square, meaning a selection of n positions, one in each row and each column, containing distinct entries.
This connection between transversals of Latin squares and rainbow matchings in K$_{n,n}$ has inspired additional interest in the study of rainbow matchings in triangle-free graphs.

## Existence when each edge has a single color

An edge-coloring is called proper if each edge has a single color, and each two edges of the same color have no vertex in common.
A proper edge-coloring does not guarantee the existence of a perfect rainbow matching. For example, consider the graph K$_{2,2}$: the complete bipartite graph on 2+2 vertices. Suppose the edges (x$_1$,y$_1$) and (x$_2$,y$_2$) are colored green, and the edges (x$_1$,y$_2$) and (x$_2$,y$_1$) are colored blue. This is a proper coloring, but there are only two perfect matchings, and each of them is colored by a single color. This invokes the question: when does a large rainbow matching is guaranteed to exist?

### Bounds depending only on the number of vertices

Much of the research on this question was published using the terminology of Latin transversals in Latin squares. Translated into the rainbow matching terminology:
* In 1967, H. J. Ryser conjectured that, when n is odd, every proper edge-coloring of K$_{n,n}$ has a rainbow matching of size n.
* In 1975, S. K. Stein and Brualdi conjectured that, when n is even, every proper edge-coloring of K$_{n,n}$ has a rainbow matching of size n – 1. (it is known that a rainbow matching of size n need not exist in this case).
A more general conjecture of Stein is that a rainbow matching of size n – 1 exists not only for a proper edge-coloring, but for any coloring in which each color appears on exactly n edges.
Some weaker versions of these conjectures have been proved:
* Every proper edge-coloring of K$_{n,n}$ has a rainbow matching of size 2n/3.
* Every proper edge-coloring of K$_{n,n}$ has a rainbow matching of size ⁠$n-{\sqrt {n}}.$⁠
* Every proper edge-coloring of K$_{n,n}$ has a rainbow matching of size n – 11 log$_2$$^2$(n).
* Every proper edge-coloring of K$_{n,n}$ has a rainbow matching of size n – O(log n/log log n).
* Every proper edge-coloring of K$_{n,n}$ has a rainbow matching of size n – 1. (Preprint)

### Bounds depending on the minimum degree

Wang asked if there is a function f(d) such that every properly edge-colored graph G with minimum degree d and at least f(d) vertices must have a rainbow matching of size d. Obviously at least 2d vertices are necessary, but how many are sufficient?
* Diemunsch, et al. answered this question in the affirmative and showed that given a properly edge-colored graph G with minimum degree d and order at least f(d) = 98δ/23, there exists a rainbow matching of size d in G.
* This bound was later improved to f(d) = 4d – 3 by Andras Gyarfas and Gabor N. Sarkozy. They also show that any graph with at least 2d vertices has a rainbow matching of size at least d – 2d$^{2/3}$. These are the best known estimate to date.

## Existence when the same edge may have different colors

Suppose that each edge may have several different colors, while each two edges of the same color must still have no vertex in common. In other words, each color is a matching. How many colors are needed in order to guarantee the existence of a rainbow matching?

### In complete bipartite graphs

Drisko studied this question using the terminology of Latin rectangles. He proved that, for any n ≤ k, in the complete bipartite graph K$_{n,k}$, any family of 2n – 1 matchings (=colors) of size n has a perfect rainbow matching (of size n). He applied this theorem to questions about group actions and difference sets.
Drisko also showed that 2n – 1 matchings may be necessary: consider a family of 2n – 2 matchings, of which n – 1 are { (x$_1$, y$_1$), (x$_2$, y$_2$), ..., (x$_n$, y$_n$)} and the other n – 1 are {(x$_1$, y$_2$), (x$_2$, y$_3$), …, (x$_n$, y$_1$) }. Then the largest rainbow matching is of size n – 1 (e.g. take one edge from each of the first n – 1 matchings).
Alon showed that Drisko's theorem implies an older result in additive number theory.

### In general bipartite graphs

Aharoni and Berger generalized Drisko's theorem to any bipartite graph, namely: any family of 2n – 1 matchings of size n in a bipartite graph has a rainbow matching of size n.
Aharoni, Kotlar and Ziv showed that Drisko's extremal example is unique in any bipartite graph.

### In general graphs

In general graphs, 2n – 1 matchings are no longer sufficient. When n is even, one can add to Drisko's example the matching { (x$_1$, x$_2$), (y$_1$, y$_2$), (x$_2$, x$_3$), (y$_2$, y$_3$), … } and get a family of 2n – 1 matchings without any rainbow matching.
Aharoni, Berger, Chudnovsky, Howard and Seymour proved that, in a general graph, 3n – 2 matchings (=colors) are always sufficient. It is not known whether this is tight: currently the best lower bound for even n is 2n and for odd n it is 2n – 1.

## Rainbow fractional matchings

A fractional matching is a set of edges with a non-negative weight assigned to each edge, such that the sum of weights adjacent to each vertex is at most 1. The size of a fractional matching is the sum of weights of all edges. It is a generalization of a matching, and can be used to generalize both the colors and the rainbow matching:
* Instead of requiring that each color be a matching of size n, the requirement is weakened: each "color" can be an arbitrary set of edges, but it should admit a fractional matching of size at least n.
* Instead of looking for a rainbow matching, we look for a rainbow fractional matching - a fractional matching in which each edge with a positive weight has a different color.
It is known that, in a bipartite graph, the maximum fractional matching size equals the maximum matching size. Therefore, the theorem of Aharoni and Berger is equivalent to the following. Let n be any positive integer. Given any family of 2n – 1 fractional-matchings (=colors) of size n in a bipartite graph, there exists a rainbow-fractional-matching of size n.
Aharoni, Holzman and Jiang extend this theorem to arbitrary graphs as follows. Let n be any positive integer or half-integer. Any family of 2n fractional-matchings (=colors) of size at least n in an arbitrary graph has a rainbow-fractional-matching of size n.$^{:Thm.1.5}$ The 2n is the smallest possible for fractional matchings in arbitrary graphs: the extremal case is constructed using an odd-length cycle.

### Partial proof

For the case of perfect fractional matchings, both the above theorems can derived from the colorful Caratheodory theorem.
For every edge e in E, let 1$_e$ be a vector of size |V|, where for each vertex v in V, element v in 1$_e$ equals 1 if e is adjacent to v, and 0 otherwise (so each vector 1$_e$ has 2 ones and |V|-2 zeros). Every fractional matching corresponds to a conical combination of edges, in which each element is at most 1. A conical combination in which each element is exactly 1 corresponds to a perfect fractional matching. In other words, a collection F of edges admits a perfect fractional matching, if and only if 1$_v$ (the vector of |V| ones) is contained in the conical hull of the vectors 1$_e$ for e in F.
Consider a graph with 2n vertices, and suppose there are 2n subsets of edges, each of which admits a perfect fractional matching (of size n). This means that the vector 1$_v$ is in the conical hull of each of these n subsets. By the colorful Caratheodory theorem, there exists a selection of 2n edges, one from each subset, that their conical hull contains 1$_v$. This corresponds to a rainbow perfect fractional matching. The expression 2n is the dimension of the vectors 1$_e$ - each vector has 2n elements.
Now, suppose that the graph is bipartite. In a bipartite graph, there is a constraint on the vectors 1$_e$: the sum of elements corresponding to each part of the graph must be 1. Therefore, the vectors 1$_e$ live in a (2n – 1)-dimensional space. Therefore, the same argument as above holds when there are only 2n – 1 subsets of edges.

## Rainbow matching in hypergraphs

An r-uniform hypergraph is a set of hyperedges each of which contains exactly r vertices (so a 2-uniform hypergraph is a just a graph without self-loops). Aharoni, Holzman and Jiang extend their theorem to such hypergraphs as follows. Let n be any positive rational number. Any family of ⌈r⋅n⌉ fractional-matchings (=colors) of size at least n in an r-uniform hypergraph has a rainbow-fractional-matching of size n.$^{:Thm.1.6}$ The ⌈r⋅n⌉ is the smallest possible when n is an integer.
An r-partite hypergraph is an r-uniform hypergraph in which the vertices are partitioned into r disjoint sets and each hyperedge contains exactly one vertex of each set (so a 2-partite hypergraph is a just bipartite graph). Let n be any positive integer. Any family of rn – r + 1 fractional-matchings (=colors) of size at least n in an r-partite hypergraph has a rainbow-fractional-matching of size n.$^{:Thm.1.7}$ The rn – r + 1 is the smallest possible: the extremal case is when n = r – 1 is a prime power, and all colors are edges of the truncated projective plane of order n. So each color has n$^2$ = rn – r + 1 edges and a fractional matching of size n, but any fractional matching of that size requires all rn – r + 1 edges.

### Partial proof

For the case of perfect fractional matchings, both the above theorems can derived from the colorful caratheodory theorem in the previous section. For a general r-uniform hypergraph (admitting a perfect matching of size n), the vectors 1$_e$ live in a (rn)-dimensional space. For an r-uniform r-partite hypergraph, the r-partiteness constraints imply that the vectors 1$_e$ live in a (rn – r + 1)-dimensional space.