Consistency between ordering and clustering methods for graphs