Graph.add_edge

Graph.add_edge(u, v, attr_dict=None, **kwattr)[source]

Add an edge and specify its attributes.

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

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

  • attr_dict (dict[str, Any], optional) – A dictionary of edge attributes.

  • **kwattr (dict[str, Any], optional) – A dictionary of additional attributes compiled of remaining named arguments.

Returns

tuple[hashable, hashable] – The identifiers of the edge nodes.

Examples

>>>