igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] prunning vertices


From: Matteo Fortini
Subject: Re: [igraph] prunning vertices
Date: Fri, 16 Jan 2015 14:41:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi,
to delete vertices with degree==0 use

g.delete_vertices(g.vs(_degree=0))

and you could also do

g.delete_vertices(g.vs(name_notin=set(hashtags)))

Note that set() helps a lot to speed up the lookup.

Il 16/01/2015 14:30, Ahmed Abdeen Hamed ha scritto:
Good morning,

I need to prune vertices in a graph based on a certain criteria (not in a given list). When doing so, this leaves isolated vertices, which I also like to remove. But when doing do, delete_vertices() does not remove all vertices with degree == 0. I am not sure why this is happening. 

I am attaching the script and the data that I am using so you can see the issue.

Thanks very much,

-Ahmed



_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help


reply via email to

[Prev in Thread] Current Thread [Next in Thread]