Disjoint union of graphs
In graph theory, the disjoint union of two graphs G and H, often denoted G \cup H or G + H, is the graph whose vertex set is the union of the vertex sets V(G) and V(H) (which are assumed to be disjoint) and whose edge set is the union of the edge sets E(G) and E(H), with no edges connecting vertices from G to vertices from H.[1] This operation produces a disconnected graph that preserves the structure of each original graph as an isolated component.[1] The disjoint union extends naturally to multiple graphs, where the result is a graph with the summed vertex and edge sets across all components, and it plays a foundational role in characterizing disconnected graphs: a graph is disconnected if and only if it is a nontrivial disjoint union of two or more connected graphs.[2] Key properties include additivity for the independence number, \alpha(G \cup H) = \alpha(G) + \alpha(H), reflecting the ability to select independent sets independently in each component; the chromatic number, \chi(G \cup H) = \max\{\chi(G), \chi(H)\}, since colorings of the components can reuse the same palette up to the maximum required; and the vertex connectivity \kappa(G \cup H) = 0 (assuming nonempty G and H), since the resulting graph is disconnected.[1] Additionally, the chromatic polynomial of the disjoint union factors as the product of the individual chromatic polynomials, \pi_k(G \cup H) = \pi_k(G) \cdot \pi_k(H), which aids in counting proper colorings.[1] Beyond basic properties, the disjoint union is central to the construction of cographs (or complement-reducible graphs), which are precisely the graphs obtainable from the single-vertex graph by repeated applications of disjoint union and complementation; these graphs are P_4-free and have efficient recognition algorithms. It also appears in extremal graph theory, such as in Ramsey theory for analyzing unions of cliques or cycles, and in applications like modeling independent subsystems in networks or decomposing graphs into components for algorithmic processing.[3] The operation's simplicity makes it a building block for more complex graph products, like the join (disjoint union plus complete bipartite edges between components), while ensuring no interactions between parts facilitates proofs in spectral graph theory, where the adjacency matrix becomes block-diagonal.[1]Definition and Notation
Formal Definition
In graph theory, the disjoint union of two graphs G = (V(G), E(G)) and H = (V(H), E(H)) with disjoint vertex sets V(G) \cap V(H) = \emptyset is defined as the graph G \sqcup H = (V(G) \cup V(H), E(G) \cup E(H)), where there are no edges connecting vertices from V(G) to V(H) [4]. This operation combines the structures of G and H without introducing any inter-component connections, preserving the internal edges and vertices of each graph intact [4]. The definition extends naturally to a finite family of graphs \{G_i = (V(G_i), E(G_i)) \mid i \in I\}, where the V(G_i) are pairwise disjoint: the disjoint union \bigsqcup_{i \in I} G_i has vertex set \bigcup_{i \in I} V(G_i) and edge set \bigcup_{i \in I} E(G_i), again with no edges between distinct G_i [4]. To ensure vertex disjointness when labels may overlap, vertices are often relabeled, for example, as ordered pairs (i, v) for v \in V(G_i) and i \in I, yielding V\left( \bigsqcup_{i \in I} G_i \right) = \{(i, v) \mid i \in I, v \in V(G_i)\} and E\left( \bigsqcup_{i \in I} G_i \right) = \{\{(i, v_1), (i, v_2)\} \mid i \in I, \{v_1, v_2\} \in E(G_i)\} [4]. Every graph is the disjoint union of its connected components, which are the maximal connected subgraphs, and this decomposition yields a disconnected graph unless all but one component is empty [5]. For directed graphs, the disjoint union G \sqcup H of two digraphs G = (V(G), A(G)) and H = (V(H), A(H)) with disjoint vertex sets preserves the arc sets A(G \sqcup H) = A(G) \cup A(H), with no arcs directed from V(G) to V(H) or vice versa, maintaining the original directions within each component [6].Common Notations
In graph theory literature, the disjoint union of two graphs G and H is commonly denoted by G + H, particularly in combinatorial contexts where the operation is treated additively.[7] This notation assumes the vertex sets of G and H are disjoint, aligning with the formal definition requiring no shared vertices.[7] Another prevalent symbol is G \sqcup H, which explicitly highlights the disjointness of the underlying sets, and is frequently used in modern expositions and research papers.[8] In some algebraic graph theory texts, the notation G \oplus H appears as an alternative, drawing an analogy to the direct sum in linear algebra.[9] Within category theory, the disjoint union of graphs is conceptualized as the coproduct in the category of graphs, though specific symbolic notation may vary.[10] In computational implementations, libraries such as Wolfram Mathematica employ the functionGraphDisjointUnion[G, H], while igraph uses disjoint_union(G, H).[11][12]
The additive notation G + H dates to mid-20th-century graph theory texts and evolved from set-theoretic unions, becoming standardized in influential works like Bondy and Murty's.[7]
Properties
Structural Properties
The disjoint union of two graphs G and H, denoted G \sqcup H or G + H, combines their vertex and edge sets without introducing any connections between them, resulting in a graph whose connected components are precisely the components of G and H. If both G and H are nonempty and connected, then G \sqcup H is disconnected with exactly two connected components. More generally, the number of connected components in G \sqcup H equals the sum of the numbers in G and H, as there are no edges linking vertices across the original graphs.[7][13] In G \sqcup H, the degree of every vertex remains unchanged from its degree in either G or H, since no new edges are added and no existing incidences are altered. This preservation holds because the vertex sets are disjoint, ensuring that neighborhoods are confined to their respective original graphs. Consequently, structural features like isolated vertices or high-degree vertices in one graph do not affect the other.[7][13] For infinite graphs, the disjoint union operation extends naturally: if both G and H are countable, then G \sqcup H is also countable, as the union of two countable disjoint sets is countable. The cardinality of the vertex set in G \sqcup H is the cardinal sum of the cardinalities of V(G) and V(H), and similarly for the edge set. This property ensures that the operation respects the size and structure of infinite graphs without introducing uncountable elements from countable inputs.[13] The adjacency matrix of G \sqcup H is the block-diagonal matrix formed by placing the adjacency matrices of G and H along the diagonal, with zero blocks off the diagonal to reflect the absence of edges between the graphs. Assuming the vertices are ordered such that those of G precede those of H, this structure directly encodes the disconnection and independence of the components.[13]Invariant Preservation
The order of the disjoint union G \sqcup H of two graphs G and H is the sum of their individual orders, that is, |V(G \sqcup H)| = |V(G)| + |V(H)|.[13] Similarly, the size, or number of edges, is additive: |E(G \sqcup H)| = |E(G)| + |E(H)|.[13] These properties follow directly from the construction of the disjoint union, where the vertex and edge sets are combined without overlap.[13] Certain graph invariants are preserved by taking the maximum over the components. The chromatic number satisfies \chi(G \sqcup H) = \max(\chi(G), \chi(H)), as colorings of the components can be independently assigned using the larger number of colors required by either graph.[13] The clique number behaves analogously: \omega(G \sqcup H) = \max(\omega(G), \omega(H)), since no edges exist between the components, preventing larger cliques from forming across them.[13] In contrast, the independence number is additive: \alpha(G \sqcup H) = \alpha(G) + \alpha(H), as independent sets in the union can be formed by taking the union of maximum independent sets from each component.[13] Spectral invariants also exhibit union-like behavior under disjoint union. The eigenvalues of the adjacency matrix of G \sqcup H form the multiset union of the eigenvalues of G and H, with multiplicities preserved from each.[14] For the Laplacian matrix, the spectrum is likewise the multiset union of the individual Laplacian spectra, with the eigenvalue 0 having multiplicity equal to the number of components (two in the case of two graphs).[14] Other structural invariants include the girth, which is the minimum of the girths of the components when both are defined (i.e., both graphs contain cycles): g(G \sqcup H) = \min(g(G), g(H)).[13] The disjoint union preserves planarity: if both G and H are planar, then so is G \sqcup H, as the components can be drawn separately without crossings.[13]Examples and Constructions
Basic Examples
The disjoint union of two isolated vertices, each represented as the complete graph K_1, yields a graph with two vertices and no edges. This is the empty graph on two vertices, often denoted $2K_1, where the vertex set is the disjoint union of the individual vertices and the edge set is empty.[15] A basic example involving an edge is the disjoint union K_1 + K_2, where K_2 is the complete graph on two vertices (a single edge). The resulting graph has three vertices: two connected by an edge and one isolated vertex. The vertex set combines the disjoint vertices from K_1 and K_2, while the edge set includes only the single edge from K_2, with no additional connections.[16] For cycles, the disjoint union C_3 + C_4 produces a graph with seven vertices and seven edges, consisting of a disconnected triangle (C_3) and a 4-cycle (C_4). No edges exist between the two components, preserving the cyclic structures independently.[17] The disjoint union of complete graphs, K_m + K_n, forms two separate cliques of sizes m and n with no edges between them. This creates a simple disconnected cluster graph with \binom{m}{2} + \binom{n}{2} edges in total. To illustrate the construction, consider G = K_2 with vertices labeled 1 and 2 (edge between 1 and 2) and H = K_1 with vertex labeled 3 (no edges). The adjacency list for G + H is:- 1: {2}
- 2: {1}
- 3: {}
Special Graph Classes
Cluster graphs, also known as disjoint unions of cliques, form a fundamental class where the graph consists entirely of isolated complete subgraphs with no edges between them. This structure ensures that each connected component is a clique, making the graph free of induced P_3 paths across components. Cluster graphs arise naturally in clustering problems and network analysis, where vertices within clusters are fully connected, and clusters remain independent.[19] Cographs represent another key class built iteratively using disjoint unions alongside complement operations. Starting from a single isolated vertex, cographs are constructed by repeatedly applying the disjoint union to combine existing cographs or taking the complement of a cograph, which inverts edges within the structure. This recursive definition yields graphs that are precisely the induced P_4-free graphs, exhibiting modular decompositions without the forbidden 4-vertex path. The disjoint union operation preserves the complement-reducible property, allowing cographs to model hierarchical structures in various applications.[20] Threshold graphs incorporate disjoint unions in their constructive definition, beginning with a single vertex and adding either an isolated vertex—equivalent to a disjoint union with K_1—or a dominating vertex adjacent to all existing vertices. This process generates graphs characterized by degree sequences where neighborhoods are nested, and they are free of induced 2K_2, P_4, and C_4 subgraphs. The inclusion of isolated vertices via disjoint union enables the representation of sparse, hierarchical networks, such as dominance orders in social structures.[21] Disjoint unions of cycles produce graphs with girth determined by the shortest cycle in the union, providing extremal constructions in graph theory for maximizing edges while avoiding shorter cycles or certain minors. For instance, the extremal function for such graphs as disconnected minors bounds the maximum edges in H-minor-free graphs, where H is the union; when H is a disjoint union of cycles, ex(n, H) = n/2. These constructions highlight properties like even degrees and 2-regular components, useful in studying connectivity and cycle packing.[22] In these special classes, invariants such as the chromatic number equal the maximum over the components, reflecting the disjoint nature of the unions.[20]Related Operations and Concepts
Comparison with Other Operations
The disjoint union of two graphs G and H combines their vertex sets and edge sets without adding any edges between the components, resulting in a disconnected graph whose components are isomorphic to G and H. In contrast, the join operation G * H, also known as the complete bipartite addition, starts with the disjoint union but adds every possible edge between vertices of G and H, yielding a connected graph that is the complete bipartite graph K_{|V(G)|,|V(H)|} plus the internal edges of G and H. This fundamental difference highlights the disjoint union as preserving the isolation of components, while the join maximizes inter-component connectivity.[16][23] Unlike the Cartesian product G \square H, which forms a graph on vertex set V(G) \times V(H) with edges only when vertices differ in exactly one coordinate and are adjacent in that graph's component, the disjoint union introduces no such layered or grid-like interconnections. The Cartesian product often produces connected graphs with structured paths mimicking products of paths or cycles, whereas the disjoint union maintains complete separation, akin to placing the graphs side by side without interaction. The strong product G \boxtimes H extends this further by including edges from both the Cartesian product and cases where vertices are adjacent in both factors simultaneously, creating denser connectivity that combines elements of layering and joining; in opposition, the disjoint union represents the minimal connection, adding zero cross-edges.[24][25] The lexicographic product G[H], defined by adjacency if the first coordinates are adjacent in G or identical with the second coordinates adjacent in H, effectively replaces each vertex of G with a copy of H and connects entire copies fully whenever the original vertices in G are adjacent, leading to highly ordered and often complete-like substructures. This ordered dependency starkly differs from the disjoint union, where components remain independent and no such hierarchical or adjacency-driven cross-links are imposed. Overall, while these operations all build on combining vertex sets, the disjoint union uniquely emphasizes disconnection and independence, serving as the baseline for more integrative products.[26]Categorical Perspective
In the category of graphs, denoted Graph, the disjoint union serves as the coproduct. For any two graphs G and H, their disjoint union G \sqcup H satisfies the universal property of the coproduct: for any graph K and any pair of graph morphisms f: G \to K and g: H \to K, there exists a unique graph morphism h: G \sqcup H \to K such that h \circ i_G = f and h \circ i_H = g, where i_G: G \to G \sqcup H and i_H: H \to G \sqcup H are the inclusion morphisms.[27][10] The inclusion morphisms i_G and i_H act as the identity on their respective components, embedding G and H into G \sqcup H without alteration or overlap. This coproduct is unique up to isomorphism, meaning any other object fulfilling the same universal property is isomorphic to G \sqcup H.[27] This structure extends naturally to categories of directed graphs and multigraphs. In categories such as DiGrphs for directed graphs and Grphs for multigraphs (which permit multiple edges), the coproduct remains the disjoint union, preserving the universal property with analogous inclusions.[27] At the foundational level, the disjoint union of graphs reduces to the coproduct in the category of sets: the vertex set of G \sqcup H is the disjoint union of the vertex sets of G and H, and similarly for the edge sets, ensuring compatibility with the graph structure.[10]Applications
In Graph Decomposition
The connected components theorem states that any graph can be uniquely decomposed, up to the ordering of components, as the disjoint union of its maximal connected subgraphs. This decomposition partitions the vertex set into equivalence classes under the reachability relation, where each component is a connected induced subgraph, and no edges exist between different components.[7] In modular decomposition, modules are vertex subsets that behave uniformly with respect to the rest of the graph, and the decomposition identifies a hierarchy of such modules that is closed under disjoint unions. This structure is particularly relevant in recognizing cographs, which are graphs constructed solely from isolated vertices via repeated disjoint unions and joins, resulting in a modular decomposition tree with only union and join nodes.[28] In spectral graph theory, the disjoint union of graphs facilitates the analysis of the Laplacian matrix, which becomes block-diagonal with blocks corresponding to the Laplacians of the individual components. This property allows the eigenvectors of the overall Laplacian to be decomposed into those of the components, enabling independent spectral analysis for tasks such as component identification and connectivity assessment.[29] Historically, the disjoint union played a key role in early classifications of infinite graphs, as explored by Dénes König in his foundational work on the theory of finite and infinite graphs during the 1930s.[30]In Algorithmic Graph Theory
The disjoint union of two graphs G_1 = (V_1, E_1) and G_2 = (V_2, E_2) with disjoint vertex sets can be computed in linear time by concatenating their adjacency list representations, yielding a time complexity of O(|V_1| + |V_2| + |E_1| + |E_2|). This operation relabels vertices if necessary to ensure disjointness and preserves structural properties without additional overhead.[31] Recognition algorithms for graph classes closed under disjoint union, such as cographs, exploit this operation for efficient identification. Cographs, defined as P_4-free graphs built from single vertices via disjoint unions and joins, can be recognized in linear time, O(n + m), through construction of a cotree where union nodes represent disjoint unions of subgraphs. This seminal algorithm processes the graph via a series of modular checks and builds the hierarchical representation directly.[32] Module identification extends this to general graphs by computing the modular decomposition, which identifies maximal strong modules treatable as units under disjoint union-like behaviors. A recursive linear-time algorithm using lexicographic BFS orders the vertices to factorize modules and constructs the decomposition tree in O(n + m) time, enabling recognition of classes invariant under disjoint unions.[33] In optimization problems on disconnected graphs formed by disjoint unions, computations decompose naturally across components. For example, the maximum independent set size is the sum of sizes over components, allowing parallel algorithms to solve independently on each and aggregate results, reducing overall complexity for large inputs. The additivity of invariants like independence number over disjoint unions aids such decompositions in algorithmic efficiency. Software libraries provide practical implementations of disjoint union that maintain attributes and support these computations. NetworkX in Python offers adisjoint_union function that relabels nodes sequentially and copies edge/node data, facilitating algorithmic pipelines. Similarly, igraph in R and C includes disjoint_union for multiple graphs, relabeling vertices to ensure disjointness while preserving metadata.[31][12]