sortVerticesTopologically