Isomorphism of P 3 -graphs