ibbly.com

Drawing trees

March 2010 (index)

The author of this post on Reddit drew all 551 unlabeled trees of order 12 by hand. I thought I'd try to do it using a program.

The end results is here.

It's using an existing list of all the trees which contains data like "0 8 0 9 1 8 1 10 2 9 2 11 3 10 4 11 5 11 6 11 7 11" (a list of edges for one tree). I use a force-directed algorithm to find a nice layout for each tree, then use PIL to draw them.


ibbly.com contact