import networkx as net
import matplotlib.pyplot as plt
if __name__ == "__main__":
N = int(input('网络节点个数N: '))
K = int(input('K值: '))
P = float(input('重连概率P:'))
world = net.watts_strogatz_graph(N, K, P)
ps = net.circular_layout(world)
net.draw(world, ps, with_labels=False, node_size=10)
plt.show()