NetworkX

Previous topic

networkx.cartesian_product

Next topic

networkx.complement

networkx.compose

compose(G, H, create_using=None, name=None)

Return a new graph of G composed with H.

Composition is the simple union of the node sets and edge sets. The node sets of G and H need not be disjoint.

Parameters:

G,H : graph

A NetworkX graph

create_using : NetworkX graph

Use specified graph for result. Otherwise a new graph is created with the same type as G

name : string

Specify name for new graph

Notes

A new graph is returned, of the same class as G. It is recommended that G and H be either both directed or both undirected. Attributes from G take precedent over attributes from H.