Typically my professor asks that we draw them all, but I would like to save some time to confirm how many I need.
[Math] How to tell how many non-isomorphic unrooted trees with 6 edges exists without drawing them all
discrete mathematicsgraph theorygraph-isomorphismtrees
Best Answer
You can use
geng
which is packaged with nauty.Trees with 6 edges have 7 vertices, and any connected 7-vertex graph with 6 edges must be a tree. So we call geng to generate the 7-vertex connected (
-c
) graphs with 6 edges. The-u
means to count them.If you want the graphs themselves, we can redirect the output to a file
then use
showg
to print the adjacency lists:Here's the output: