MultiDiGraph.__len__#
- MultiDiGraph.__len__()#
返回图中节点的数量。用法:'len(G)'。
- 返回:
- nnodesint
图中节点的数量。
另请参阅
number_of_nodes
等价方法
order
等价方法
示例
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc >>> len(G) 4
返回图中节点的数量。用法:'len(G)'。
图中节点的数量。
另请参阅
number_of_nodes
等价方法
order
等价方法
示例
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> len(G)
4