Part A: two junctions that are not sites
The cheapest connection costs 17:
| Street |
Cost |
| School 0 – junction 5 |
4 |
| Clinic 1 – junction 5 |
6 |
| junction 5 – junction 4 |
3 |
| junction 4 – Pool 3 |
2 |
| Pool 3 – Library 2 |
2 |
Junctions 4 and 5 are not sites, but routing through them saves money. The tree is unique: no
other set of streets connects the four sites for 17 or less. Joining the sites by shortest paths
between them costs 20 instead: School–Pool through junction 4 (9), Pool–Library (2) and the
direct School–Clinic street (9). Its tree joins sites to sites, so it never looks for a junction
where three routes could meet.
Part B: a wheel
Put the sites on a rim around a hub junction. Every site has a street to the hub costing ,
and neighbouring sites are joined by a rim street costing , a little less than . The
shortest path between neighbouring sites is the rim street, so the shortcut builds its spanning
tree from rim streets and digs . The star through the hub costs . With
, and , that is against , a ratio of . As approaches
, the ratio approaches .
Why never worse than twice. Walk round an optimal Steiner tree, using every street twice. The
walk costs and visits every site. Between consecutive sites on the walk, the
walk is at least as long as the shortest path, so those legs give a closed tour of the sites
costing at most . Drop the longest leg and it is a spanning tree on the sites,
so the minimum spanning tree costs at most . Digging the
streets on its paths costs no more than that, since shared streets are dug once. Kou, Markowsky
and Berman's version also re-runs a spanning tree on the dug streets and prunes leaves that are
not sites. On the wheel it makes no difference.
Part C: dynamic programming over sets of sites
Let be the cost of the cheapest tree that connects the sites in and the junction
. For a single site , is the shortest distance from to . For larger
:
The answer is for any site . Process the sets in increasing
order. For each , first take every split at every , which uses only smaller sets. Then the
second option is a shortest-path problem: run Dijkstra with as the starting distances.
Record which option won at each to recover the streets.
Running time. Each pair assigns every site to , to , or to
neither, so there are at most pairs. The splits take time and the Dijkstra runs
take . For 8 sites and 60 junctions that is a few hundred thousand steps. Trying
every set of junctions would take .
Part D: why the recurrence is right
Take an optimal tree for and hang it from . Every leaf is a site in or itself,
since any other leaf could be cut off for free. If has two or more children, split the
branches at into two nonempty groups. Each group contains a site, so it is a tree for
, and the other group is a tree for , with a nonempty proper
subset. Each part is at least as expensive as of its pair, so the split option is at most the
optimum. If has one child , the tree minus the street – connects and , so it
costs at least , and the street option is at most the optimum. If is itself the only
site in , it is the base case. Both options always describe real trees, so neither can go
below the optimum. Induction on the size of the tree finishes the proof.
Going further
- Faster in . Björklund, Husfeldt, Kaski and Koivisto replaced the with for
small integer costs, using fast subset convolution. Nederlof then got the same in polynomial
space.
- Approximation. The best known approximation ratio is (Byrka,
Grandoni, Rothvoß and Sanità, by iterative randomized rounding of an LP; see
Approximation Algorithms). No ratio better than
is possible unless P = NP.
- Geometry. Between points in the plane, with any point allowed as a junction, the extra
points meet at 120°. The Euclidean Steiner tree problem has a polynomial-time approximation
scheme.
References
- S. E. Dreyfus, R. A. Wagner. The Steiner problem in graphs. Networks 1(3), 1971.
- L. Kou, G. Markowsky, L. Berman. A fast algorithm for Steiner trees. Acta Informatica 15,
1981.
- A. Björklund, T. Husfeldt, P. Kaski, M. Koivisto. Fourier meets Möbius: fast subset
convolution. Proceedings of STOC, 2007.
- J. Nederlof. Fast polynomial-space algorithms using inclusion-exclusion. Algorithmica 65(4),
2013.
- J. Byrka, F. Grandoni, T. Rothvoß, L. Sanità. Steiner tree approximation via iterative
randomized rounding. Journal of the ACM 60(1), 2013.
- M. Chlebík, J. Chlebíková. The Steiner tree problem on graphs: inapproximability results.
Theoretical Computer Science 406(3), 2008.