constructing random connected graph
How one can construct all possible simple connected graphs on a given number of vertices?
add a comment
How one can construct all possible simple connected graphs on a given number of vertices?
You can use graphs.nauty_geng
, for example, if you want to iterate over all connected graphs of length 7, you can do:
sage: gen = graphs.nauty_geng("7 -c")
sage: for g in gen:
....: do some stuff with g
See graphs.nauty_geng?
for more details.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2017-10-01 17:58:31 +0100
Seen: 665 times
Last updated: Oct 01 '17