disjoint_union_all#
- disjoint_union_all(graphs)[source]#
Returns the disjoint union of all graphs.
This operation forces distinct integer node labels starting with 0 for the first graph in the list and numbering consecutively.
- Parameters:
- graphsiterable
Iterable of NetworkX graphs
- Returns:
- UA graph with the same type as the first graph in list
- Raises:
- ValueError
If
graphs
is an empty list.- NetworkXError
In case of mixed type graphs, like MultiGraph and Graph, or directed and undirected graphs.
Notes
For operating on mixed type graphs, they should be converted to the same type.
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.