Algorithms for approximate graph matching