compose_all

compose_all(graphs, name=None)[source]

Return 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
  • name (string) – Specify name for new graph
Returns:

C

Return type:

A graph with the same type as the first graph in 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.