Abstract

We completely solve the generalized Fermat problem: given a triangle , , and three positive numbers , , , find a point for which the sum 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., [14]). 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

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 haveand therefore, If , then itself is differentiable, in which case we have It follows that Similarly, we get Therefore, the gradient of is equal to Let us call This is a unit vector, defined for every , .

Getting back to our function , we conclude that is differentiable on the open domain and its gradient is equal to Let us see when can have stationary points.

Lemma 2.1. A necessary condition for to be zero (at some point in ) is that
(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
Indeed, if , then at we have
Let us dot multiply this equality successively by , , and . Recalling that , we getTo simplify matters, let us call for a moment Then, the previous system looks like Let us multiply the first equation by , the second by , and subtract the second from the first: This can be rewritten as Let us adjoin to this equation the last equation in (2.16), previously multiplied by :Adding both equations in this system, and solving for , we get Similarly one gets 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, (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,

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

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,

Therefore,

Let us denote by the angle of the triangle at , where (see Figure 8).

Lemma 2.5. Ifthen 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 haveThe smallest value of this derivative will happen when is parallel to the vector and has the opposite direction. For such we get Let us denote these are unit vectors directed along the sides and , respectively, as shown in Figure 9. With this notation, we have
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 haveoror stillThis implies thatFinally, notice that (see Figure 9).

In a totally similar way, one can prove that if then the absolute minimum on cannot be attained at , and if 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 haveThis is equivalent to orSince all are positive, this in turn is equivalent to 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: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, thatPick any point in the interior of the triangle (see Figure 10).
Then the angle is strictly bigger than . Therefore,and our assumption implies that 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 On the other hand, we have 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 Applying the same result to the triangle , we obtain We conclude that Hence, the isosceles triangles and are similar. Therefore, the angle is equal to the angle . Hence,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, 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, that is,

Here is an algebraic proof of the same fact. At , we have Now, by the cosine law, so the above expression simplifies toNow we add and subtract and apply the cosine law twice again: 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 Then, we claim that the minimum is attained at .

Indeed, we have By the triangle inequality, applied to , we have . Therefore, the last expression is strictly greater than 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, boththen we would have bothAdding up, we would get which is impossible, since and . So, only one of the inequalities in (2.42) can fail to hold.
If we have, for example, 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 Then, the triangles in Figures 3 and 4 are equilateral, and thereforeAlso, all the right-hand sides in (2.12) are equal to . Conditions (2.42) become 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 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?