MCPcopy Index your code
hub / github.com/dmlc/dgl / test_no_backtracking

Function test_no_backtracking

tests/python/common/transforms/test_transform.py:186–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184
185
186def test_no_backtracking():
187 N = 5
188 G = dgl.from_networkx(nx.star_graph(N))
189 L = G.line_graph(backtracking=False)
190 assert L.num_nodes() == 2 * N
191 for i in range(1, N):
192 e1 = G.edge_ids(0, i)
193 e2 = G.edge_ids(i, 0)
194 assert not L.has_edges_between(e1, e2)
195 assert not L.has_edges_between(e2, e1)
196
197
198# reverse graph related

Callers

nothing calls this directly

Calls 4

line_graphMethod · 0.80
num_nodesMethod · 0.45
edge_idsMethod · 0.45
has_edges_betweenMethod · 0.45

Tested by

no test coverage detected