Ask Your Question
1

constructing random connected graph

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

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
2

answered 2017-10-01 19:12:43 +0100

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

Comments

Thanks for reply

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

Stats

Asked: 2017-10-01 17:58:31 +0100

Seen: 704 times

Last updated: Oct 01 '17