cugraph icon indicating copy to clipboard operation
cugraph copied to clipboard

[FEA] API to reverse edges for a Graph

Open VibhuJawa opened this issue 3 years ago • 4 comments
trafficstars

Describe the solution you'd like and any additional context

I would like an API to reverse edges for a directed cugraph.Graph . This can probably follow the reverse API in networrkx. https://networkx.org/documentation/stable/reference/classes/generated/networkx.DiGraph.reverse.html

Additional Context:

When running sampling on a subgraph for DGL we can have two directions in and out . For in/incoming direction we need to reverse the subgraph and an API to do this will help us to cleanly use extracted_subgraph API for PG and reverse it.

See below for expected usage : https://github.com/rapidsai/cugraph/blob/3e99193f91549cf2af6961e7d1a2968f1cf0de6e/python/cugraph/cugraph/gnn/graph_store.py#L258-L271

VibhuJawa avatar Jul 28 '22 01:07 VibhuJawa

There is a transpose function in the C++ API that will do this efficiently, it is supported by SG and MG.

What we haven't done is discuss what the API should look like from a python perspective.

ChuckHastings avatar Jul 28 '22 19:07 ChuckHastings