Hi,
Unfortunately the combine_edges... argument of simplify() can only treat
attributes independently of each other -- the underlying C core is not prepared
for the scenario that you mentioned. However, you could simply use a custom
function that merges the individual attributes into a list, so your collapsed
edges would have lists containing the original values for each edge attribute,
and then you could postprocess the edges one by one.
> Also, please point me to a place where combine_edges is used with a
> custom function in an example.
def combinator(values):
return list(values)
g = Graph([(0,1), (1,2), (1,2), (1,2)])
g.es["weight"] = [1,2,3,4]
g.simplify(combine_edges=combinator)
print(g.get_edgelist())
print(g.es["weight"])
--
T.
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help