public double DistanceFrom(Point point) { double distance1 = TSP.distance(this.p1, point); double distance2 = TSP.distance(this.p2, point); return(distance1 + distance2 - this.length); }
public TSPEdge(Point point1, Point point2) { this.p1 = point1; this.p2 = point2; this.length = TSP.distance(p1, p2); }