Let $E=\{-1,0,1\}$ and $M$ be a set of lattice points in the plane. The points in $M$ are connected by a network of line segments (S) such that one can travel from any point in $M$ to any other point in $M$ without leaving (S). The line segments of the network can have endpoints other than the lattice points.
Determine the shortest total length of the network of line segments, if:
a) $M=\{(i, j) \mid i, j \in E$ and $i \cdot j=0\}$
b) $M=\{(i, j) \mid i, j \in E\}$
Part a): Due to symmetry, it initially suffices to find the optimal network of segments for the points \(O(0,0)\), \(A(1,0)\), and \(C(0,1)\). By reflecting at \(O\), one then obtains the desired network for the points in \(M\). By rotating the plane \(x O y\) around \(O\) by an angle of \(60^\circ\) (Fig. 1), the triangle \(\triangle O A C\) is transformed into the triangle \(\triangle O A' C'\), where the segment \(P'C'\) is the image of \(PC\). The shortest system of segments that connects the points \(O\), \(A\), and \(C\) as required has a total length equal to that of the segment \(A C'\).
![](https://cdn.mathpix.com/cropped/2024_12_05_292672805a3405b19b02g-1.jpg?height=361&width=617&top_left_y=2361&top_left_x=1185)

Fig. 1

In the triangle \(\triangle OAC'\), however, \(AC' = \sqrt{2 - 2 \cos 150^\circ} = \sqrt{2 + \sqrt{3}}\) (by the Law of Cosines). By reflecting at the origin \(O\), one obtains a shortest system of segments for part a) with a total length of \(2 \sqrt{2 + \sqrt{3}} = \sqrt{2} + \sqrt{6}\).

Part b): Similarly, due to symmetry, it initially suffices to find the shortest system of segments for the points \(D(-1 \mid 1)\), \(O(0 \mid 0)\), \(A(1 \mid 0)\), \(B(1 \mid 1)\), and \(C(0 \mid 1)\). Since the distance from \(D\) to the other four points is at least 1, such a system has a total length of \(1 + \frac{\sqrt{2} + \sqrt{6}}{\sqrt{2}} = 1 + 1 + \sqrt{3} = 2 + \sqrt{3}\) (see Fig. 2).
![](https://cdn.mathpix.com/cropped/2024_12_05_292672805a3405b19b02g-2.jpg?height=420&width=498&top_left_y=681&top_left_x=322)

Fig. 2

Thus, 
(after reflecting at \(0\)) for part b) a total length of \(2(2 + \sqrt{3}) = 4 + 2 \sqrt{3}\) is obtained.
Remark: The point \(P\) from part a) is the Fermat point of the triangle \(\triangle OAC\); the sum of its distances to the vertices \(O\), \(A\), and \(C\) is minimal. Every triangle in which no angle is greater than or equal to \(120^\circ\) contains such a point in its interior. However, if, for example, in a triangle \(\triangle ABC\), \(\alpha \geq 120^\circ\), then \(AB + AC\) is minimal. These properties were likely first discovered by Evangelista Torricelli (1608 - 1647) and further investigated by Pierre Fermat (1601 - 1665).