cugraph icon indicating copy to clipboard operation
cugraph copied to clipboard

Add other means for handling duplicate edges in remove_multi_edges

Open ChuckHastings opened this issue 1 year ago • 0 comments

#4054 adds a mechanism to the remove_multi_edges function to "decide" which edge weight to keep when edge weights are present in the edge list (and potentially different). By default remove_multi_edges will arbitrarily pick them. The PR adds the option to pick the smallest edge weight. This can be important in an undirected graph, since we will store the edge in each direction it some algorithms will be negatively impacted if the weight in one direction is different than the weight in the opposite direction.

But the notion of picking the smallest edge weight is, in itself, an arbitrary choice. We should consider other criteria for modifying the edges. Some reasonable examples,

  1. largest edge weight
  2. sum the edge weights
  3. average the edge weights

Additionally, we're talking about weights, but we support arbitrary edge properties within the cugraph framework (currently we explicitly support edge weight, edge id and edge type for some algorithms).

One could imagine creating a functor that would allow the user to customize exactly how to reduce a list of edges with edge properties to a single edge with edge properties.

ChuckHastings avatar Dec 12 '23 19:12 ChuckHastings