在图G中添加一个星,在图G中添加一个星。
中的第一个节点 nodes_for_star 是星星的中心。它连接到所有其他节点。
nodes_for_star
网络X图表
节点的容器。
要添加到星形中每条边的属性。
参见
add_path
add_cycle
实例
>>> G = nx.Graph() >>> nx.add_star(G, [0, 1, 2, 3]) >>> nx.add_star(G, [10, 11, 12], weight=2)