1 | initial version |
Try this:
len(set.union(*(set(G.neighbors(v)) for v in V)))
where V
is the subset of vertices of G
.
2 | No.2 Revision |
Try this:
len(set.union(*(set(G.neighbors(v)) for v in V)))
where V
is the a given subset of vertices of G
.