rapidsai / cugraph

cuGraph - RAPIDS Graph Analytics Library
https://docs.rapids.ai/api/cugraph/stable/
Apache License 2.0
1.73k stars 304 forks source link

[FEA] API to reverse edges for a Graph #2458

Open VibhuJawa opened 2 years ago

VibhuJawa commented 2 years ago

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

ChuckHastings commented 2 years ago

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 commented 5 months ago

@rlratzel @alexbarghi-nv - we should discuss this. I believe all of the necessary functionality exists in the C++ layer. I think we need to look at what we'd like the python layer to do here. This probably crosses both cugraph python and GNN logic.

alexbarghi-nv commented 5 months ago

Yeah, I think we need to revisit this. It doesn't really make sense with the new API I'm working on for DGL. For now we can deprioritize it.

alexbarghi-nv commented 5 months ago

Also this issue mentions the property graph object which we abandoned as a backend a long time ago.