#

Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

#

networkx.algorithms.operators.binary.full_join

full_join(G, H, rename=None, None)[source]

Returns the full join of graphs G and H.

Full join is the union of G and H in which all edges between G and H are added. The node sets of G and H must be disjoint, otherwise an exception is raised.

Parameters
  • G, H (graph) – A NetworkX graph

  • rename (bool , default=(None, None)) – Node names of G and H can be changed by specifying the tuple rename=(‘G-‘,’H-‘) (for example). Node “u” in G is then renamed “G-u” and “v” in H is renamed “H-v”.

Returns

U

Return type

The full join graph with the same type as G.

Notes

It is recommended that G and H be either both directed or both undirected.

If G is directed, then edges from G to H are added as well as from H to G.

Note that full_join() does not produce parallel edges for MultiGraphs.

The full join operation of graphs G and H is the same as getting their complement, performing a disjoint union, and finally getting the complement of the resulting graph.

Graph, edge, and node attributes are propagated from G and H to the union graph. If a graph attribute is present in both G and H the value from H is used.