简体   繁体   中英

How to generate different types of graphs in Python?

I would like to generate many different connected, undirected graphs in Python. And by different, I mean sparse, dense, complete, acyclic, hamiltonian, ... graphs with different amounts for the number of nodes and possibly edges.

I have already worked with networkX and numpy libraries to generate graphs given an adjacency matrix, but this method is not useful for generating large graphs.

My purpose is to run some algorithms on many graphs and compare those algorithms to see which work better on what type of graphs (as an example, to say algorithm X works better than others on dense, acyclic graphs with more than 500 nodes).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM