SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE...
Transcript of SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE...
![Page 1: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/1.jpg)
SOLVING THE FERMAT-WEBER PROBLEM
A NUMERICAL AND GEOMETRICAPPROACH
Beat Trachsler, Martin Guggisberg
SwitzerlandGeoGebra Institute of PH FHNW
23
![Page 2: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/2.jpg)
Abstract: “Given three points in a plane, find a fourth point such that the sum of its distances to the three
given points is as small as possible.” This historical problem from the 17th century was put by theFrench mathematician Fermat to the Italian physicist Torricelli. A modern formulation of thisproblem could be: “To find a best location for a power plant between three cities in such a waythat the sum of the connections between the power plant and the cities is minimal”. Torricelli
found several mathematical proofs, which can be nicely presented by GeoGebra. Ageneralization of the original problem leads to a geometric median – the problem of minimizing
the sum of weighted distances.
Finding a geometric median is an optimization problem, which has no analytical solution for morethan four points. We will present an interactive numerical solution with GeoGebra using the
Weiszfeld algorithm and the programming language Python. Our GeoGebra Materials calculatethe geometric median in real-time, this allow allows dynamic observations of the solution and the
convergence behavior of the Weiszfeld algorithm.
![Page 3: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/3.jpg)
OUTLOOK
IntroductionMathematical exploration with GeoGebraTheory around the Fermat-Weber ProblemImplementation of the Weiszfeld algorithm
![Page 4: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/4.jpg)
FERMAT'S PROBLEM FOR TORRICELLI
Given three points in a plane, find a fourth point suchthat the sum of its distances to the three given points is
as small as possible.
This historical problem was put by the Frenchmathematician Fermat to the Italian physicist Torricelli.
Dorrie, H. (1965). 100 Great problems of elementary mathematics. Dover Publications.
![Page 5: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/5.jpg)
SOME OF MANY NAMESThe long history and the interdisciplinary application
have given several names to the problem and itsvariations: the Fermat problem, the generalized Fermat
problem, the Fermat-Torricelli problem, the Steinerproblem, the generalized Steiner problem, the Steiner-Weber problem, the Weber problem, the generalizedWeber problem, the Fermat-Weber problem, the one
median problem, the median center problem, thespatial median problem, the bivariate median problem,
the minimum aggregate travel point problem
![Page 6: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/6.jpg)
MINIMIZE THE SUM OF DISTANCES
![Page 7: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/7.jpg)
MODERN FORMULATIONThe Weber problem finds the point in a plane which
minimises the sum of weighted Euclidean distances to aset of fixed points.
This is interpreted as finding the factory location whichminimises the total weighted distances from suppliers
and customers, where weights represent relativevolumes of interactions, e.g. weight of material to be
transported from a supplier, or volume of finishedproducts for a customer.
Drezner, Z., & Hamacher, H. W. (Eds.). (2004). Facility location: applications and theory. Springer.
![Page 8: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/8.jpg)
I was sixteen when I became intriguedwith the following problem involving N
points:
![Page 9: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/9.jpg)
Cosider N points and one more point,X. Measure the distances between X and
the given points, then add thedistances. Find point X so that this
sum is the smallest possible.Andrew Vázsonyi
![Page 10: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/10.jpg)
I found the point X by using aninfinite, recursive algorithm, a mostunusual solution for a problem in
geometry. You start with a point X0,anywhere, and search for a better
solution.Andrew Vázsonyi, 1937
![Page 11: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/11.jpg)
30 YEARS LATERTHE SAME PROBLEM IS CALLED
LOCATION THEORY
Suppose we have a bunch of factoriesand want to build a warehouse in a
central location so the transportationcosts are minimized.
![Page 12: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/12.jpg)
MODERN FORMULATION
Link to GeoGebra Material
Ulrich Steinmetz. (2014)
![Page 13: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/13.jpg)
MATHEMATICALEXPLORATION
![Page 14: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/14.jpg)
FOR N=3 THE ANGLE 120° CAN BEOBSERVED
![Page 15: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/15.jpg)
NO ANGLE DEPENDENCY FOR MORE THAN3 POINTS
![Page 16: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/16.jpg)
FERMAT POINT SNAP TO INTERNAL POINT
![Page 17: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/17.jpg)
THEORYAROUND THE FERMAT-WEBER PROBLEM
![Page 18: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/18.jpg)
GEOMETRIC SOLUTION FOR 3 LOCATION
Link to Geogebra Material
![Page 19: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/19.jpg)
WEISZFELDALGORITHM
by Endre Weiszfeld, alias Andrew Vázsonyi (1916–2003), born in Budapest
![Page 20: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/20.jpg)
![Page 21: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/21.jpg)
Computers have the potential to turnthe biggest math-phobe into a math
user, if not a lover.
Andrew Vázsonyi in his book:
Which Door has the Cadillac Adventures of a Real-LifeMathematician
![Page 22: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/22.jpg)
CONVERGENCE OF THE WEISZFELDALGORITHM
![Page 23: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/23.jpg)
ALGORITHMIMPLEMENTATION WITH THE
PROGRAMMING LANGUAGE PYTHON
![Page 24: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/24.jpg)
PROGRAMMING WITH PYTHON IN GEOGEOBRA (BETA)
Download Material (Geogebra 5 Beta)
![Page 25: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/25.jpg)
WEISZFELD CLASSclass Weiszfeld(object): mypoints = None text1 = None def __init__(self): ... def drawPoints(self): ... def distance(self,A, B): ... def schwerpunkt(self): ... def median_approx(self,P, points): ... def geometric_median(self,points, epsilon): ... def update(self): ...
![Page 26: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/26.jpg)
DRAW RANDOM POINTSDEFINE EVENTLISTENERS
class Weiszfeld(object): def drawPoints(self): N = int($Anz.value) xcoords = [random.uniform(3, 17) for i in range(N)] ycoords = [random.uniform(3, 10) for i in range(N)] self.mypoints = [Point(x, y,point_size=6, \ color=Color(118,175,236), label_visible=True) \ for x, y in zip(xcoords, ycoords)] ... for p in Point.all: p.onupdate=refresh ......
def refresh(self): alg.drawSchwerPunkt() alg.drawFermatPunkt()
![Page 27: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/27.jpg)
CALCULATE NEXT INTERATIONPOSITION OF FP
def median_approx(self,P, points): """ Return a new approximation to the geometric median of `points` by applying one iteration of Weiszfeld's algorithm to the old appromixation P. """ W = x = y = 0.0 for Q in points: d = self.distance(P, Q) if d != 0: w = 1.0 / d W += w x += Q[0] * w y += Q[1] * w return x / W, y / W
![Page 28: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/28.jpg)
MAIN LOOPdef geometric_median(self,points, epsilon): """ Return an approximation to the geometric median for `points`. Start with the centroid and apply Weiszfeld's algorithm until the distance between steps is less than `epsilon`. """ n = float(len(points)) P = tuple(sum(P[i] for P in points) / n for i in range(2)) while True: Q = self.median_approx(P, points) if self.distance(P, Q) < epsilon: return Q P = Q
![Page 29: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/29.jpg)
INTERACTIVE PYTHON
![Page 30: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/30.jpg)
CONCLUSION
![Page 31: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/31.jpg)
INTERACTIVE DEMO (JAVASCRIPT)GeoGebra Materials : http://www.geogebratube.org/material/show/id/66049
![Page 32: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/32.jpg)
DEMO 2GeoGebra Materials : http://www.geogebratube.org/student/m66688
![Page 33: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/33.jpg)
SUMMARYWe presented the historical fermat-weber problemThe use of GeoGebra to solve this problemA python implementation of the Weiszfeld algorithm
This presentation and all interactive material arepublished on github.
http://mgje.github.io/presentations/
![Page 34: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/34.jpg)
FINDING THE FERMAT-WEBERPOINT FOR
AMSTERDAM, BERLIN, BORDEAUX,BRUSSELS, BUDAPEST, FRANKFURT,
LONDON, LYON, MARSEILLE, MILAN,PARIS, PRAGUE, ROME, TURIN AND
VIENNA
![Page 35: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/35.jpg)
![Page 36: SOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC ... · PDF fileSOLVING THE FERMAT-WEBER PROBLEM A NUMERICAL AND GEOMETRIC APPROACH Beat Trachsler, Martin Guggisberg Switzerland](https://reader034.fdocuments.in/reader034/viewer/2022052122/5aa638717f8b9a2f048e7221/html5/thumbnails/36.jpg)
THE END
QUESTIONS ?
THANKS TO HAKIM EL HATTAB / HAKIM.SEFOR REVEAL.JS