Lesson
The theory — Minimum Spanning Tree: Kruskal and Prim
A spanning tree of a set of points is a set of roads that connects every point to every other and contains no loop; on n points it always has n − 1 roads. The minimum spanning tree is the spanning tree with the smallest total length. A cut splits the points into two groups, and a road crosses the cut when its two ends are in different groups. A Steiner tree may also use junctions that are not among the points.
What each symbol means
n- the number of points
w(u, v)- the length of the straight road from u to v, in km
S- the points on one side of a cut; in Prim's algorithm, the network built so far
- Assumes
- Roads are straight and cost their length, and any two points may be joined. When no two distances are equal the minimum spanning tree is unique. With ties, as in the triangle and the square, several trees can share the shortest length and the two algorithms may pick different ones.
Problem solved in full
-
Two junctions for a square 4 steps
Where do the junctions go, and how long is the road? Press Four towns on a square: towns at the corners of a 40 km square, a 120.00 km spanning tree, and 109.28 km with junctions. Find that length exactly, and test the guess most people make first, an X through the centre.
-
Where three roads meet at a junction of a shortest network, they meet at 120°. If they did not, the three unit vectors pointing along them would not cancel, and moving the junction in the direction of their sum would shorten the total.
-
Put both junctions on the line through the middle of the square, each serving the two corners nearest it, with a middle road between them. Each spoke meets the middle road at 120°, so it runs at 60° to that road's line. It has to cover 20 km sideways, half the side, so its length is 20/sin 60° and it reaches 20/tan 60° along the road's direction.
-
Four spokes, and a middle road made of whatever the two spokes leave of the 40 km.
-
The X: four roads from the corners to the centre, each half a diagonal, 20√2 km.
Answer
40(1 + √3) = 109.28 km, with each junction 11.55 km in from the side it serves; the X is 113.14 km. The X beats the spanning tree but loses to the junctions, because its roads meet at 90° rather than 120°. There are two networks of exactly this length, the one on the page and the same one turned through 90°. The saving is 1 − (1 + √3)/3 = 8.93%, less than the triangle's 13.40%.
-
Learning path
Why an algorithm is correct
References (3)
- Borůvka's 1926 solution, the first, for the electricity network of southern Moravia, and his statement of the problem for points whose mutual distances are different, both quoted in insight 1: Jaroslav Nešetřil, Eva Milková and Helena Nešetřilová, "Otakar Borůvka on minimum spanning tree problem: Translation of both the 1926 papers, comments, history." Discrete Mathematics 233(1-3), 2001, pp. 3-36. DOI 10.1016/S0012-365X(00)00224-7
- The status of the Gilbert–Pollak conjecture after Du and Hwang's 1990 proof, quoted in insight 3: A. O. Ivanov and A. A. Tuzhilin, "The Steiner Ratio Gilbert–Pollak Conjecture Is Still Open: Clarification Statement." Algorithmica 62(1-2), 2012, pp. 630-632. DOI 10.1007/s00453-011-9508-3
- That the conjecture is still listed as open, and its statement: the planar Steiner ratio is reached on the equilateral triangle, √3/2: Yana Teplitskaya, "Open problems on Steiner trees and maximal distance minimizers." arXiv:2511.18217 [math], November 2025, §2.2.