I wonder why initial max is not zero. If every nodes have the same coordinates, actual min/max edge length is zero. But this line causes the max being nonzero. Of course, such a case is geometrically invalid. but anyway edge length should be correctly calculated.