[英]Delete multiple edges in igraph for Python
我在使用 Python 删除 igraph 中的多个边时遇到问题。
我试过这个,但它不起作用:
for e in g.es:
if e.is_multiple() is True:
g.es.delete(e)
我什至试过
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)
还有其他解决方案吗?
尝试这个:
def simplify(multiple=True, loops=True, combine_edges=None):
它是来自 API 的函数。
multiple -> 是否删除多条边。
在这里阅读更多:
https://igraph.org/python/doc/api/igraph._igraph.GraphBase.html#simplify
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.