Remove vertices without edges

Hi Guys!

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

Best,

Alex

attachment.html (440 Bytes)

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 <ahobe(a)student.ethz.ch>:

attachment.html (1.33 KB)

Hi Giuseppe

Thanks for the help.

Best,

Alex

attachment.html (2.29 KB)