union of two graphs
gunion(G, H, 'SIMPLE')
graph or network
(optional) indicates that simple union wanted
Important: The networks package has been deprecated. Use the superseding command GraphTheory[GraphUnion] instead.
This procedure creates a graph whose vertex set is the usual set-theoretic union of the vertex sets of G and H, and which has an edge for each edge of G and for each edge of H.
Multiple edges that have the same endpoints are retained unless 'SIMPLE' is specified, in which case multiple edges are reduced to a single edge.
This routine is normally loaded by using the command with(networks), but it may also be referenced by using the full name networks[gunion](...).
G ≔ complete⁡a1,a2,a3,a4:
H ≔ complete⁡2,3:
J ≔ void⁡a1,a2,2,4:
U ≔ gunion⁡G,J:
U ≔ gunion⁡U,H,'SIMPLE':
Download Help Document