Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function to remove vertex/edge #140

Closed
peroksid90 opened this issue May 2, 2014 · 4 comments
Closed

Function to remove vertex/edge #140

peroksid90 opened this issue May 2, 2014 · 4 comments

Comments

@peroksid90
Copy link

Add functions to remove simple vertex or edge.

@ankurdave
Copy link
Member

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

@peroksid90
Copy link
Author

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--
}

@ankurdave
Copy link
Member

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.

@peroksid90
Copy link
Author

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants