compute graph edit distance and combine figures