An undirected simple graph G is called compact iff its adjacency matrix A is such that the polytope S(A) of doubly stochastic matrices X which commute with A has integral-valued extremal points only. The paper shows that the isomorphism problem for compact graphs is polynomial. Furthermore, it proves that if a graph G is compact, then a certain naive polynomial heuristic applied to G and any partner G' decides correctly whether G and G' are isomorphic or not. In the last section some compactness preserving operations on graphs is discussed.