Returns a independent deep copy subgraph induced by the specified edges. The induced subgraph contains each edge in `edges` and each node incident to any of those edges. Parameters ---------- G : NetworkX Graph edges : iterable An iterable of edges. Edges not presen
(G, edges)
| 124 | |
| 125 | |
| 126 | def edge_subgraph(G, edges): |
| 127 | """Returns a independent deep copy subgraph induced by the specified edges. |
| 128 | |
| 129 | The induced subgraph contains each edge in `edges` and each |
| 130 | node incident to any of those edges. |
| 131 | |
| 132 | Parameters |
| 133 | ---------- |
| 134 | G : NetworkX Graph |
| 135 | edges : iterable |
| 136 | An iterable of edges. Edges not present in `G` are ignored. |
| 137 | |
| 138 | Returns |
| 139 | ------- |
| 140 | subgraph : SubGraph |
| 141 | A edge-induced subgraph of subgraph of `G`. |
| 142 | |
| 143 | Examples |
| 144 | -------- |
| 145 | >>> G = nx.path_graph(5) |
| 146 | >>> H = G.edge_subgraph([(0, 1), (3, 4)]) |
| 147 | >>> list(H.nodes) |
| 148 | [0, 1, 3, 4] |
| 149 | >>> list(H.edges) |
| 150 | [(0, 1), (3, 4)] |
| 151 | """ |
| 152 | return G.edge_subgraph(edges) |
| 153 | |
| 154 | |
| 155 | @patch_docstring(func.number_of_selfloops) |
nothing calls this directly
no test coverage detected