compareTo method is added for Edges