Natural Sciences and Mathematics, The Richard Stockton College of New Jersey, Pomona, NJ 08240, USA
Abstract
We completely solve the generalized Fermat problem: given a triangle P1, P2, P3 and
three positive numbers λ1, λ2, λ3, find a point P for which the sum λ1P1P+λ2P2P+λ3P3P
is minimal. We show that the point always exists and is unique, and indicate necessary
and sufficient conditions for the point to lie inside the triangle. We provide geometric
interpretations of the conditions and briefly indicate a connection with dynamical systems.
1. Introduction
Pierre Fermat (1601–1665) formulated the following
problem:
Given a triangle
, find a point
such that the sum of the three distances from
to the vertices
be minimal.
In the literature, one can find various beautiful ways
to solve the problem (see, e.g., [1–4]). In short, the
answer is as follows. If every angle of
measures less
than
, then the point
in the interior of the triangle such that
minimizes the
sum of the three distances. If one of the angles of
measures
or more, then the vertex corresponding to this angle minimizes the sum of the three distances to the vertices.
An important application is the shortest network problem, used in the construction of telephone, pipeline, and roadway networks; see for example [5].
In this paper, we consider a weighted Fermat triangle
problem:
Given a
triangle
and given three positive numbers
,
,
, find a point
on the triangle such that the weighted sum of the distances to the three vertices
be the least possible.
A possible application is the problem of constructing
a consumer center servicing three given cities in such a way as to minimize the
total distance to all three, but also making the distance to a given city inversely proportional to the population of that city. As we found out after working out a solution, this problem had been previously formulated by
Greenberg and Robertello in 1965 [6] as the three factory problem and solved using trigonometry; two subsequent papers by van de Lindt [7] and Tong and Chua [8] offered geometric solutions. There is also a higher-dimensional generalization in [9]. However, we think our approach is still of interest, firstly, because of the
geometric connections explored throughout the paper, and secondly because of its accessibility. Except possibly for the last section, the paper can be understood by students who have completed the calculus sequence.
Using calculus, we obtain necessary and sufficient
conditions for
to attain its
absolute minimum in the interior of the triangle
. We show uniqueness of such minimizing point, and present an elegant geometric construction of this point.
In the event that the absolute minimum of
does not occur
in the interior of the triangle, we show that one and only one vertex of the
triangle minimizes this sum, and we locate that vertex.
In the last section, we briefly show a connection
between the Fermat problem and a gradient dynamical system.
2. Existence of a Minimum inside the Triangle
Assuming our plane has Cartesian coordinates
, let
have coordinates
,
, and let
have
coordinates
. Call
the distance
between
and
,
(see Figure 1).
Then, the problem is to minimize the function
(2.1)
This function is continuous on the whole plane
, so it must attain an absolute minimum on the closed
triangle
.
Let us find the gradient of
. First of all, we have
(2.2)and therefore,
(2.3)
If
, then
itself is
differentiable, in which case we have
(2.4)
It follows that
(2.5)
Similarly, we get
(2.6)
Therefore, the gradient
of
is equal to
(2.7)
Let us call
(2.8)
This is a unit vector, defined for every
,
.
Getting back to our function
, we conclude that
is
differentiable on the open domain
(2.9)
and its gradient is equal to
(2.10)
Let us see when
can have
stationary points.
Lemma 2.1.
A necessary
condition for
to be zero (at
some point in
) is that
(2.11)
(Geometrically, this means that we can construct a
nondegenerate triangle with sides
,
,
.)
Indeed,
is equivalent
to
. This, in turn, means that the polygonal curve with
sides
,
,
must be a
triangle; see Figures 2 and 3.
Moreover, in
our case the triangle cannot be degenerate, since this would imply that the
three vectors
,
,
are parallel,
which is impossible, for the points
,
,
do not lie on
one line.
Since
, and
are unit
vectors, this triangle has sides
,
,
,
so these three numbers must satisfy the triangle inequalities (2.11).
Lemma 2.2.
If
at some
, then at this point one has
(2.12)
Indeed, if
, then at
we have
(2.13)
Let us dot multiply this equality successively by
,
, and
. Recalling that
, we get
(2.14)
To simplify matters, let us call for a moment
(2.15)
Then, the previous system looks like
(2.16)
Let us multiply the first equation by
, the second by
, and subtract the second from the first:
(2.17)
This can be rewritten as
(2.18)
Let us adjoin to this equation the last equation in
(2.16), previously multiplied by
:
(2.19)
Adding both equations in this system, and solving for
, we get
(2.20)
Similarly one gets
(2.21)
Our result follows if we recall the notation (2.15).
Geometric Interpretation of Equalities (2.12)
Assume that conditions (2.11) hold, so that we can construct the triangle in
Figure 3. Call
the angle
opposite to the side
in this
triangle (see Figure 4).
Then, for example,
(2.22)
(recall that the
are unit
vectors), and the first equality in (2.12) follows from the law of the cosine. The
other two equalities in (2.12) have analogous geometric interpretations.
Lemma 2.3.
If
lies on one of
the sides of the triangle
, but does not coincide with one of the vertices, then
.
Indeed, assume, for example, that
lies on the
side
(see Figure 5).
Then
and
are parallel.
Moreover, the vectors
and
are linearly
independent, and at least the second one is nonzero. Therefore,
(2.23)
Lemma 2.4.
If
lies outside
the triangle
, then
.
Indeed, if
lies outside
this triangle, then it must lie on one of the half-planes whose boundary is the
line joining two vertices, which does not contain the third vertex. Assume, for
example, that
lies on the
half-plane with the boundary through
which does not
contain
(see Figures 6
and 7).
Then, if we draw the vectors
,
, and
starting at a
common origin
, all three will lie on the same half-plane with
boundary being the line parallel to
passing through
. Since all three vectors are nonzero, so is their sum
(2.24)
The gradient
does not exist
at the vertices of the triangle. However, we can compute one-sided directional
derivatives at these points.
Let us start by analyzing the behavior of
near the
singular point
. Let us fix an arbitrary unit vector
and a nonzero
number
. Then,
(2.25)
Therefore,
(2.26)
Let us denote
by
the angle of
the triangle
at
, where
(see Figure 8).
Lemma 2.5.
If
(2.27)
then the absolute minimum of the function
given by (2.1) on
the triangle
is not attained at
.
To show this, let us compute the one-sided directional
derivative
. Now, only the first term of
, that is,
, is not differentiable at
; for the other two terms, we can compute the
directional derivative in the usual way. Therefore, we have
(2.28)
The smallest value of this derivative will happen when
is parallel to
the vector
and has the
opposite direction. For such
we get
(2.29)
Let us denote
(2.30)
these are unit vectors directed along the sides
and
, respectively, as shown in Figure 9. With this
notation, we have
(2.31)
Notice that the vector
we have chosen,
directed opposite to
, points towards the interior of the triangle
.
If this derivative is negative, this means that when
we move from
in the
direction of
, the function
will decrease,
so that
cannot be a
minimum. For this derivative to be negative, we must have
(2.32)
or
(2.33)
or still
(2.34)
This implies that
(2.35)
Finally, notice that
(see Figure 9).
In a totally similar way, one can prove that if
(2.36)
then the absolute minimum
on
cannot be
attained at
, and if
(2.37)
then the absolute minimum
on
cannot be
attained at
.
Each of conditions (2.27), (2.36), (2.37) implies the corresponding
one in (2.11) (condition (2.27) implies the first one, etc.). Indeed, assume, for
example, that (2.27) holds. Then, since
, we have
(2.38)This is equivalent to
(2.39)or
(2.40)Since all
are positive,
this in turn is equivalent to
(2.41)
The other two inequalities are proved in a similar
way.
Hence, if (2.27), (2.36), (2.37) hold, we can construct a nondegenerate triangle with sides
,
,
, as in Figure 4. Calling, as before,
the angle
opposite to
on this
triangle, and recalling that the cosine function decreases on
, we can rewrite conditions (2.27), (2.36), (2.37) in the following
very natural way:
(2.42)Lemma 2.6. Conditions
(2.27), (2.36), (2.37) are necessary for the existence of the absolute minimum of
in the interior
of the triangle
.
Indeed, assume, for example, that
(2.43)Pick any point
in the interior
of the triangle
(see Figure 10).
Then the angle
is strictly
bigger than
. Therefore,
(2.44)and our assumption implies that
(2.45)
Then, we cannot have
at this point,
for otherwise we would get a contradiction with the second equality in
(2.12).
Theorem 2.7.
The function
attains its
absolute minimum in the interior of the triangle
if, and only
if, conditions (2.27), (2.36), (2.37) hold, or, equivalently, if conditions (2.42) hold.
Indeed, we know, by Lemma 2.6, that these conditions are
necessary. Conversely, assume that the conditions hold.
Consider a circle
, with center anywhere on the triangle, and with a
radius
so large that
the whole triangle lies in its interior and, moreover, on the boundary of
the minimum of
is larger than,
say,
. (This can be achieved because
tends to
infinity as
tends to
infinity in any direction.)
Now, the continuous function
must attain a minimum
on the compact set
. By our choice of
, this minimum is not on the boundary of
. Further, by Lemma 2.5 and the remark following it,
this minimum is not attained on either vertex
. Since these are the only singular points of
, it follows that the minimum must occur at a point
inside
at which
. (This also proves that the gradient must vanish somewhere.) By Lemma 2.4, we
conclude that the minimum must lie on the triangle
(vertices
excepted). Therefore, by Lemma 2.3, the minimum must lie in the interior of the
triangle
, at a point for which
.
3. Uniqueness of the Minimum
As in the classical case, the function
attains its
absolute minimum value exactly at one point.
Theorem 3.1.
Assume that
conditions (2.27), (2.36), (2.37) hold. Then
attains its
absolute minimum value in the interior of the triangle
at exactly one
point.
We already know, by Theorem 2.7, that
attains its
minimum at some point
inside the
triangle
.
Arguing by contradiction, assume that the minimum is
also attained at some other point
inside the
triangle. Then
must lie on one
of the triangles
,
, or
(possibly on
one of the sides
). Assume that
lies on
as in Figure 11.
Since we have both
and
, by Lemma 2.2 we must have
(3.1)
On the other hand, we have
(3.2)
But
is strictly
bigger than
, so we must have
, a contradiction.
4. Construction of the Interior Minimizing Point
Let us assume that conditions (2.27), (2.36), (2.37), or,
equivalently, conditions (2.42), are satisfied. Then, by Theorem 2.7, there is a
point
at which the
function
attains its
minimum; moreover,
lies in the
interior of the triangle
. Also, by Theorem 3.1, this point is unique.
To actually find the point, we can use a construction
inspired by the one for the classical case (see, e.g., [4]).
Taking
as one of the
sides, let us construct a triangle
, as in Figure 12, which is similar to the triangle in
Figure 4, with sides
,
,
. Moreover, let us choose the angles so that the angle
at
is
, the angle at
is
, and the angle at
is
. Further, let us draw the circumcircle to this
triangle, and let
be its center.
The arc
of this circle
spans the angle
, so the complementary arc will span
.
Similarly, let us construct
, also similar to the triangle with sides
,
,
, as in Figure 12, so that the angle at
is
, the angle at
is
, and the angle at
is
. Let us also draw the circumcircle to
, and let
be its center.
Now, the formula for the radius of the circumscribed
circle (see, e.g., [1], page 13),
applied to the triangle
, yields
(4.1)
Applying the same result to the triangle
, we obtain
(4.2)
We conclude that
(4.3)
Hence, the isosceles triangles
and
are similar. Therefore,
the angle
is equal to the
angle
. Hence,
(4.4)Now, by our assumption (2.42),
, whence
. This guarantees that, firstly, the two circles are
not tangent, and secondly, the other point
of intersection
of these circles, besides
, will occur inside the triangle
. Indeed, from our construction it follows that
and
. Consequently,
(4.5)
which is less than
, so
cannot lie
below the line
.
We claim that
is the desired
minimizing point.
Indeed, geometrically, the fact that
,
, and
guarantees that
at
one can arrange
the vectors
as in Figure 4,
and therefore,
(4.6)that is, 
Here is an algebraic proof of the same fact. At
, we have
(4.7)
Now, by the cosine law,
(4.8)so the above expression simplifies to
(4.9)Now we add and subtract
and apply the
cosine law twice again:
(4.10)Note. As for
the classical case, it is not hard to show that actually the points
,
, and
lie on the same
line, and so do the points
,
, and
; this provides another geometric way of constructing the minimizing point
; see [8].
Moreover, generalizing the situation in the classical case, one can see that
and
, where
is the minimum
of our function
(attained at the
point
we just
constructed).
5. Degenerate Cases
Case 1.
When one of the triangle inequalities (2.11) fails to
hold then, by Lemma 2.1, the absolute minimum cannot occur in
, so it must happen at one of the vertices of our
triangle
.
Assume, for example, that
(5.1)
Then, we claim that the minimum is attained at
.
Indeed, we have
(5.2)
By the triangle inequality, applied to
, we have
. Therefore, the last expression is strictly greater
than
(5.3)
This shows that
. One shows analogously that
.
The other two possibilities of failure of (2.11) are
discussed analogously; this leads to the following result.
Theorem 5.1.
If
, then the absolute minimum of
is attained at
and only at
. Similarly, if
, the minimum is attained at
, and if
, the minimum is attained at
.
Case 2.
Assume now that the triangle inequalities (2.11) hold,
but one of the conditions (2.42) fails to hold. We claim that only one of these conditions can fail.
Indeed, if we had, say, both
(5.4)then we would have both
(5.5)Adding up, we would get
(5.6)
which is impossible, since
and
. So, only one of the inequalities in (2.42) can fail to
hold.
If we have, for example,
(5.7)
then we will have both
and
. This implies, by Lemma 2.5, the remark following it,
and Theorem 2.7, that the minimum must be attained at
.
The other two possibilities of failure of (2.11) are
discussed similarly. The following result summarizes our discussion.
Theorem 5.2.
If
conditions (2.11) hold and
then the
absolute minimum of
is attained at
. Similarly, if
then the
minimum is attained at
, and if
the minimum is
attained at
.
6. The Classical Case
The classical Fermat triangle problem happens when
(6.1)
Then, the triangles in Figures 3 and 4 are
equilateral, and therefore
(6.2)Also, all the right-hand sides in (2.12) are equal to
. Conditions (2.42) become
(6.3)
From here one can easily deduce the classical result
stated in the introduction, especially as discussed in [3].
7. The Fermat Gradient System
Assume conditions (2.42) hold. As we observed before, the gradient (2.10) of the weighted distance sum
given by (2.1) is
defined in all of
. Since the function
has a global
minimum at the optimal point
, the trajectories in
of the gradient
system
(7.1)
will converge to the asymptotically stable equilibrium
. This follows immediately from the fact that
is a global
Lyapunov function for the system on
(see,
e.g., [10, Section 9.3]). Moreover, the trajectories of (7.1) are
orthogonal to the level curves of the weighted sum
. Figure 13 illustrates the situation for a more
or less randomly chosen triangle, for the classical Fermat problem, when all the
weights
coincide. We
have depicted the direction field of the gradient system plus several
trajectories. The closed lines are the level curves of
.
Several intriguing questions arise. For example, when
the triangle is equilateral, a single level curve will be tangent to all three
sides as shown in Figure 14.
In general, under which condition(s) is there a level
curve simultaneously tangent to two sides? To all three sides? For a generic triangle, and for the generalized Fermat problem, is it always possible to pick the weights
so that a
single level curve of
will be tangent
to all three sides?
References
- H. S. M. Coxeter, Introduction to Geometry, John Wiley & Sons, New York, NY, USA, 2nd edition, 1980.
- R. Courant and H. Robbins, What is Mathematics?, Oxford University Press, New York, NY, USA, 1969.
- F. Eriksson, “The Fermat-torricelli problem once more,” The Mathematical Gazette, vol. 81, no. 490, pp. 37–44, 1997.
- R. Honsberger, Mathematical Gems. From Elementary Combinatorics, Number
Theory, and Geometry, The Dolciani Mathematical Expositions, no. 1, The Mathematical Association of America, Buffalo, NY, USA, 1973.
- M. W. Bern and R. L. Graham, “The shortest-network problem,” Scientific American, vol. 260, no. 1, pp. 84–89, 1989.
- I. Greenberg and R. A. Robertello, “The three factory problem,” Mathematics Magazine, vol. 38, pp. 67–72, 1965.
- W. J. van de Lindt, “A geometrical solution of the three factory problem,” Mathematics Magazine, vol. 39, no. 3, pp. 162–165, 1966.
- J. Tong and Y. S. Chua, “The generalized Fermat's point,” Mathematics Magazine, vol. 68, no. 3, pp. 214–215, 1995.
- H. W. Kuhn, ““Steiner's” problem revisited,” in Studies in Optimization, G. B. Dantzig and B. C. Eaves, Eds., vol. 10, pp. 52–70, The Mathematical Association of America, Washington, DC, USA, 1974.
- M. W. Hirsch, S. Smale, and R. L. Devaney, Differential Equations, Dynamical Systems, and an Introduction to Chaos, vol. 60 of Pure and Applied Mathematics, Elsevier/Academic Press, Amsterdam, The Netherlands, 2nd edition, 2004.