Bipartite graph Created 2026-09-24 Updated 2026-10-14
A bipartite graph separates its vertices into two independent sets: every edge goes from one part to the other. Here is a finite simple graph and an undirected graph, with no self-loops and no repeated edges. The two parts satisfyThus neither part contains an edge. The parts need not have equal sizes, and some pairs across them may have no edge; requiring every cross pair gives a complete bipartite graph. The independent set and cross-edge definitions are equivalent.[ref]
The Basics (author-hosted chapter preview). Section 1.1, printed p. 3, independent vertices; Section 1.6, printed p. 17, bipartite and complete multipartite graphs
For example, the six-vertex cycle graph with edges has parts and . Drawing the same graph as a hexagon or in two columns changes neither its edges nor its bipartite property. An extra isolated vertex can go in either part.
We allow either part to be empty. Consequently a graph with no edges is bipartite, even when ; choose , . Here "two colours" means two colours are available, with no requirement to use both. This convention explicitly includes the empty case, whereas definitions requiring two nonempty classes need an exception. For several connected components of a graph, choose the two parts separately in each graph component and take their unions. In a nonempty connected graph that is bipartite, fixing one vertex's colour forces all others along graph paths, so its two-colour assignment is unique up to swapping the colours. Each graph component, including an isolated vertex, can be swapped independently.
The two-colourability criterion for bipartite graphs identifies these parts with the colour classes of a proper vertex colouring: assign colour to and colour to , so adjacent vertices have different colours. More surprisingly, the odd-cycle characterization of bipartite graphs turns a global requirement into one precise obstruction:This statement is for the finite undirected graph and simple graph model above; a graph cycle has distinct vertices except for the repeated starting vertex. Along a graph cycle in a bipartite graph, colours alternate, so returning to the starting colour takes an even number of edges. Therefore any odd cycle, whether or not other edges join its vertices, prevents a bipartite split.[ref]
The Basics (author-hosted chapter preview). Section 1.6, Proposition 1.6.1 and proof, printed pp. 17–18
Breadth-first search supplies the converse constructively. Start an uncoloured vertex with colour , and use a FIFO queue to explore its graph component. When an edge first discovers , give the opposite colour to , record as its parent in a rooted tree, and enqueue . If both endpoints of any scanned edge already have the same colour, stop with a conflict. Restart from an uncoloured vertex until every graph component has been examined. If no conflict occurs, all edges cross the two colour classes, which are the required independent sets.[ref]
A conflict also explains the failure. In the rooted tree produced by breadth-first search, let be the graph distance from . The colour of is its distance's integer parity. An edge in an undirected graph satisfies , so equal colours force . Follow the two parent chains upward to their lowest common ancestor , discard the shared graph path from to , and join the remaining two graph paths with the conflict edge . The result is a genuine graph cycle withedges, an odd integer. The two branches have no shared vertices except , so this is more than a closed walk. This odd cycle is a certificate that anyone can check directly, using only its listed vertices and edges.
In the example, breadth-first search from gives , , and . The conflict edge closes the odd cycle , with five edges. The common edge is excluded. Thus the same procedure returns either two independent sets covering , or an explicit odd cycle. With adjacency lists and constant-time FIFO queue operations, its time complexity is in Big O notation, with additional storage.[ref]
The two parts often have a practical meaning: workers and jobs, with an edge exactly when a worker can perform a job. A matching in a graph chooses compatible worker–job pairs with no reused endpoint; merely being bipartite does not guarantee enough compatible pairs. Hall's marriage theorem characterizes when every worker can be matched, and the assignment problem adds costs to seek an optimal assignment. These connections make the bipartite structure useful after recognition, as the starting point for selecting edges under constraints.
Chromatic index 2026-10-14
The chromatic index , also called the edge chromatic number, is the least number of labels in a proper edge colouring of a finite undirected graph without self-loops. Equivalently, it is the smallest number of matchings in a graph whose set partition covers all the edges. We take when there are no edges. For an arbitrary edge colouring, one colour always suffices whenever an edge exists, so properness is essential to this definition. The chromatic number instead colours vertices.[ref]
Graph Theory by Reinhard Diestel. Colouring, author-hosted chapter preview, p. 124: chromatic index and line graph
To establish an exact chromatic index, supply both a proper edge colouring and a reason that fewer colours cannot work. Every edge at a fixed vertex must have its own colour, giving the lower bound , where is the maximum degree of a graph. The bound need not be attained: it counts a single resource's workload, while conflicts can also accumulate around a graph cycle.
Worked proper edge colourings: a triangle in a graph needs three colours, while an even cycle graph needs two
. Numbers beside edges are colour labels; letters at dots are vertices. Both graphs have maximum degree of a graph two. The triangle in a graph has three pairwise conflicting edges, while opposite edges of the square can share a colour. Details.For the triangle in a graph with edges , every pair of edges shares a vertex, so all three require different labels. The assignment works, proving although . In its line graph, those three edges become a three-vertex clique. Treating this as three pair-resource jobs makes the obstruction tangible: each resource has only two jobs, but every pair of jobs conflicts, so no slot can contain two jobs.
For the square cycle graph with edges , use and . Each colour class is a matching in a graph, and each vertex has one edge of each colour. Since , this proves . More generally, alternation closes on any even cycle graph , . On an odd cycle , , two-colour alternation would make the last and first edges share a colour at their common vertex; a third colour on the last edge suffices. Thus even cycle graphs have chromatic index two and odd cycle graphs have chromatic index three. These exact examples show why maximum degree of a graph alone does not determine the answer.
Chromatic number Created 2026-09-24 Updated 2026-10-14
For a nonempty finite simple graph , the chromatic number is the least positive integer for which has a proper vertex graph coloring with at most colours. To establish an exact chromatic number, give a colouring using that many colours and explain why fewer cannot suffice. A colouring alone gives only an upper bound.[ref]
Mathematics for Computer Science by Eric Lehman and others. Lehman, Leighton and Meyer, Mathematics for Computer Science, Definition 11.7.1
These small graphs show why the chromatic number measures more than the presence of triangles in a graph:
- The cycle graph , also the complete graph , has chromatic number three. Every pair of vertices is adjacent, so three distinct colours are necessary and sufficient.
- The cycle graph has chromatic number two. Around the graph cycle, the assignment is proper, and a single colour would violate every edge.
- The cycle graph has chromatic number three. With two colours, alternation around the graph cycle would force the first and fifth vertices to have the same colour despite their joining edge. The assignment works. Thus a triangle-free graph can still require more than two colours.
- The complete graph has chromatic number : all vertices are pairwise adjacent, so each must have its own colour.[ref]
For a cycle graph of even length, alternating two colours closes consistently; for an odd cycle, it does not, and a third colour on the final vertex suffices. More generally, the two-colourability criterion for bipartite graphs says that exactly when is a bipartite graph, and the odd-cycle characterization of bipartite graphs identifies the obstruction as an odd cycle. A nonempty graph with no edges has chromatic number one; a bipartite graph with at least one edge has chromatic number exactly two.
In the pairwise-conflict scheduling model of graph coloring, is the least number of interchangeable slots needed. This turns a drawing into an optimization question: how many groups of compatible activities are unavoidable? Greedy coloring constructs a valid grouping quickly, but its number of colours can exceed the chromatic number.
Graph minor Created 2026-10-05 Updated 2026-10-14
A graph minor compresses connected regions of a graph into single vertices while retaining selected connections between them. For finite simple graphs, means that some sequence of deleting vertices, deleting edges, and performing edge contractions produces up to graph isomorphism. Deleting a vertex also deletes all its incident edges; deleting an edge leaves its endpoints. The edge contraction convention here removes resulting self-loops and duplicate edges.[ref]
For an exact small example, let be the cycle graph with vertices and edges . Contract to a new vertex . The surviving edges are , giving the complete graph . Thus , although has no triangle in a graph as a subgraph. The branch sets of a graph minor are , with the original edges witnessing all three required adjacencies. The first panel of the edge contraction diagram shows this operation.
A subgraph uses existing vertices and edges; a topological minor permits a graph subdivision of the target as a subgraph, so target edges become graph paths with mutually disjoint interiors and no target vertex in an interior. An ordinary graph minor permits whole connected branch sets of a graph minor in place of target vertices. Every topological minor is a graph minor, by contracting the replacement graph paths.[ref]
The converse fails. Take the tree with edges . Contracting gives the star graph . Yet the original tree has maximum degree three, whereas every graph subdivision of retains a centre of degree of a vertex four. Hence is a graph minor but not a topological minor of this tree. The difference is that a connected branch set of a graph minor may gather connections incident to several original vertices.
The counts of vertices and edges never increase under these operations. However, the example shows that being a bipartite graph is not preserved: its graph minor contains an odd cycle. Its chromatic number also increases from two to three. A connected graph stays connected under an edge contraction, because the image of each graph path still connects its endpoints, but deletion can disconnect it. Thus one must check the particular graph property before treating it as preserved by taking graph minors.
Being a planar graph is preserved: in a crossing-free drawing, shrink a contracted edge and bring its incident edges into the merged vertex; deletion merely removes parts of the drawing. This makes a nonplanar graph minor a certificate that the original graph is nonplanar. More strongly, for a finite simple graph, being a planar graph is equivalent to having neither the complete graph nor the complete bipartite graph as a graph minor. Finding the corresponding branch sets of a graph minor settles nonplanarity even when no literal or subgraph is present. The converse is a substantial theorem, rather than a consequence of preservation alone.[ref]
Mycielskian Created 2026-10-14 Updated 2026-10-14
The Mycielski construction replaces a graph with a graph having one shadow vertex for each original vertex and one further vertex adjacent to every shadow. It satisfiesand preserves triangle-freeness. Iterating it from the five-cycle gives triangle-free graphs of arbitrarily large chromatic number.
Here is a finite simple graph with at least one vertex; it need not have an edge. The Mycielskian separates two ways of needing many colours: a large clique forces distinct colours immediately, but a triangle-free graph can impose incompatible choices through its whole pattern of graph adjacency. The Mycielski construction increases that global constraint while preserving the absence of triangles in a graph.
Write the vertex set of as , with . Keep these vertices, add distinct Mycielski shadow vertices , and add a Mycielski apex . The vertex set and complete list of edges areThere are no other edges: the Mycielski shadow vertices form an independent set, has no original vertex as a neighbour, and is not adjacent to . Each Mycielski shadow vertex copies its original vertex's graph neighbourhood within the original vertex set, not its position in the drawing. This is the construction in the inspected research paper.[ref]
For original vertices and original edges, direct counting gives vertices and edges. The original vertices induce a copy of , so no original graph adjacency is lost. A drawing crossing is not an extra vertex.
Start with the complete graph , whose only edge is , abbreviating . Its Mycielskian has exactly the edges . Reading them as gives the cycle graph . A proper vertex colouring gives colour 1, colour 2, and colour 3. Two colours cannot close an odd cycle, so its chromatic number is exactly three.
Odd-cycle characterization of bipartite graphs Created 2026-10-03 Updated 2026-10-05
A graph is bipartite if and only if it contains no odd cycle. One direction follows because every cycle alternates between the two vertex classes. For the converse, in each connected component of a graph choose a root and partition the vertices according to the parity of their graph distance from it. An edge joining equal parities would close an odd cycle, so every edge crosses the partition.
Past exam of the mathematics course of the University of Cambridge 2005 ii Paper 2 17F Solution Created 2026-09-24 Updated 2026-10-14
First suppose is 3-connected and noncomplete, and write . There is an induced path with nonadjacent: otherwise the first three vertices of any shortest path between nonadjacent vertices would contradict that assertion. Since is 3-connected, is a connected graph. Choose a spanning tree of that graph rooted at . Color first with the same color, then color the other vertices in reverse tree order, leaving last. Every vertex except has its tree parent uncolored and thus at most previously colored neighbors. At , the two neighbors share a color, so again at most colors are forbidden. This constructs a proper -coloring and proves Brooks' bound for 3-connected noncomplete graphs. A complete graph is exactly the excluded case; a 3-connected graph cannot be an odd cycle.
For the partition claim, assume are nonnegative integers with . MinimizeIf a vertex in has internal degree , its degree into is at most . Moving it to changes by , contradicting minimality when . The analogous move handles a violation in when . For a zero coefficient, break ties among minimizers by minimizing the total number of internal edges. If , minimality of ensures is independent; a violating vertex in has all its neighbors in and no neighbor in , so moving it reduces the tie-break quantity without increasing . The reversed argument handles . If both are zero then , and the graph is a union of isolated vertices and edges, admitting two independent parts. ThusFor , put . A maximum-degree-three graph containing no is 3-colorable. Here is why the previously proved 3-connected case suffices: connected graphs of degree at most two are paths or cycles and use at most three colors. Split a larger graph at cut vertices and permute colors when gluing. In a 2-connected cubic graph with a two-vertex cut , a cut edge gives colorings of the sides glued with their distinct endpoint colors. If are nonadjacent, the cut components have positive numbers of edges to both endpoints and the total endpoint degrees are at most three. There are at most three components. With three components, adding to each side preserves maximum degree three and gives the endpoints degree two. No new is created, so induction supplies side colorings with distinct endpoint colors, which can be permuted to agree. With two components, the components incident twice to and twice to either agree or differ. If they differ, adding to each side preserves maximum degree three; each augmented side is smaller and cannot be , because one endpoint then has degree only two, so induction gives distinct-endpoint colorings. If they agree, call the side with only one edge from each endpoint the small side. Any coloring of the other side can be matched on it: for equal endpoint colors, contract in the small side (the merged vertex has degree at most two); for distinct colors add (the endpoints again have degree two). Induction applies in both cases. A 2-connected graph with no two-vertex cut is 3-connected and was handled above. This proves the needed subcubic coloring fact without quoting the unproved full theorem.
Use three colors on and at most fresh colors on , by greedy coloring. This gives . More usefully, repeatedly remove degree-at-most-three parts: the partition supplies a four-degree reduction for a cost of three colors. If , then . Induction in , with the remaining part still -free, givesThe base cases use respectively colors, within this bound; at , Brooks' theorem would give four, but the same partition with gives a 3-colorable part and an independent part, hence four. Thus the induction requires no unproved general Brooks theorem.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 38 4 b Solution Created 2026-10-03 Updated 2026-10-14
Run breadth-first search separately in every component of the undirected graph. Give a starting vertex colour zero and each newly discovered neighbour the opposite colour. Reject if an edge joins two vertices with the same assigned colour; otherwise accept after all components have been explored.
If the algorithm accepts, its assignments constitute a graph colouring with two colours. If it rejects, the two search-tree paths and the conflicting edge contain an odd cycle, on which alternating two colours cannot close consistently. Equivalently, a valid graph colouring with two colours fixes the parity of every path from a component's root, so the detected conflict is impossible in a two-colourable graph. The breadth-first search work is with adjacency lists. ThereforeThis is also the two-colourability criterion for bipartite graphs.
Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 3 15H Solution Created 2026-09-24 Updated 2026-10-05
A graph Ramsey number is the least such that every red-blue edge colouring of the complete graph has a red or a blue . At a vertex in , either at least neighbours have red incident edges or at least have blue incident edges. In the first case find a red and adjoin the vertex, or a blue ; the second case is symmetric. ThusStarting with and , induction gives the binomial upper bound for a Ramsey numberFor the lower construction, partition vertices into two classes of size , colour inside-class edges red and between-class edges blue. Red cliques have at most vertices, and the blue graph is bipartite, so has no odd cycle.
Conversely, a graph without an odd cycle is bipartite: in each connected component colour vertices by the parity of the length of a path from a root; differing path parities would give an odd closed walk, hence an odd cycle. On vertices one of the two blue bipartition classes has at least vertices. Every edge within it is red, giving a red . Thus is the exact threshold for this alternative.
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 3 17G b Solution Created 2026-09-24 Updated 2026-10-03
Suppose first that is bipartite. As one traverses any cycle in a graph, its vertices alternate between the two vertex classes. Returning to the initial class therefore requires an even number of edges, so contains no odd cycle.
Conversely, suppose that has no odd cycle. Work separately in each connected component of a graph, choose a root , and putwhere is the graph distance. If adjacent vertices were in the same class, then and parity would force . Choose a breadth-first spanning tree. The two tree paths from to and diverge at some last common vertex; their remaining segments have equal length, and adjoining the edge gives an odd cycle. This contradiction shows that every edge joins to , proving the odd-cycle characterization of bipartite graphs.




