Ask Your Question

constructing random connected graph

asked 2017-10-01 10:58:31 -0600

Kuldeep gravatar image

How one can construct all possible simple connected graphs on a given number of vertices?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-10-01 12:12:43 -0600

tmonteil gravatar image

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.

edit flag offensive delete link more


Thanks for reply

Kuldeep gravatar imageKuldeep ( 2017-10-01 12:40:35 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2017-10-01 10:58:31 -0600

Seen: 133 times

Last updated: Oct 01 '17