A randomized heuristic for scene recognition by graph matching