- graphscope.nx.classes.function.induced_subgraph(G, nbunch)[source]#
Returns a independent deep copy subgraph induced on nbunch.
The induced subgraph of a graph on a set of nodes N is the graph with nodes N and edges from G which have both ends in N.
G (NetworkX Graph) –
nbunch (node, container of nodes or None (for all nodes)) –
subgraph – A independent deep copy of the subgraph in G induced by the nodes.
- Return type
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc >>> H = G.subgraph([0, 1, 2]) >>> list(H.edges) [(0, 1), (1, 2)]