Edge sorting for initialization (coloring only; to be integrated in init_properties)