Hi Giuseppe

Thanks for the help.

Best,

Alex

________________________________
From: graph-tool [[email protected]] on behalf of Giuseppe Profiti 
[[email protected]]
Sent: Monday, March 20, 2017 14:19
To: Main discussion list for the graph-tool project
Subject: Re: [graph-tool] Remove vertices without edges

Hi Ales,
personally I would use a filter, exploiting the methods in_degree() and 
out_degree().
I.e. something like

gv = GraphView(g,vfilt=lambda x: x.in_degree()+x.out_degree()>0)

If your graph is undirected, you can use only out_degree(). I strongly advise 
you to read the documentation, there i splenty of information there.

Best,
Giuseppe


2017-03-20 14:08 GMT+01:00 Hobé Alex 
<[email protected]<mailto:[email protected]>>:
Hi Guys!

What is the best way to remove vertices that do not have any edges?

Best,

Alex

_______________________________________________
graph-tool mailing list
[email protected]<mailto:[email protected]>
https://lists.skewed.de/mailman/listinfo/graph-tool


_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to