igraph: how to use add_edges when there are attributes?

user1919878 picture user1919878 · Dec 20, 2012 · Viewed 7.8k times · Source

What if I need to create a graph in igraph and add a bunch of edges, but the edges have associated attributes? It looks like .add_edges can only take a list of edges without attributes, so I've been adding them one by one with .add_edge

Answer

Kush Jain picture Kush Jain · Dec 4, 2013
graph.add_edge('A','B',weight = 20)

Here A and B are names of nodes