Shapes & spaces

Euclidean Steiner minimal tree calculator from planar terminal points

Construct a shortest planar terminal network with freely positioned Steiner junctions and a checked numerical primal/dual gap.

Your numbers

One row per point or face; use zero-based indices where requested.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Construct a shortest planar terminal network with freely positioned Steiner junctions and a checked numerical primal/dual gap.

THE FORMULAmin over Steiner locations and full tree topologies Σ_edges ||x_u−x_v||₂.

A worked example

For terminals (0,0), (1,0), (0,1), the junction is approximately (0.2113248654,0.2113248654), giving length 1.9318516526 instead of terminal-only MST length 2.

Good to know

3–5 distinct planar terminals. Complete full binary topologies, including collapsed-edge degeneracies; convex coordinate minimization and projected edge-flow lower bounds. Only results with a small global numerical gap are returned. Floating diagnostics, not outward-rounded proof; unresolved degeneracies may be rejected.

Allowing new junctions

A minimum spanning tree connects supplied terminals using edges whose endpoints are all terminals. A Euclidean Steiner tree can introduce additional junctions at new planar locations. Those extra junctions may reduce total straight-line length. The task therefore optimizes both the network topology and some vertex coordinates, rather than selecting edges from a fixed weighted graph.

Distances here are ordinary Euclidean distances in a flat plane. There are no obstacles, terrain costs or road corridors. A segment may pass through another part of the drawing without acquiring a junction unless the returned graph explicitly contains one. For a physical network, additional routing, capacity and installation constraints can substantially change the optimum.

Euclidean Steiner minimal tree calculator from planar terminal points worked exampleJunction ≈ (0.2113, 0.2113)Three angles = 120°Length ≈ 1.931852
Scroll across to see the full diagram.
For terminals (0,0), (1,0), (0,1), the junction is approximately (0.2113248654,0.2113248654), giving length 1.9318516526 instead of terminal-only MST length 2.

Compare this with the Minimum Steiner forest calculator for undirected terminal pairs. Allow newly located spatial junctions to shorten a straight-line network, rather than select edges from a pre-existing graph.

What the terminal input means

Supply three through five distinct coordinate pairs in a consistent distance unit. The same unit appears in the total network length and junction coordinates. Translation changes the displayed coordinates but not the length; multiplying every coordinate by a positive scale multiplies all lengths by that scale. These are useful sanity checks for a copied dataset.

Terminals stay fixed throughout the optimization. The internal Steiner locations can move and may coincide in a degenerate solution. The output keeps the terminals first and adds junctions afterward, with edges referring to that returned vertex list. A zero-length edge in a limiting topology is not an extra physical cable that contributes positive length.

Topologies before coordinates

For a nondegenerate planar minimum, an interior Steiner point has degree three and the incident edges meet at 120 degrees. A full topology connects n terminal leaves with n−2 such internal vertices. The solver enumerates the bounded set of these binary topologies. Degenerate optima can be represented by allowing some internal edges to collapse.

Once one topology is fixed, the sum of Euclidean edge lengths is a convex function of the free vertex coordinates. The implementation repeatedly replaces an internal point by the geometric median of its three neighbors. This local update decreases that convex objective, but a small coordinate change alone is not accepted as evidence of global optimality.

Why the lower bound matters

For each topology, unit-bounded edge flows with zero net flow at free junctions give a dual lower bound on every feasible network of that topology. The solver projects candidate flows onto the internal balance equations and rescales them to meet the norm constraints. It then compares the best constructed length with lower bounds across every enumerated topology.

This comparison can reveal a stalled coordinate iteration or an unresolved collapsed junction. If the overall gap remains too large, no minimum is returned. The displayed gap uses floating arithmetic and residual checks; it is not a formally rounded interval certificate. It is stronger evidence than convergence alone, while retaining that practical numerical limitation.

The right-triangle example

With terminals at (0,0), (1,0) and (0,1), all triangle angles are below 120 degrees. A single interior junction joins the three terminals at equal 120-degree angles. Its two coordinates are approximately 0.2113248654, and summing the three segment lengths gives approximately 1.9318516526. The terminal-only spanning tree has length two.

The saving is modest but geometrically meaningful: it comes from permitting a new shared junction, not from rounding distances. If a terminal angle reaches or exceeds 120 degrees, the optimum for three terminals instead uses that terminal as the junction. A successful calculation should respect this change of branch rather than force an interior three-way point.

Interpreting the result table

Total length is the best feasible construction found across the complete bounded topology list. The global lower bound is the smallest valid topology lower bound, since any topology could in principle win. Their difference measures the unresolved optimization gap. Individual topology rows show why a candidate with a slightly larger constructed length can still need attention.

Inspect the edge list together with the returned coordinates. The table is not a sequence in which cables must be installed, and vertex numbering has no geometric importance. Different symmetric optima can have the same length. A tiny reconstruction or balance residual also should not be converted into a claim about the accuracy of measured terminal locations.

Where this model stops

A narrow input cap is intentional: exhaustive topology comparison grows quickly, and a browser should not disguise an incomplete search as a shortest network. Some nearly degenerate point configurations are conservatively rejected when their lower bounds do not close. This is an unresolved numerical case, not proof that a Steiner tree fails to exist.

Use a graph Steiner solver when only entered graph edges are permitted. Use an ordinary minimum spanning tree when junctions must be existing terminals. Use this page when new planar junctions and direct Euclidean links are part of the model. Keeping those three feasible-network definitions separate makes the comparison of network lengths meaningful.

A few questions, answered

How is this different from a minimum spanning tree?

Steiner junctions may be newly located points. An ordinary terminal-only spanning tree cannot use those extra junctions.

Must every junction have three positive-length edges?

Nondegenerate Steiner junctions do, but degenerate topologies may contain coincident vertices or zero-length edges.

Does the displayed gap include coordinate measurement error?

No. It measures the numerical optimization gap for the supplied coordinates, not uncertainty in those coordinates.

What does an unresolved gap mean?

The implemented construction and lower bounds did not agree closely enough. It is not proof that a shortest network does not exist.

Find your calculator

Start typing to explore the library.