R igraph convert parallel edges to weight attribute
问题 I'm working with igraph for R. My graph is based on an edgelist which includes parallel edges (more than one edge with the same source and target). I would like to convert these parallel edges to an edge attribute weight. Is there an eay way to do this? If there is no easy way. how can I identify these parallel edges? duplicated(E(net)) does not return a single duplicate. I suppose its looking for duplicated edge ids. 回答1: You can also use E(graph)$weight <- 1 followed by simplify(graph, edge