| 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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.