Remove multiple edges in an igraph for python

I have a problem removing multiple edges in an igraph using Python.
I tried this but it doesn't work:

for e in g.es:
    if e.is_multiple() is True:
        g.es.delete(e)

      

I even tried

for e in g.es:
    if e.is_multiple() is True:
        helptuple = e.tuple
        source = helptuple[0]
        target = helptuple[1]
        eid = g.get_eid(source, target)
        g.delete_edges(eid)

      

Is there any other solution?

+3


source to share





All Articles