# Rainbow-independent set

In graph theory, a rainbow-independent set (ISR) is an independent set in a graph, in which each vertex has a different color.
Formally, let G = (V, E) be a graph, and suppose vertex set V is partitioned into m subsets V$_1$, …, V$_m$, called "colors". A set U of vertices is called a rainbow-independent set if it satisfies both the following conditions:
* It is an independent set – every two vertices in U are not adjacent (there is no edge between them);
* It is a rainbow set – U contains at most a single vertex from each color V$_i$.
Other terms used in the literature are independent set of representatives, independent transversal, and independent system of representatives.
As an example application, consider a faculty with m departments, where some faculty members dislike each other. The dean wants to construct a committee with m members, one member per department, but without any pair of members who dislike each other. This problem can be presented as finding an ISR in a graph in which the nodes are the faculty members, the edges describe the "dislike" relations, and the subsets V$_1$, …, V$_m$ are the departments.

## Variants

It is assumed for convenience that the sets V$_1$, …, V$_m$ are pairwise-disjoint. In general the sets may intersect, but this case can be easily reduced to the case of disjoint sets: for every vertex x, form a copy of x for each i such that V$_i$ contains x. In the resulting graph, connect all copies of x to each other. In the new graph, the V$_i$ are disjoint, and each ISR corresponds to an ISR in the original graph.
ISR generalizes the concept of a system of distinct representatives (SDR, also known as transversal). Every transversal is an ISR where in the underlying graph, all and only copies of the same vertex from different sets are connected.

## Existence of rainbow-independent sets

There are various sufficient conditions for the existence of an ISR.

### Condition based on vertex degree

Intuitively, when the departments V$_i$ are larger, and there is less conflict between faculty members, an ISR should be more likely to exist. The "less conflict" condition is represented by the vertex degree of the graph. This is formalized by the following theorem:$^{:Thm.2}$
   If the degree of every vertex in G is at most d, and the size of each color-set is at least 2d, then G has an ISR.
The 2d is best possible: there are graph with vertex degree k and colors of size 2d – 1 without an ISR. But there is a more precise version in which the bound depends both on d and on m.

### Condition based on dominating sets

Below, given a subset S of colors (a subset of {V$_1$, ..., V$_m$} ), we denote by U$_S$ the union of all subsets in S (all vertices whose color is one of the colors in S), and by G$_S$ the subgraph of G induced by U$_S$. The following theorem describes the structure of graphs that have no ISR but are edge-minimal, in the sense that whenever any edge is removed from them, the remaining graph has an ISR.
   If G has no ISR, but for every edge e in E, G-e has an ISR, then for every edge e = (x, y) in E, there exists a subset S of the colors {V$_1$, …, V$_m$}, and a set Z of edges of G$_S$, such that:
   * The vertices x and y are both in U$_S$;
   * The edge e = (x, y) is in Z;
   * The set of vertices adjacent to Z dominates G$_S$;
   * |Z| ≤ |S| − 1;
   * Z is a matching – no two edges of it are adjacent to the same vertex.

### Hall-type condition

Below, given a subset S of colors (a subset of {V$_1$, …, V$_m$} ), an independent set I$_S$ of G$_S$ is called special for S if for every independent subset J of vertices of G$_S$ of size at most |S| − 1, there exists some v in I$_S$ such that J ∪ {v} is also independent. Figuratively, I$_S$ is a team of "neutral members" for the set S of departments, that can augment any sufficiently small set of non-conflicting members, to create a larger such set. The following theorem is analogous to Hall's marriage theorem:
   If, for every subset S of colors, the graph G$_S$ contains an independent set I$_S$ that is special for S, then G has an ISR. Proof idea. The theorem is proved using Sperner's lemma.$^{:Thm.4.2}$ The standard simplex with m endpoints is assigned a triangulation with some special properties. Each endpoint i of the simplex is associated with the color-set V$_i$, each face {i$_1$, …, i$_k$} of the simplex is associated with a set S = {V$_{i1}$, …, V$_{ik}$} of colors. Each point x of the triangulation is labeled with a vertex g(x) of G such that: (a) For each point x on a face S, g(x) is an element of I$_S$ – the special independent set of S. (b) If points x and y are adjacent in the 1-skeleton of the triangulation, then g(x) and g(y) are not adjacent in G. By Sperner's lemma, there exists a sub-simplex in which, for each point x, g(x) belongs to a different color-set; the set of these g(x) is an ISR.
The above theorem implies Hall's marriage condition. To see this, it is useful to state the theorem for the special case in which G is the line graph of some other graph H; this means that every vertex of G is an edge of H, and every independent set of G is a matching in H. The vertex-coloring of G corresponds to an edge-coloring of H, and a rainbow-independent-set in G corresponds to a rainbow-matching in H. A matching I$_S$ in H$_S$ is special for S, if for every matching J in H$_S$ of size at most |S| − 1, there is an edge e in I$_S$ such that J ∪ {e} is still a matching in H$_S$.
   Let H be a graph with an edge-coloring. If, for every subset S of colors, the graph H$_S$ contains a matching M$_S$ that is special for S, then H has a rainbow-matching.
Let H = (X + Y, E) be a bipartite graph satisfying Hall's condition. For each vertex i of X, assign a unique color V$_i$ to all edges of H adjacent to i. For every subset S of colors, Hall's condition implies that S has at least |S| neighbors in Y, and therefore there are at least |S| edges of H adjacent to distinct vertices of Y. Let I$_S$ be a set of |S| such edges. For any matching J of size at most |S| − 1 in H, some element e of I$_S$ has a different endpoint in Y than all elements of J, and thus J ∪ {e} is also a matching, so I$_S$ is special for S. The above theorem implies that H has a rainbow matching M$_R$. By definition of the colors, M$_R$ is a perfect matching in H.
Another corollary of the above theorem is the following condition, which involves both vertex degree and cycle length:$^{:Thm.4.3}$
   If the degree of every vertex in G is at most 2, and the length of each cycle of G is divisible by 3, and the size of each color-set is at least 3, then G has an ISR. Proof. For every subset S of colors, the graph G$_S$ contains at least 3|S| vertices, and it is a union of cycles of length divisible by 3 and paths. Let I$_S$ be an independent set in G$_S$ containing every third vertex in each cycle and each path. So |I$_S$| contains at least 3|S|⁄3 = |S| vertices. Let J be an independent set in G$_S$ of size at most |S| – 1. Since the distance between each two vertices of I$_S$ is at least 3, every vertex of J is adjacent to at most one vertex of I$_S$. Therefore, there is at least one vertex of I$_S$ which is not adjacent to any vertex of J. Therefore I$_S$ is special for S. By the previous theorem, G has an ISR.

### Condition based on homological connectivity

One family of conditions is based on the homological connectivity of the independence complex of subgraphs. To state the conditions, the following notation is used:
* Ind(G) denotes the independence complex of a graph G (that is, the abstract simplicial complex whose faces are the independent sets in G).
* η$_H$(X) denotes the homological connectivity of a simplicial complex X (i.e., the largest integer k such that the first k homology groups of X are trivial), plus 2.
* [m] is the set of indices of colors, {1, …, n}. For any subset J of [m], V$_J$ is the union of colors V$_J$ for J in J.
* G[V$_J$] is the subgraph of G induced by the vertices in V$_J$.
The following condition is implicit in and proved explicitly in.
   If, for all subsets J of [m]:
       $\eta _{H}({\text{Ind}}(G[V_{J}]))\geq |J|$
   then the partition V$_1$, …, V$_m$ admits an ISR.
As an example, suppose G is a bipartite graph, and its parts are exactly V$_1$ and V$_2$. In this case [m] = {1,2} so there are four options for J:
* J =: then G[J] = and Ind(G[J]) = and the connectivity is infinite, so the condition holds trivially.
* J = {1}: then G[J] is a graph with vertices V$_1$ and no edges. Here all vertex sets are independent, so Ind(G[J]) is the power set of V$_1$, i.e., it has a single n-simplex (and all its subsets). It is known that a single simplex is k-connected for all integers k, since all its reduced homology groups are trivial (see simplicial homology). Hence the condition holds.
* J = {2}: this case is analogous to the previous one.
* J = {1,2}: then G[J] = G, and Ind(G) contains two simplices V$_1$ and V$_2$ (and all their subsets). The condition η$_H$(Ind(G)) ≥ 2 is equivalent to the condition that the homological connectivity of Ind(G) is at least 0, which is equivalent to the condition that ${\tilde {H_{0}}}({\text{Ind}}(G))$ is the trivial group. This holds if-and-only-if the complex Ind(G) contains a connection between its two simplices V$_1$ and V$_2$. Such a connection is equivalent to an independent set in which one vertex is from V$_1$ and one is from V$_2$. Thus, in this case, the condition of the theorem is not only sufficient but also necessary.

### Other conditions

Every properly coloured triangle-free graph of chromatic number x contains a rainbow-independent set of size at least x⁄2.
Several authors have studied conditions for existence of large rainbow-independent sets in various classes of graphs.

## Computation

The ISR decision problem is the problem of deciding whether a given graph G = (V, E) and a given partition of V into m colors admits a rainbow-independent set. This problem is NP-complete. The proof is by reduction from the 3-dimensional matching problem (3DM). The input to 3DM is a tripartite hypergraph (X + Y + Z, F), where X, Y, Z are vertex-sets of size m, and F is a set of triplets, each of which contains a single vertex of each of X, Y, Z. An input to 3DM can be converted into an input to ISR as follows:
* For each edge (x,y,z) in F, there is a vertex v$_{x,y,z}$ in V;
* For each vertex z in Z, let V$_z$ = {v$_{x,y,z}$ | x ∈ X, y ∈ Y}.
* For each x, y$_1$, y$_2$, z$_1$, z$_2$, there is an edge (v$_{x,y1,z1}$, v$_{x,y2,z2}$) in E;
* For each x$_1$, x$_2$, y, z$_1$, z$_2$, there is an edge (v$_{x1,y,z1}$, v$_{x2,y,z2}$) in E;
In the resulting graph G = (V, E), an ISR corresponds to a set of triplets (x,y,z) such that:
* Each triplet has a different z value (since each triplet belongs to a different color-set V$_z$);
* Each triplet has a different x value and a different y value (since the vertices are independent).
Therefore, the resulting graph admits an ISR if and only if the original hypergraph admits a 3DM.
An alternative proof is by reduction from SAT.

## Related concepts

If G is the line graph of some other graph H, then the independent sets in G are the matchings in H. Hence, a rainbow-independent set in G is a rainbow matching in H. See also matching in hypergraphs.
Another related concept is a rainbow cycle, which is a cycle in which each vertex has a different color.
When an ISR exists, a natural question is whether there exist other ISRs, such that the entire set of vertices is partitioned into disjoint ISRs (assuming the number of vertices in each color is the same). Such a partition is called strong coloring.
Using the faculty metaphor:
* A system of distinct representatives is a committee of distinct members, with or without conflicts.
* An independent set is a committee with no conflict.
* An independent transversal is a committee with no conflict, with exactly one member from each department.
* A graph coloring is a partitioning of the faculty members into committees with no conflict.
* A strong coloring is a partitioning of the faculty members into committees with no conflict and with exactly one member from each department. Thus this problem is sometimes called the happy dean problem.
A rainbow clique or a colorful clique is a clique in which every vertex has a different color. Every clique in a graph corresponds to an independent set in its complement graph. Therefore, every rainbow clique in a graph corresponds to a rainbow-independent set in its complement graph.