1. A method of determining sub-tree similarity for component substitution, the method carried out by program code stored on non-transient computer-readable medium and executed by a processor, the method comprising: assigning a similarity metric to a plurality of trees stored in computer-readable media; constructing a distance matrix in computer-readable media, the distance being between sub-trees; and correlating sub-trees in the computer-readable media based on the distance matrix.