Ask Your Question
1

Working with unlabelled graphs

asked 3 years ago

oldani gravatar image

I'm studying certain properties of graphs but I want to work with unlabelled ones i.e. I do not want to distinguish graphs that differs only by the numbering of vertices, which is the case by default if I have correctly understood. Is it possible?

Thanks

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
0

answered 3 years ago

Max Alekseyev gravatar image

updated 3 years ago

It's unclear what do you mean under "distinguish". If it's about creation/generation of unlabeled graphs, then many graph construction methods produce unlabeled (di)graphs. If it's about comparison of unlabeled graphs, then this can be done via comparison of their canonical labels (.canonical_label()). So, example of what you want to achieve would be helpful.

Preview: (hide)
link
0

answered 3 years ago

slelievre gravatar image

Nauty has a generator of graphs up to isomorphism.

Sage has an interface to it.

See the nauty_geng function:

Preview: (hide)
link

Comments

Graphs have the method is_isomorphic : G1.is_isomorphic(G2) is True if G2 is a relabelling of G1. I am not aware of a built-in way to designate the equivalence classes thus defined :however, my knowledge of (this part of) Sage is quite superficial.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 3 years ago )

Canonical representatives of the equivalence classes are produced by .canonical_label().

Max Alekseyev gravatar imageMax Alekseyev ( 3 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: 3 years ago

Seen: 836 times

Last updated: Sep 15 '21