Graph.has_edge

Graph.has_edge(u, v, directed=True)[source]

Verify if the network contains a specific edge.

Parameters
  • u (hashable) – The identifier of the first node of the edge.

  • v (hashable) – The identifier of the second node of the edge.

  • directed (bool, optional) – If True, the direction of the edge is taken into account.

Returns

bool – True if the edge is present, False otherwise.