Ask Your Question

constructing random connected graph

asked 2017-10-01 17:58:31 +0200

rewi 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 19:12:43 +0200

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

rewi gravatar imagerewi ( 2017-10-01 19:40:35 +0200 )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 17:58:31 +0200

Seen: 412 times

Last updated: Oct 01 '17