amplab / graphx

Former GraphX development repository. GraphX has been merged into Apache Spark; please submit pull requests there.

Home Page:https://github.com/apache/spark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Function to remove vertex/edge

peroksid90 opened this issue · comments

Add functions to remove simple vertex or edge.

Is Graph.subgraph the operation you're looking for?

Graph.subgraph fit for me. But i thought this was slowly in case like this:

pseudo-code:
n=100000;
con_comp_under_attack = [];
while(n) {
remove simple vertex from graph
con_comp_under_attack.append( count the number of vertices on largest connected components)
n--
}

Oh, I see. Yes, the current implementation of subgraph is inefficient for point removals, since it rebuilds the routing table (requiring a shuffle) and constructs new edge partitions as well.

I have a pull request (apache/spark#497) that avoids the shuffle, but it still rebuilds the edge partitions. However, we plan to add a bitmask to the edges to avoid needing to rebuild them in cases like this.

Unfortunately, the best you can currently do is to apply this pull request and continue to use subgraph, since there's no other way to remove vertices at the moment.

Thank you very much.