Ask Your Question
1

Tree database

asked 2021-12-08 19:14:25 +0200

bobby gravatar image

I am interested in finding all trees with at most 5 vertices with a certain property. Is there any database for trees in SAGEMATH?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-12-09 17:48:46 +0200

slelievre gravatar image

Sage provides a way to use Nauty which specialises in graph enumeration.

A tree on 5 vertices is a connected graph on 5 vertices with 4 edges.

So we can get a list of them as follows:

sage: tt  = [t for t in graphs.nauty_geng('5 4:4 -c')]

Then we can explore them one by one.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-12-08 19:14:25 +0200

Seen: 29 times

Last updated: Dec 09 '21