networkx.algorithms.operators.product.rooted_product

rooted_product(G, H, root)[source]

Return the rooted product of graphs G and H rooted at root in H.

A new graph is constructed representing the rooted product of the inputted graphs, G and H, with a root in H. A rooted product duplicates H for each nodes in G with the root of H corresponding to the node in G. Nodes are renamed as the direct product of G and H. The result is a subgraph of the cartesian product.

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

  • root (node) – A node in H

Returns

R

Return type

The rooted product of G and H with a specified root in H

Notes

The nodes of R are the Cartesian Product of the nodes of G and H. The nodes of G and H are not relabeled.