dgl.DGLGraph.has_edge_between

DGLGraph.has_edge_between(u, v)

Return True if the edge (u, v) is in the graph.

Parameters:
  • u (int) – The source node ID.
  • v (int) – The destination node ID.
Returns:

True if the edge is in the graph, False otherwise.

Return type:

bool

Examples

>>> G = dgl.DGLGraph()
>>> G.add_nodes(3)
>>> G.add_edge(0, 1)
>>> G.has_edge_between(0, 1)
True
>>> G.has_edge_between(1, 0)
False