COmbine edges of the same type to one edge and save the number of such
interactions as an attribute.