fixed isomorphic_graph() method