FIXED: break loop in graph_degree if diagonal already found