dynetworkx.IntervalGraph.add_edges_from

IntervalGraph.add_edges_from(ebunch_to_add, **attr)

Add all the edges in ebunch_to_add.

Parameters:
  • ebunch_to_add (container of edges) – Each edge given in the container will be added to the interval graph. The edges must be given as as 4-tuples (u, v, being, end). Both begin and end must be orderable and the same type across all edges.
  • attr (keyword arguments, optional) – Edge data (or labels or objects) can be assigned using keyword arguments.

See also

add_edge()
add a single edge

Notes

Adding the same edge (with the same interval) twice has no effect but any edge data will be updated when each duplicate edge is added.

Examples

>>> G = dnx.IntervalGraph()
>>> G.add_edges_from([(1, 2, 3, 10), (2, 4, 1, 11)]) # using a list of edge tuples

Associate data to edges

>>> G.add_edges_from([(1, 2, 3, 10), (2, 4, 1, 11)], weight=3)
>>> G.add_edges_from([(3, 4, 2, 19), (1, 4, 1, 3)], label='WN2898')