cleanup graph edit distance algorithm.