0

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).

1 Answer 1

1

Well, you should take a look at the docs: https://networkx.github.io/documentation/networkx-1.10/reference/generators.html#graph-generators.

Sign up to request clarification or add additional context in comments.

2 Comments

I actually have checked it but it generates only some special graphs, not any random graph. Thanks
did you look at the section random graphs?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.