Graph.edges

Graph.edges(data=False)[source]

Iterate over the edges of the graph.

Parameters:
databool, optional

If True, yield the edge attributes in addition to the edge identifiers.

Yields:
tuple[hashable, hashable] | tuple[tuple[hashable, hashable], dict[str, Any]]

If data is False, the next edge identifier (u, v). If data is True, the next edge identifier and its attributes as a ((u, v), attr) tuple.