I have an igraph network g where all edges' weights are 1 and where all vertices belong to on of 5 groups (noted with a vertex parameter called "group").
Now I want to make a new graph G where the vertices of g are collapsed, ore contracted, according to the group they belong to. So that the number of vertices of G is reduced to the number of different groups in g, and the edges between these new collapsed vertices have a weight equal to the summed up number of edges between the same groups in g.
I believe I could use contract_vertices(). But the edges' weights wouldn't be added, I'm guessing... Anyway, is there a way to accomplish this in igraph?
Thanks!