First time here? Check out the FAQ!
answered 2 years ago
Try this:
len(set.union(*(set(G.neighbors(v)) for v in V)))
where V is the subset of vertices of G.
V
G
updated 2 years ago
where V is the a given subset of vertices of G.