python – igraph:为什么add_edge函数如此缓慢地对add_edges?

python – igraph:为什么add_edge函数如此缓慢地对add_edges?

我很惊讶: import igraphimport random, timestart_time = time.time()G = igraph.Graph(directed = True)G.add_vertices(10000)for i in range(30000): G.add_edge(random.randint(0,9999), random.randint(0,9