Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

networkx.algorithms.operators.all.compose_all

compose_all(graphs)[source]

Returns the composition of all graphs.

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

Parameters:graphs (list) – List of NetworkX graphs
Returns:C
Return type:A graph with the same type as the first graph in list
Raises:ValueError – If graphs is an empty list.

Notes

It is recommended that the supplied graphs be either all directed or all undirected.

Graph, edge, and node attributes are propagated to the union graph. If a graph attribute is present in multiple graphs, then the value from the last graph in the list with that attribute is used.