P-Isomorphisms for Graphs