The graph union
of graphs
and
with vertex
sets
and
and edge sets
and
is the graph with
and
(Skiena 1990, pp. 129-131). Vertices having
the same labels are identified, and edges common to both edge sets are not duplicated.
When
and
are disjoint, the graph union coincides with the graph
disjoint union.
The Wolfram Language function GraphUnion[g1, g2] computes the graph union by merging vertices and edges with shared labels.