---
title: Complete Multipartite Graphs
url: https://www.emergentmind.com/topics/complete-multipartite-graphs
type: topic
---

# Complete Multipartite Graphs

A complete multipartite graph is a simple graph whose vertex set can be partitioned into $k \geq 2$ disjoint, nonempty parts $V_1, \dots, V_k$, with the property that no two vertices within the same part are adjacent, while every pair of vertices from different parts forms an edge. These graphs constitute a fundamental class in algebraic, combinatorial, and metric graph theory by encoding extremal adjacency structures and serving as a canonical combinatorial model across several advanced mathematical and algorithmic applications.

## 1. Structure and Basic Properties

Given vertex partition sizes $p_1, \dots, p_k$ (each $p_i > 0$), the complete $k$-partite graph $K_{p_1, \dots, p_k}$ is defined with
- vertex set $V = V_1 \sqcup \cdots \sqcup V_k$, $|V_i| = p_i$,
- edge set $E = \{ \{u,v\} : u \in V_i, v \in V_j, i \ne j \}$.

Key invariants:
- Number of vertices: $n = \sum_{i=1}^k p_i$,
- Number of edges: $|E| = \sum_{1 \leq i < j \leq k} p_i p_j = \frac{1}{2}(n^2 - \sum_{i=1}^k p_i^2)$.

Particular cases include $k=1$ (complete graph $K_n$), $k=2$ (complete bipartite graph $K_{p_1, p_2}$), and the trivial empty graph ($E = \varnothing$). The non-edge relation in a complete multipartite graph is an equivalence relation on $V$ with at least two equivalence classes, corresponding to parts $V_1, \dots, V_k$ [2103.09470, 1902.02575].

## 2. Metric and Ultrametric Characterizations

Complete multipartite graphs arise as extremal combinatorial objects characterizing ultrametric spaces. Let $(X, d)$ be a (semi)metric space. The diametrical graph $G_{X,d}$ is formed by taking all unordered pairs $\{u,v\}$ with $u \ne v$ and $d(u,v) = \operatorname{diam}X$, where $\operatorname{diam}X = \sup\{ d(x,y) : x, y \in X \}$.

Main result ([2103.09470]):
- Let $d_\varepsilon(x, y) = \max\{d(x, y), \varepsilon\}$ for $\varepsilon > 0$.
- $(X, d)$ is ultrametric (i.e., $d(x, y) \leq \max\{d(x, z), d(z, y)\}$) if and only if for all $\varepsilon > 0$, the diametrical graph $G_{X, d_\varepsilon}$ is either empty or complete multipartite.

This characterization allows for purely combinatorial recognition of ultrametricity via inspection of thresholded extremal-edge graphs. In the totally bounded case, the diametrical graph is always a complete $k$-partite graph, where $k$ equals the number of maximal open balls of radius $\operatorname{diam}X$. For compact ultrametrizable spaces, compactness is equivalent to the diametrical graph being nonempty and complete multipartite for each compatible ultrametric $d$ [2103.09470].

## 3. Seidel Spectrum and Switching Equivalences

Complete multipartite graphs are not determined by their adjacency spectrum, but are determined up to switching by their Seidel spectrum. For a graph $G$ with adjacency matrix $A(G)$ and $n$ vertices, the Seidel matrix is 
\[
S(G) = J_n - I_n - 2A(G),
\]
where $J_n$ is the all-ones matrix and $I_n$ is the identity.

Under Seidel switching (toggling adjacencies across a bipartition), the Seidel spectrum is invariant. The key result is ([1902.02575]):
- If a graph $G$ is Seidel-cospectral with $K_{p_1,\dots,p_k}$, then $G$ is switching-equivalent to a (possibly distinct) complete $k$-partite graph.
- If each distinct part size appears at least 3 times, then $K_{p_1,\dots,p_k}$ is determined up to switching by its Seidel spectrum.

For tripartite graphs $K_{p,q,r}$, $S$-determination is equivalent to the system $x+y+z = p+q+r$, $xyz = pqr$ having only one solution up to permutation. Non-isomorphic, Seidel-cospectral examples exist, first at $n=13$. It is conjectured that no complete tripartite graph on more than 18 vertices is $S$-determined [1902.02575].

## 4. Distance and Squared Distance Matrix Spectra

The distance matrix $D(G)$ captures the shortest-path distances between vertices. For $G = K_{n_1,\dots,n_t}$, distances are:
- $d_{ij} = 0$ if $i = j$,
- $d_{ij} = 1$ if $i, j$ are in different parts,
- $d_{ij} = 2$ if $i, j$ are in the same part (since the shortest path goes via any vertex from a different part).

The squared distance matrix $\Delta(G)$ has entries $0$, $1$, and $4$ accordingly. Its spectrum is determined by a block-plus-rank-one structure:
- Eigenvalue $-4$ with multiplicity $n-t$,
- $t$ simple eigenvalues derived from the secular equation involving the part sizes,
- Inertia $(n_+, n_0, n_-)$ precisely controlled by the part sizes, with $n_+ = t$ if all $n_i\geq2$ and $n_- = n-t$ in this case.

Squared distance energy $E_\Delta(G)$ is $8(n-t)$ if all $n_i \geq 2$, and in the case of $h$ singleton parts, $8(n-t) + 2(h-1) \leq E_\Delta(G) < 8(n-t) + 2h$. Among $t$-partite graphs with $n$ vertices, the split graph $S_{n,t}$ maximizes, and the Turán graph $T_{n,t}$ minimizes $E_\Delta$ and the spectral radius of $\Delta(G)$ [2012.04341].

## 5. Enumeration and Encoding of Acyclic Orientations

Acyclic orientations of complete multipartite graphs admit a unique combinatorial coding via $p$-ary vectors of length $N$ with no adjacent repeated symbols, where $p$ is the number of parts and $N$ the number of vertices. This establishes a bijection between each such vector and an acyclic orientation by source-removal orderings—each source always lies in a (unique) part, and is removed sequentially [2303.09021].

The total number of acyclic orientations for $K_{n_1,\dots,n_p}$ (with parts fixed) is characterized recursively:
\[
A(n_1, \dots, n_p) = \sum_{i=1}^p A(n_1,\dots,n_i-1,\dots, n_p),
\]
with $A(0, \dots, 0) = 1$ and $A(\dots,n_i<0,\dots)=0$.

For labelled vertices, the enumeration involves Stirling numbers and run-avoiding words:
\[
\sum_{1 \leq k_i \leq n_i} S(n_1, k_1)\cdots S(n_p, k_p) k_1! \cdots k_p! X_{k_1,\dots,k_p},
\]
where $X_{k_1, \dots, k_p}$ counts length-$K$ words on $p$ symbols, $K = \sum k_i$, no adjacent repeats.

Non-isomorphic acyclic orientations, and those with a unique source (i.e., spanning tree-rooted orientations), are also enumerated explicitly:
\[
B(n_1,\dots,n_p) = \frac{N!}{n_1! \cdots n_p!} \prod_{j=1}^s \frac{1}{r_j!},
\]
where $r_j$ counts the number of times size $d_j$ occurs among part sizes $n_1,\dots, n_p$ [2303.09021].

## 6. Extremal and Spectral Properties

Complete multipartite graphs serve as extremal cases for various combinatorial optimization problems. Majorization of part sizes governs the monotonicity of the squared distance energy and the spectral radius. The most unbalanced partition, corresponding to the split graph $S_{n,t}$, uniquely attains the maximum, while the most balanced (the Turán graph $T_{n,t}$) attains the minimum, except for small exceptional cases. These extremal properties are proven using block matrix techniques, spectral interlacing, and majorization arguments [2012.04341].

Spectral characterizations are addressed as well: complete multipartite graphs are determined by their distance spectrum and, up to switching, by their Seidel spectrum, but not by their adjacency spectrum [1902.02575].

## 7. Illustrative Examples and Applications

- In ultrametric analysis, the diametrical graphs of $p$-adic integer balls are complete $p$-partite, with parts given by residue classes mod $p$ [2103.09470].
- In spectral graph theory, $K_{p_1, p_2, p_3}$ and $K_{q_1, q_2, q_3}$ can be Seidel-cospectral without being switching equivalent; concrete examples exist for small orders such as $K_{6,6,1}$ and $K_{9,2,2}$ [1902.02575].
- In algorithmic enumeration, acyclic orientations of $K_{n_1,\dots,n_p}$ correspond bijectively to $p$-ary codes of length $N$ with no repetitions, and recursive generation of all orientations is $O(N)$ per orientation [2303.09021].
- In the context of energy extremality, for fixed number of vertices $n$ and parts $t$, the split graph $S_{n,t}$ and Turán graph $T_{n,t}$ sandwich the possible squared distance energies of complete multipartite graphs [2012.04341].

Complete multipartite graphs thus encode a unique blend of algebraic, metric, and enumerative structure foundational to graph theory and its analytic extensions. The literature surveyed establishes canonical criteria and exact formulas for their recognition and quantitative analysis in a variety of mathematical contexts.

Source: https://www.emergentmind.com/topics/complete-multipartite-graphs