maximum_spanning_tree networkx has no attribute

℡╲_俬逩灬. 提交于 2019-12-13 15:47:11

问题


I am trying to find maximum spanning tree of a network using networkx python module. According to documentation specified[link below], nx.maximum_spanning_tree(G) should do this work. But i am getting error

  File "air_traffic_network_base.py", line 65, in <module>
    max_spanning_tree = nx.maximum_spanning_tree(net)
AttributeError: 'module' object has no attribute 'maximum_spanning_tree'

Here is the code snippet:

net = nx.read_weighted_edgelist(graph_file)
min_spanning_tree = nx.minimum_spanning_tree(net) #no error
max_spanning_tree = nx.maximum_spanning_tree(net) #error here

Documentation: http://networkx.readthedocs.org/en/latest/reference/generated/networkx.algorithms.tree.mst.maximum_spanning_tree.html

Networkx version (nx.__version__):
1.10

I believe i am using latest networkx python module.(minimum_spanning_tree function call works without any error).

Please help.

来源:https://stackoverflow.com/questions/33962090/maximum-spanning-tree-networkx-has-no-attribute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!