The adjacency matrix representation of the trees may not have been the most efficient for long term storage of the trees. In retrospect, an adjacency list based approach might have been more economical.
Our generation for special trees leaves little to be desired; it is hard to see how it could be much more efficient. Generation of general trees is rather brute force, and it is conceivable that a more intelligent algorithm might be able to perform more efficiently.
The labeling of the special trees is much easier than the general case, and its algorithm is linear on the order of the tree. Determining whether or not a tree is special also seem to be linear, so inserting the special case into a general labeling algorithm would make a general labeling algorithm slightly faster. The general case seems to be fairly efficient for a large number of the trees, and an interesting further investigation would examine just how many of the trees cause significant difficulties for the algorithm presented. Perhaps it is the case that the difficult trees share some property that, like the special trees, show some simpler labeling algorithm.