Complete bipartite graph
A complete bipartite graph, denoted K_{m,n}, is a bipartite graph whose vertex set is partitioned into two disjoint independent sets of sizes m and n, with every possible edge present between the two sets and no edges within either set.[1][2]
This structure maximizes the number of edges for a given bipartition, yielding exactly m \times n edges in total.[1][2] Each vertex in the m-vertex set has degree n, while each vertex in the n-vertex set has degree m.[1] As a bipartite graph, K_{m,n} is 2-colorable and contains no odd-length cycles.[2]
Notable examples include K_{1,n}, which forms a star graph, and K_{3,3}, known as the utility graph, which is non-planar and demonstrates Kuratowski's theorem.[1] Complete bipartite graphs K_{m,n} have Hamiltonian paths if |m - n| \leq 1 and, when m = n > 1, Hamiltonian cycles; the number of such cycles in K_{n,n} is \frac{n!(n-1)!}{2}.[1] They also admit Hamilton decompositions under certain conditions, such as when m = n is even.[1]
In combinatorial contexts, complete bipartite graphs serve as foundational models for problems in matching theory, network flows, and extremal graph theory, due to their regular structure and maximal connectivity between partitions.[3]
Definition and Notation
A complete bipartite graph is a special case of a bipartite graph, in which the vertex set is partitioned into two disjoint subsets such that every edge connects a vertex from one subset to a vertex from the other.[1][4]
Formally, let G = (V, E) be an undirected simple graph, where V is the finite set of vertices and E is the set of edges. The vertex set V is divided into two disjoint independent sets U and W, with |U| = m and |W| = n, such that no edges exist within U or within W.[1][4] The edge set E consists precisely of all possible edges between vertices in U and vertices in W, ensuring that every vertex in U is adjacent to every vertex in W.[1][4]
Here, an independent set is a subset of vertices with no edges between them, and the graph G contains no loops or multiple edges between the same pair of vertices, adhering to the standard definition of a simple graph.[4] Unless otherwise specified, complete bipartite graphs are assumed to be finite and undirected.[1]
Standard Notation
The standard notation for a complete bipartite graph whose partite sets have cardinalities m and n is K_{m,n}.[5] This denotes a graph with vertex partition (V_1, V_2) where |V_1| = m, |V_2| = n, and every vertex in V_1 is adjacent to every vertex in V_2.[6]
The notation reflects the symmetry of the structure with respect to the partite sets, as K_{m,n} is isomorphic to K_{n,m}.[7]
In the case where the partite sets are of equal size, the graph is referred to as a complete balanced bipartite graph and denoted K_{n,n}.[6]
Examples and Visualizations
Small-Scale Examples
The complete bipartite graph K_{m,n}, denoted with partite sets of sizes m and n, provides foundational instances when considering small values of m and n. These examples illustrate the structure where every vertex in one set connects to all vertices in the other, with no edges within sets.
The smallest case, K_{1,1}, features two vertices and a single edge joining them, forming the simplest nontrivial graph. This can be represented by the adjacency matrix:
where rows and columns correspond to the single vertex in each partite set.
For K_{1,n}, one partite set has a single vertex (the center), connected to all n vertices in the other set (the leaves), resulting in a star graph with n edges. For instance, K_{1,3} has the central vertex adjacent to three leaves, depicted as a central point radiating to three outer points. The adjacency matrix for K_{1,3} (center first, then leaves) is:
0 1 1 1
1 0 0 0
1 0 0 0
1 0 0 0
0 1 1 1
1 0 0 0
1 0 0 0
1 0 0 0
This structure exemplifies a tree with maximum degree n.[6]
The graph K_{2,2} consists of two vertices in each partite set, yielding four edges that form a 4-cycle, often visualized as a square with vertices alternating between sets. Its adjacency matrix (first set rows 1-2, second set rows 3-4) is:
0 0 1 1
0 0 1 1
1 1 0 0
1 1 0 0
0 0 1 1
0 0 1 1
1 1 0 0
1 1 0 0
This is the smallest complete bipartite graph that is a cycle.
Finally, K_{3,3}, known as the utility graph, has three vertices in each partite set and nine edges connecting every vertex across sets. It can be described with partite sets \{a_1, a_2, a_3\} and \{b_1, b_2, b_3\}, where edges exist between all a_i and b_j. The adjacency matrix is:
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
1 1 1 0 0 0
1 1 1 0 0 0
1 1 1 0 0 0
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
1 1 1 0 0 0
1 1 1 0 0 0
1 1 1 0 0 0
This graph is famously non-planar.[8]
Real-World Analogies
A complete bipartite graph K_{m,n} models scenarios where two distinct groups interact exhaustively with each other but not within their own groups, providing an intuitive framework for understanding balanced, cross-partition connections. In social networks, it can represent a dating graph with one partition for males and another for females, where every male is connected to every female, illustrating potential matches without intra-gender links, as seen in stable matching algorithms for pair formation.[9] This structure emphasizes the absence of edges within partitions, mirroring real-world social divisions where interactions are strictly inter-group.
Similarly, K_{m,n} analogies arise in recruitment processes, with one set as job positions and the other as applicants, assuming every applicant is eligible for every position to form a complete matching that optimizes assignments based on skills or preferences, a core concept in the assignment problem.[10] The lack of intra-group edges here reflects that jobs do not "connect" to each other nor do applicants form networks among themselves in this model.
In transportation systems, the graph captures full connectivity between cities (one partition) and airports (the other), with edges representing direct routes available from every city to every airport, facilitating logistics planning without internal city or airport linkages.[11] This highlights the bipartite nature's role in modeling hub-and-spoke efficiencies, where all cross-connections exist but none within hubs or spokes. For a simple case, the star graph K_{1,n}—a special complete bipartite graph—analogizes a central hub like a popular airport connected to multiple peripheral cities.[12]
Structural Properties
Connectivity and Cycles
A complete bipartite graph K_{m,n}, with partite sets of sizes m and n, is connected whenever m \geq 1 and n \geq 1.[13] This connectivity arises because every vertex in one partite set is adjacent to all vertices in the other, ensuring paths exist between any pair of vertices.[13] Furthermore, the graph is \min(m,n)-connected, meaning it remains connected after the removal of fewer than \min(m,n) vertices.[13] The diameter of K_{m,n} is 2 for m, n \geq 1, except in trivial cases like K_{1,1} where it is 1; this follows from the fact that vertices within the same partite set are at distance 2 via any vertex in the opposite set, while cross-set vertices are adjacent.[13]
As a bipartite graph, K_{m,n} contains no odd-length cycles, a defining property that excludes structures like triangles.[13] All cycles in K_{m,n} are even-length, and cycles exist only if m, n \geq 2.[13] The shortest cycles are 4-cycles, formed by selecting two vertices from each partite set, resulting in a girth of 4 when m, n \geq 2.[13] Longer even cycles up to length $2 \min(m,n) are also present, but the absence of odd cycles directly stems from the bipartite partition, preventing any closed walk of odd length.[13]
For m, n \geq 2, K_{m,n} has no bridges, as it is 2-edge-connected: removing any single edge leaves alternative paths between the incident vertices via other connections across the partite sets.[13] Similarly, there are no cut vertices in this case, since the graph is 2-vertex-connected and remains connected after removing any single vertex due to the complete interconnections between partite sets.[13]
Degree Sequences
In a complete bipartite graph K_{m,n}, the vertex set is partitioned into two disjoint subsets U and W with |U| = m and |W| = n, and every vertex in U is adjacent to every vertex in W. Consequently, each vertex in U has degree n, as it connects to all n vertices in W, and each vertex in W has degree m, as it connects to all m vertices in U.[1][14]
The degree sequence of K_{m,n} is therefore n^m m^n, consisting of the degree n repeated m times followed by the degree m repeated n times (typically listed in non-increasing order for graphical sequences). For example, in K_{3,2}, the degree sequence is (3,3,2,2,2). This sequence is graphical and bipartite, satisfying the necessary conditions for realization as a simple bipartite graph.[1]
Complete bipartite graphs are biregular, meaning the vertices in each partite set have uniform degrees within their set but possibly differing between sets; specifically, K_{m,n} is (m,n)-biregular. If m = n, the graph reduces to an m-regular (or n-regular) graph, as all vertices share the same degree.[1][14]
The degree structure directly aligns with the handshaking lemma, which states that the sum of all vertex degrees equals twice the number of edges. Here, the total degree sum is m \cdot n + n \cdot m = 2mn, confirming the edge count of mn and illustrating how the uniform degrees per partite set ensure this balance in bipartite graphs.[14]
Advanced Properties
Extremal Graph Theory
In extremal graph theory, complete bipartite graphs play a central role as extremal structures for avoiding certain forbidden subgraphs, particularly in the context of bipartite graphs and triangle-free graphs. These graphs achieve the maximum number of edges under restrictions that prohibit complete bipartite subgraphs of specified sizes, providing tight bounds in classical theorems. The balanced complete bipartite graph, in particular, emerges as the unique extremal example in several foundational results.[15]
A prominent special case is Mantel's theorem, which determines the maximum number of edges in an n-vertex triangle-free graph. This theorem states that any such graph has at most \lfloor n^2 / 4 \rfloor edges, with equality holding if and only if the graph is the complete bipartite graph K_{\lfloor n/2 \rfloor, \lceil n/2 \rceil}, the balanced bipartition that maximizes edges without forming a triangle. This result, proven in 1907, identifies complete bipartite graphs as the extremal configuration for forbidding K_3 and serves as a cornerstone for broader Turán-type problems.[15]
For more general forbidden complete bipartite subgraphs, the Kővári–Sós–Turán theorem provides the bipartite analog of Turán's theorem. It establishes that, assuming s ≤ t, the Turán number ex(n, K_{s,t}), the maximum edges in an n-vertex graph without a K_{s,t} subgraph, satisfies ex(n, K_{s,t}) ≤ \frac{1}{2} (t-1)^{1/s} n^{2 - 1/s} + \frac{1}{2} (s-1) n. Complete bipartite graphs K_{m,n} serve as extremal examples when m < s or n < t, as such graphs inherently avoid K_{s,t}. This 1954 result highlights how unbalanced complete bipartite graphs can saturate or approach the bound by limiting part sizes to evade the forbidden subgraph.[15][16]
The Zarankiewicz problem, closely tied to this framework, seeks the maximum edges z(m,n; s,t) in an m-by-n bipartite graph without a K_{s,t} subgraph, generalizing the Kővári–Sós–Turán bound. Complete bipartite graphs contribute to lower bounds here; for instance, K_{s-1, n} achieves \Theta(n) edges while avoiding K_{s,t} for any t, though stronger constructions often involve near-complete bipartite structures derived from geometric incidences. The problem remains open for exact values beyond small s,t, but the theorem's upper bound is tight for certain parameters, underscoring the extremal role of complete bipartites.
Complete bipartite graphs also relate to balanced incomplete block designs (BIBDs) in extremal constructions for the Zarankiewicz problem. The incidence graph of a projective plane of order q, which forms a symmetric BIBD with parameters (q^2 + q + 1, q + 1, 1), yields a (q+1)-regular bipartite graph with no K_{2,2} (i.e., C_4-free), providing a lower bound of \Theta(q^3) edges on roughly q^2 vertices per part that approaches the Kővári–Sós–Turán limit for s=t=2. Such designs from finite geometries offer high-impact examples of near-extremal bipartite graphs without small complete bipartites, linking combinatorial design theory to extremal bounds.[17]
Spectral Characteristics
The adjacency matrix of the complete bipartite graph K_{m,n} takes a block form consisting of zero matrices on the diagonal blocks and all-ones matrices on the off-diagonal blocks, specifically A = \begin{pmatrix} O_{m \times m} & J_{m \times n} \\ J_{n \times m} & O_{n \times n} \end{pmatrix}, where O_{k \times l} denotes the k \times l zero matrix and J_{k \times l} denotes the k \times l matrix of all ones.[18]
The eigenvalues of this adjacency matrix are \sqrt{mn} and -\sqrt{mn}, each with algebraic multiplicity 1, and 0 with algebraic multiplicity m + n - 2.[19] Due to the bipartite structure, the nonzero eigenvalues appear in \pm pairs, and the multiplicity of the zero eigenvalue reflects the dimension of the kernel, which aligns with the graph's balanced partition sizes.[19] Complete bipartite graphs K_{m,n} are determined by their adjacency spectrum, meaning that if two such graphs share the same multiset of eigenvalues, they are isomorphic.[19]
The Laplacian spectrum of K_{m,n} consists of the eigenvalues 0 with multiplicity 1, m + n with multiplicity 1, m with multiplicity n - 1, and n with multiplicity m - 1.[19] The eigenvalue 0 corresponds to the constant eigenvector for the connected component, while m + n is the largest Laplacian eigenvalue, reflecting the graph's regularity in each partition. The multiplicities of m and n are tied to the sizes of the opposite partitions, providing a direct algebraic signature of the bipartition.[19]
Characterizations and Recognition
Uniqueness Conditions
A connected bipartite graph is a complete bipartite graph if and only if it is free of induced P_4 subgraphs, where P_4 denotes the path on four vertices.[20] This forbidden induced subgraph characterization underscores the exhaustive connectivity between the two partite sets in complete bipartite graphs, preventing any "gaps" that would create longer induced paths across the parts. For disconnected bipartite graphs, the condition extends to each connected component being P_4-free, resulting in a disjoint union of complete bipartite graphs.[20]
Spectral properties provide another uniqueness condition for complete bipartite graphs. A simple connected graph G of order n \geq 2 with adjacency spectrum \{0^{n-2}, \pm \lambda\} where \lambda > 0 is precisely the complete bipartite graph K_{m,n-m} with m + (n-m) = n and mn = \lambda^2.[21] This multiplicity of zero eigenvalues reflects the balanced structure and high symmetry of complete bipartite graphs, distinguishing them from other graphs with similar spectral radii but nonzero secondary eigenvalues. Bipartiteness further ensures the spectrum's symmetry about zero, but the specific form with exactly two nonzero entries uniquely identifies the complete bipartite case.[21]
The isomorphism class of a complete bipartite graph K_{m,n} is uniquely determined by the ordered pair (m,n) assuming m \leq n, as any relabeling of partite sets merely swaps m and n without altering the structure up to isomorphism. This uniqueness follows directly from the definition, where the graph's edge set consists exactly of all possible edges between the two disjoint sets of sizes m and n, with no edges within sets.
Crown graphs offer a related but distinct structure, defined as the graph obtained from the complete bipartite graph K_{n,n} by removing a perfect matching between the partite sets.[22] These graphs inherit much of the bipartite nature of complete bipartite graphs but introduce specific non-edges that break full completeness while preserving balance and regularity in degrees.
Algorithmic Identification
To identify a complete bipartite graph, first verify bipartiteness using a breadth-first search (BFS) coloring algorithm that attempts to partition the vertices into two independent sets A and B, running in linear time O(|V| + |E|).[23] If the graph is bipartite, confirm completeness by checking whether the number of edges equals |A| \times |B|; equality holds if and only if all possible cross-edges are present, as this matches the maximum edge count for those partition sizes in a simple bipartite graph.[24] This step also runs in linear time, since edge counting can be integrated into the BFS traversal or performed separately in O(|E|).
Generating a complete bipartite graph K_{m,n} involves constructing two disjoint partite sets of sizes m and n, then adding every possible edge between them, which requires O(m n) time and space linear in the graph's output size.[25] Recognition of complete bipartite graphs is thus polynomial-time solvable, with the full procedure achieving linear time complexity overall.
Isomorphism testing for complete bipartite graphs proceeds in quasi-linear time following recognition: compute the partition sizes via uniform degrees (all vertices in one set have degree equal to the size of the other), then compare these sizes (up to order), as graphs K_{m,n} and K_{m',n'} are isomorphic precisely when \{m,n\} = \{m',n'\}.[24] Libraries like NetworkX and graph-tool support generation directly and enable recognition through built-in bipartiteness checks combined with degree or edge-count validation.
Applications
Combinatorial Optimization
Complete bipartite graphs play a central role in combinatorial optimization, particularly in problems involving matchings and covers due to their dense structure between the two partitions. In a complete bipartite graph K_{m,n}, a matching is a set of edges without common vertices, and the maximum matching size is \min(m,n), as every vertex in the smaller partition can be paired with a distinct vertex in the larger one. This follows directly from the graph's completeness, allowing saturation of the smaller side without overlap. For balanced cases where m = n, K_{m,m} admits a perfect matching, which covers all vertices, and this existence is guaranteed by Hall's marriage theorem: for any subset S of one partition, the neighborhood N(S) in the other partition has size at least |S|, since every vertex in S connects to all vertices in the other side. Hall's theorem, originally proved in 1935, provides the necessary and sufficient condition for perfect matchings in bipartite graphs, and complete bipartite graphs trivially satisfy it when partitions are equal.[26]
Computing the maximum matching in K_{m,n} is efficient using bipartite matching algorithms, such as the Hopcroft-Karp algorithm, which runs in O(\sqrt{V} E) time, where V = m + n and E = m n; in this dense case, it simplifies to finding \min(m,n) edges in near-linear time relative to the input size. This algorithm works by iteratively finding multiple shortest augmenting paths via breadth-first search layers, augmenting the matching simultaneously until no paths remain. For optimization contexts, such matchings bound resource allocation problems, like assigning tasks between two groups where full connectivity ensures optimal pairings up to the smaller group size.[27]
König's theorem further connects matchings to covers in bipartite graphs, stating that the size of the maximum matching equals the size of the minimum vertex cover; thus, in K_{m,n}, the minimum vertex cover has size \min(m,n), achieved by selecting all vertices from the smaller partition, which incident to every edge. Proved by Dénes König in 1931, this equality enables polynomial-time solutions for vertex cover in bipartite graphs via matching algorithms, contrasting with the NP-hardness in general graphs. Complementing this, the minimum edge cover— a set of edges incident to every vertex—has size \max(m,n) in K_{m,n}, derived from Gallai's identities, which relate it to the maximum matching as |V| - \nu(G) = m + n - \min(m,n). For instance, when m \leq n, a maximum matching of m edges covers $2m vertices, requiring n - m additional edges to cover the remaining vertices in the larger partition, totaling n. Gallai's identities, established in 1959, unify these parameters across graphs without isolated vertices.[28][26]
Network Modeling
Complete bipartite graphs serve as fundamental models for representing fully interconnected systems between two distinct groups in network analysis, capturing scenarios where every entity in one partition interacts exhaustively with every entity in the other. In such structures, denoted as K_{m,n}, the absence of intra-partition edges ensures a clean separation of roles, making them ideal for abstracting binary relationships in real-world networks without unnecessary complexity. This modeling approach is particularly valuable in domains requiring exhaustive connectivity, such as resource allocation or interaction mapping, where partial connections would inadequately represent the system's universality.[29]
One prominent application lies in bipartite network modeling frameworks, where complete bipartite graphs act as building blocks to construct and analyze complex interactions. For instance, in the Bipartite Network Modeling (BNM) methodology, a bipartite graph is formulated in the initial stage by defining two node sets (e.g., entities U and locations V) and including edges based on available data, yielding G = (U, V, E). This structure enables subsequent processes like edge pruning or community extraction. Real-world examples include modeling dolphin-location interactions for habitat suitability assessment, where 13 dolphins connect to 13 locations via 38 edges, and epidemiological networks for dengue hotspot identification, linking 8 humans to 19 public places with 20 edges. These models facilitate quantitative analysis, such as centrality measures or suitability scoring, by leveraging the graph's observed interactions to reveal patterns in ecological or health data.[29]
In social and complex network analysis, complete bipartite graphs underpin algorithms for detecting overlapping communities in bipartite structures, addressing the challenge of identifying dense subgroups amid universal inter-set links. The CBG&BEN algorithm, for example, employs a micro-bipartite network model called Bi-EgoNet, which decomposes the network into local views around node pairs, and extracts complete bipartite subgraphs (CBGs) as indivisible units where all nodes share community membership due to full connectivity. These CBGs are merged based on shared nodes (with a commonality threshold of at least 3) to form local communities, which are then integrated globally using similarity metrics like extended modularity (EQb) and normalized mutual information (NMI). Evaluations on real-world datasets, such as collaboration networks and product-user interactions, demonstrate superior performance in capturing overlapping memberships compared to baselines like CPM or LFM, with higher density and modularity scores highlighting the model's effectiveness in scalable network partitioning.[30]