First time here? Check out the FAQ!

Ask Your Question
1

constructing random connected graph

asked 7 years ago

rewi gravatar image

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

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 7 years ago

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.

Preview: (hide)
link

Comments

Thanks for reply

rewi gravatar imagerewi ( 7 years ago )

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: 7 years ago

Seen: 811 times

Last updated: Oct 01 '17