Ask Your Question

Revision history [back]

click to hide/show revision 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.

Try this:

len(set.union(*(set(G.neighbors(v)) for v in V)))

where V is the a given subset of vertices of G.