Here we use a simple greedy strategy, for the vertexes sharing a common father, the most frequent common unit is extracted as new vertex.
speeding up feature extraction is critical especially when large template set is used for high accuracy.