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,Hgraph
A NetworkX graph
- rootnode
A node in H
- Returns
- RThe 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.