Return the induced edge subgraph. Parameters ---------- e : utils.Index The edges. preserve_nodes : bool Indicates whether to preserve all nodes or not. If true, keep the nodes which have no edge connected in the subgraph;
(self, e, preserve_nodes=False)
| 619 | return gis |
| 620 | |
| 621 | def edge_subgraph(self, e, preserve_nodes=False): |
| 622 | """Return the induced edge subgraph. |
| 623 | |
| 624 | Parameters |
| 625 | ---------- |
| 626 | e : utils.Index |
| 627 | The edges. |
| 628 | preserve_nodes : bool |
| 629 | Indicates whether to preserve all nodes or not. |
| 630 | If true, keep the nodes which have no edge connected in the subgraph; |
| 631 | If false, all nodes without edge connected to it would be removed. |
| 632 | |
| 633 | Returns |
| 634 | ------- |
| 635 | SubgraphIndex |
| 636 | The subgraph index. |
| 637 | """ |
| 638 | e_array = e.todgltensor() |
| 639 | return _CAPI_DGLGraphEdgeSubgraph(self, e_array, preserve_nodes) |
| 640 | |
| 641 | @utils.cached_member(cache="_cache", prefix="scipy_adj") |
| 642 | def adjacency_matrix_scipy(self, transpose, fmt, return_edge_ids=None): |