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.
Asked: 2017-10-01 10:58:31 -0600
Seen: 133 times
Last updated: Oct 01 '17