MCPcopy
hub / github.com/dmlc/dgl / edge_subgraph

Method edge_subgraph

python/dgl/graph_index.py:621–639  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers 15

remove_edgesMethod · 0.45
apply_edgesMethod · 0.45
node_subgraphFunction · 0.45
edge_subgraphFunction · 0.45
test_pickling_subgraphFunction · 0.45
test_edge_subgraphFunction · 0.45
test_subgraph_maskFunction · 0.45
test_subgraph1Function · 0.45
test_uva_subgraphFunction · 0.45
test_subgraph_maskFunction · 0.45
test_subgraphFunction · 0.45
test_set_batch_infoFunction · 0.45

Calls 1

todgltensorMethod · 0.80

Tested by 11

test_pickling_subgraphFunction · 0.36
test_edge_subgraphFunction · 0.36
test_subgraph_maskFunction · 0.36
test_subgraph1Function · 0.36
test_uva_subgraphFunction · 0.36
test_subgraph_maskFunction · 0.36
test_subgraphFunction · 0.36
test_set_batch_infoFunction · 0.36
check_dist_graphFunction · 0.36
check_dist_graph_heteroFunction · 0.36