dynetworkx.ImpulseGraph.add_edges_from¶
-
ImpulseGraph.
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 3-tuples (u, v, t). Timestamp 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 timestamp) twice has no effect but any edge data will be updated when each duplicate edge is added.
Examples
>>> G = dnx.ImpulseGraph() >>> G.add_edges_from([(1, 2, 10), (2, 4, 11)]) # using a list of edge tuples
Associate data to edges
>>> G.add_edges_from([(1, 2, 10), (2, 4, 11)], weight=3) >>> G.add_edges_from([(3, 4, 19), (1, 4, 3)], label='WN2898')