graph structure check