Graph theory · Definition

Bipartite graph

discrete mathematicsgraphs

Before you start you need to know

Bipartition models matchings, such as students with courses or workers with tasks, and is the simplest way to split a graph into two opposing sides.

Definition

A bipartite graph is a graph \(G=(V,E)\) whose vertices split into two disjoint sets \(A\) and \(B\) so that every edge \(e\in E\) joins a vertex of \(A\) to one of \(B\).

\[V=A\cup B,\quad A\cap B=\varnothing,\quad |e\cap A|=1\ \text{ for every } e\in E\]

The two parts \(A\) and \(B\) have no internal edges: everything that happens in the graph happens between one side and the other. That is why a bipartite graph cannot have triangles, nor odd cycles in general. Conversely, the classical criterion says a graph is bipartite exactly when all its cycles have even length.

To decide whether a connected graph is bipartite, put one vertex in side \(A\), its neighbors in \(B\), their neighbors in \(A\), and so on. If at some point an edge joins two vertices of the same side, there is an odd cycle and the graph is not bipartite. In a connected graph the partition, when it exists, is unique up to swapping \(A\) and \(B\); each connected component contributes the same degree of freedom.

The guiding example is the complete bipartite graph \(K_{m,n}\), with parts of \(m\) and \(n\) vertices and all \(mn\) possible edges between them. With \(N\) vertices, a bipartite graph has at most \(\lfloor N^2/4\rfloor\) edges. Also, since each edge has one endpoint in each part, the degree sum over \(A\) equals the degree sum over \(B\), and both equal \(|E|\). A common mistake is to believe that having no triangles is enough: a 5-cycle has no triangles and is not bipartite either.

Think about it

Is the cube graph bipartite, with 8 vertices (the triples of 0s and 1s) and edges between triples that differ in exactly one coordinate?

Yes. Taking as \(A\) the triples with an even number of ones and as \(B\) those with an odd number, each edge changes the parity and hence joins the two parts.

If a connected bipartite graph has \(|A|\ne|B|\), can the roles of \(A\) and \(B\) be swapped?

Only as names: the partition is unique, so \(A\) and \(B\) are the only two possible sides and swapping them only changes what we call them.

Exercises 10

References

  • Kenneth H. Rosen, Discrete Mathematics and Its Applications, 8th edition, McGraw-Hill, 2019. §10.2
  • Susanna S. Epp, Discrete Mathematics with Applications, 5th edition, Cengage, 2019. §10.1
  • Ralph P. Grimaldi, Discrete and Combinatorial Mathematics: An Applied Introduction, 5th edition, Pearson, 2003. §11.2