## 1 Introduction

It is hard to track back the history involving lab experiments and theoretical knowledge. Regarding soap films the first documented results are due to the physicist J. Plateau in the 19th century [18]. Among others he worked with wire structures dipped in soapy water and described the resulting films as area-minimising surfaces, which characterises local equilibrium states.

Many of such equilibrium states are found in Nature. For instance, in [17] the authors show the importance of these surfaces in crystallography, and a still incomplete geometrical classification of crystal structures was later given in [14]. See a further contribution to this classification in [8].

Also there are theories of Steiner trees that arose from soap film experiments. Take two parallel plates connected by pins and dip them into soapy water. The resulting film adjusts to an equilibrium state constituted by strips that together connect all of the pins. When looked from above and perpendicularly to the plates, the film represents a graph whose edges and vertices are the strips and their meetings, respectively.

Some of the meetings occur at the pins, and the film turns into a tree up to flicking some of the strips. In the nomenclature of [12] we then get a relatively minimal tree, and also a Steiner tree providing the pins have negligible thickness. It is known that such a tree is an equilibrium state and therefore a local minimum of total length. See [9] for nice discussion and pictures, three of which are reproduced in Fig. 1.

Of course, it is not always feasible to resort to lab experiments. For arbitrary number and position of pins one would have to spend hours in each case just to observe the resulting Steiner trees. Physical experiments in virtual environment are therefore much easier to perform, and this is one of the objectives of our present paper. Here we consider ideal pins of zero thickness but treat other particularities. For instance, when the plates are dipped the configuration of the film will depend on the manner in which they are removed from the soapy water, and later we shall explain how to customise this procedure with our program.

In our setting the pins belong to the vertices of a tree , and each edge works as a film strip. However, for any given our program also seeks the weighted Steiner minimal as defined in [6, Sect.2]. There the authors prove that any such is a Steiner tree, which only coincides with the Steiner minimal tree in very special cases (for instance, when all weights are equal).

Now we are going to use the abbreviations summarised in Table 1 for the sake of concision:

Name | Initials |
---|---|

Steiner Tree | ST |

Minimal Spanning Tree | MST |

Steiner Minimal Tree | SMT |

Weighted Minimal Spanning Tree | WMST |

Weighted Steiner Minimal Tree | WSMT |

Our program runs with the Surface Evolver [4], which is a general-purpose simulator. With Evolver physical experiments can be performed in a completely virtual environment, and one can easily add complexity to the model, or even adapt it for further developments. Firstly introduced in 1989, now Evolver’s most recent version is 2.70 [4] with several applications in many Areas of Knowledge like Aerodynamics [3], Fluid Dynamics [5, 7, 19] and Medicine [10]. Furthermore, Evolver is endowed with several built-in energy minimisation routines which enable saving a lot of programming by just invoking them. Hence we were able to implement our program with only 183 lines of source code. This makes both adaptation and maintenance much easier, as we shall explain in the last section.

This work is organised as follows: Sect. 2 gives some basic notations, definitions and results used throughout the paper. Sect. 3

shows quite simple examples that are however essential to understand our strategies. Of course, any heuristic has limitations and ours are discussed in Sect.

4. Then Sect. 5 is devoted to explaining our method, which in fact consists not only of the Evolver script but also includes a short graphical input and a preprocessing written in MATLAB/Octave. Finally we show our results and draw conclusions in Sects. 6 and 7, respectively.## 2 Preliminaries

###### Definition 1.

Consider a graph in with a weight function and 0-1 adjacency matrix . The weighted total length of is

(1) |

where is the connection cost between and , and is their Euclidean distance. For the non-weighted case we write instead of in (1).

As showed in [6], when is embedded in we can reduce as follows: for each adjacent pair that forms a triangle we take its Euclidean Steiner point , , , and . Hence with strict inequality when , and this process can be repeated at most times according to [12, §3.4]. This setting was presented in [6] together with a practical application of the following:

###### Definition 2.

Let be a tree in Definition 1 with as a global minimum. Namely, there is no other graph connecting its vertices that can reduce . In this case we say that is a WSMT.

Notice that we could have as shown in Fig. 2, in which case is called inherent Steiner point.

As explained in the Introduction our simulation reproduces the physical experiment of getting a soap film after dipping two parallel plates connected by pins in soapy water. Immediately after the plates are taken out the film detaches from an initial configuration in which the pins behave as the vertices of a plane graph , and each edge works as a film strip connecting two pins. The detachment from this initial configuration will result in another plane graph where and the elements of are called (non-inherent) Steiner points. Notice that one might flick some strips for to become a tree.

Detachment is due to a physical phenomenon called Marangoni effect. The forces at a vertex are each parallel to its corresponding incident edge. The intensity of such a force does not depend on the edge length, and therefore we can study the local behaviour at a pin by truncating all of its incident strips to the same length (see Fig. 3(a)). We refer the reader to [15] for more details about the Marangoni effect.

Hence corresponds to a local minimum of surface tension, which is directly proportional to . The following proposition gives the geometrical equivalence of this physical fact (see Fig. 3(b) for an illustration):

###### Proposition 1.

Let be a plane tree and take such that deg. Hence can be reduced if and only if has two adjacent edges that make an angle less than .

###### Proof.

Place a Euclidean coordinate system with origin and the bisector of the two adjacent edges. Up to re-scaling the shortest edge measures 1 and it makes an angle with . Fig. 3(b) shows that the initial length 2 turns out to be , where . By the law of cosines we compute as

Hence . Notice that is positive for . Since then is also increasing for . ∎

If then this local minimum is the nearest to . We get the following result:

###### Corollary 1.

The soap film starts detaching from the most acute angles of each , all less than .

###### Proof.

In the demonstration of Proposition 1 we saw that , hence the smaller the faster decreases to . ∎

As we have mentioned at the Introduction the detachment of a soap film from pins is a physical phenomenon that can be performed in a completely virtual environment, and we chose the Surface Evolver for this purpose. Of course, our program considers not only Corollary 1 but also further results that we shall present in the next sections.

Because of Proposition 1

up to flicking the odd small film strip of

one gets an ST that we call . Even if is not an SMT a suitable weight function in Definition 2 will turn it into a WSMT. Conversely, any WSMT in the metric (1) is an ST (see [6] for details).Given a set of terminals and , in order to find a WSMT that minimises (1) we resort to the following strategy: first compute the WMST of by an adaptation of Prim’s algorithm and get an initial tree , then use Evolver to add and detach vertices from according to Proposition 1. As we shall see in the next section this heuristic leads to a that will not always be a WSMT. However, if the Gilbert-Pollak conjecture were also valid for weighted trees then a WSMT could be at most shorter than the WMST, for any set , and then our heuristic would still give a tree close to the true WSMT in total length.

But we shall see in Sects. 5 and 6 that the Steiner ratio does not apply to our case. Anyway, whenever the actual WMST and the plane WMST are still close in length the proposed heuristic can be taken as a satisfactory approach to the actual WSMT. Otherwise we content ourselves with its purpose of reproducing a lab experiment.

## 3 Background

Let denote the standard complex plane with real and imaginary axes as vertical and horizontal, respectively. The points and are the vertices of an equilateral triangle whose group of symmetries is generated by reflection in and 120-rotation around . For consider the group orbit . This orbit has six points indicated with bullets in any item of Fig. 4.

Let us start with , for instance . Now enumerate the elements of as , , so that Fig. 4(a) shows their corresponding MST with counterclockwise. We call it but for this set of terminals it is Fig. 4(b) that depicts their SMT, which we call .

Their total lengths are and , respectively. Hence and are both SMTs for , illustrated in Figs. 4(c,d). Now remains the SMT until becomes a regular hexagon at . For neither is an SMT but Fig. 4(f) shows it in dotted line, and now its total length is . For we can take the MST , whose total length is but just before collapses at .

We must also consider that the soap film will not always reach an equilibrium state by just detaching from an initial configuration. This is indeed the first step but afterwards some Steiner points can collide, so that the film will change its topology and then keep on moving towards an equilibrium state. Fig. 5(a) shows the WSMT for the vertices , , , of a rectangle where and , . The weight function is given by and .

Since the WMST is , though either or stand for the MST. Hence the soap film detaches from , as depicted in Fig. 5(b). But in our setting , and therefore it is Fig. 5(c) that shows the WSMT, which is also the SMT.

Of course, the soap film in Fig. 5(b) will change to the one in Fig. 5(c) if we softly blow in the direction of . Our algorithm considers theses changes under the following:

###### Assumption 1.

Let be the detachment from , in which there exists , with for at least three segments . Then is not the WSMT and so its topology must be changed in order to reduce .

The upper bound is attained in Fig. 5(a). Notice the similarity between Result [12, §8.4] and Assumption 1, and also that we have a sufficient but not necessary condition. As an example, will cease to be an SMT in Fig. 4(d) for but there we have until .

Evolver seeks for minimisation, hence as a first step we are going to have in Fig. 5(b) for any . But the case is comprised by Assumption 1 and therefore we do not need to implement changes of topology by collision of Steiner points separately.

In Assumption 1 we stated “at least three segments” because of the following example: suppose were much closer to in Fig. 5(b) so that by keeping the same topology. Now softly blowing against will make this latter collide with , and the new topology is depicted in Fig. 6(a). According to our convention will take the same value as , and therefore we reduce .

This would not work if we had stated “at least two segments”, as illustrated in Fig. 6(b). There the segment is tilted clockwise by an imperceptible angle of , which Evolver automatically does with its g-command (see [4] for details). A possible improvement in Assumption 1 could be about the position of these two segments: take , , sufficiently close to , and . Then Figs. 6(c,d) depict the WMST in dotted line, so that can be reduced by the same “blowing” if we use the given weights. However, with consider that and change to and , respectively. Then first detaches with weight , then afterwards with weight . In this case Fig. 6(d) still leads to a reduction in but not as expressive as for .

Namely, the sequence of detachment should be swapped, which in practice changes the way the plates are taken out from the soapy water. However, it is pointless to strengthen Assumption 1 since we have no formal proof of its formulation yet. Therefore, in this present version we have decided to skip this improvement, which searches for a WSMT, and content ourselves with reproducing the physical experiment with less intervention of blowing to reduce the total length of the soap film.

The next two sections explain that we always work with plane graphs. The reader could be curious about the algorithm giving a WSMT with intersections, so that they should be further treated. For instance, suppose we could attribute weights to the bullets in Fig. 7 such that the resulting WMST is marked there in black with the detachments in blue.

However, according to our tests apparently there is no function in Definition 1 that produces a WMST as in Fig. 7. Furthermore, in Sect. 6 we discuss several tests with our algorithm, for arbitrary random number and position of vertices with random , and curiously no intersections ever occur to the heuristic WSMT. Therefore we consider:

###### Assumption 2.

The heuristic WSMT obtained through our method is always plane.

## 4 Limitations of the Heuristic

Our algorithm aims at reproducing a physical experiment and also direct it in order to find the WSMT for certain weights attributed to a set of vertices. In Sect. 5 we shall explain how the user can enter points according to a sequence that will determine the way the plates are removed from the soap solution. This can also be defined by weights but one can give priority to finding the WSMT, which is the main purpose of our algorithm. The sought after soap film with the same configuration will in general need some intervention as explained in Sects. 2 and 3.

There we saw that is a regular hexagon for , and is also the SMT with . Small variations in can drastically change the topology of the SMT. For instance, if is rotated inwards by we get and as depicted in Figs. 8(a,b), respectively. There we have and , so that is still the SMT. Our method is based on detachment of Steiner points from an initial configuration, and in this example we see that it works. But here of course the heuristic fails for .

Another limitation is that our algorithm is sequential, whereas slidings and detachments as in Figs. 2 and 3

(b) all occur simultaneously, and also together with the action of taking out the plates from the soapy water. In particular, when this is done two film strips never cross at any moment.

Our program uses a preprocessing that gives a plane WMST, while the real WMST does allow crossings as we shall see in Sect.5. By turning such crossings into Steiner points the resulting heuristical WSMT would surely be shorter than the one obtained from the plane WMST. But according to our analysis the cost of implementing this approach is too high for little benefit, even if considering that the Gilbert-Pollak conjecture does not hold for the weighted case.

## 5 Method

Now we explain our method with an example. The first part consists in giving a set of points with coordinates inside the square , and each will have an integer weight . Hence the user must re-scale points to that range and render them either graphically or by means of a datafile. After invoking Octave type wmst at the prompt and you will get the message

Please adjust terminal window to show full picture.

Give a filename to open or press Enter to choose points.

A graphical window appears by pressing the Enter key, and wherever you hover the mouse cursor a coordinate pair can be marked by hitting any character key. The corresponding weight is given by its ASCII number minus 48. Then the character keys 1 to 9 really mean these numbers as weights, whereas other keys will give weights up to 77 (for the character #125 = }). Either mouse button or characters under #49 are all set to , and non-integer weights must be edited in datafile. Namely, you can save your weighted points and change them manually afterwards. Please see https://theasciicode.com.ar for the ASCII numbers.

The Enter key terminates your graphical input and readily gives the plane WMST, though the actual tree is in general non-embedded. Fig 9(a) shows the set of terminals in sample.txt, which you can also input to our program (without the extension txt). The total weighted length is for that WMST. Intuitively speaking, Steiner points should replace intersections but these can happen in various ways: multiple at different and same points, between a vertex and an inner point of an edge, etc. Treating all these cases geometrically will increase computational cost for little use because any heuristic already has limitations. In our present version we chose to get , the plane WMST, by allowing a greater connection cost. Namely, our adaptation of Prim’s algorithm looks for edges of lowest cost that do not intersect the already existing ones. In our example Fig. 9(b) shows with and total Euclidean length (if we change the weight function to ). There some angles are marked in red and magenta for the longer and shorter sides, respectively. These will start the sliding process depicted in Fig 2.

The Octave program wmst will store the plane WMST in the Evolver file st.fe, and now we must invoke it at the shell prompt by typing evolver h, where h stands for heuristic. Its first step is depicted in Fig 9(b), and from that point on each vertex with acutest angle is checked to see whether . If so, then either or is an intrinsic Steiner point, and the red side is replaced with the missing edge of . This process is repeated until exhausting the number of intrinsic Steiner points. Figs. 10(a,b) show the first and last iterations, respectively.

In this example the sliding has not started from the most acute angle in Fig. 9(b). As explained in Sect. 4 the soap film configuration will always depend on the way the plates are removed from the soapy water. Actually vertices are checked in the order they were entered by the user.

The next step is to detach Steiner points according to Sect. 2. In practice this happens simultaneously with the sliding process but our approach is sequential. Fig. 11(a) show the first iteration of detachment, and there we left the replaced edges in cyan for visualisation. The last iteration is shown in Fig. 11(b), where we marked in red the segments to see whether they satisfy the hypothesis of Assumption 1. Finally in Fig. 12 we see the last steps to get the soap film.

Fig. 12(b) shows , our heuristic WSMT, in black and also in cyan for comparisons. The program gives and , with ratios and , namely both below .

However, Fig. 12(b) illustrates our program when it stops at a tolerance of 2.2% regarding the theoretical 120. Namely, in an ideal ST adjacent edges must always make an angle of at least 120 but the closer we want to approach it the longer becomes the computational time. Fig. 13(a) shows that there is little change when we set the tolerance to 1.1% but now jumps to 3775.8 (all other values remain the same).

The reason for this jump is explained by the blue segments in Fig. 13(a) and part of Fig. 9(a) zoomed in Fig. 13(b). One of the Steiner points in Fig. 12(b) now collided with a terminal that weighs 59, hence what was a local weighted connection of approximately now becomes . Their difference of 679.25 is 95.7% the actual rise of 710.2 in (do not forget that nearby segments also changed and one Steiner point collapsed to a terminal). Notice that this rise is a significant 23.2%.

The next section is devoted to some tests and comparisons performed with our algorithm.

## 6 Results

As already explained in Sect. 5 our preprocessing with MATLAB/Octave obtains the plane WMST for a given set of vertices, and we gave an example in Fig. 9. Indeed, if we improve our heuristic by working with the actual WMST this will increase the complexity of the algorithm for very little gain.

But Sect. 3 shows an example for which intersections could happen in the heuristic WSMT, so that a postprocessing would then be necessary. However, in Computational Geometry we can perform tests in order to introduce assumptions under which the algorithm is implemented. This is very important because otherwise we take the risk of elaborating additional source code in vain.

As commented on Fig. 7 our tests have never shown a WMST as depicted there, and some of the outputs are shown in Fig. 14.

That is why we introduced Assumption 2, which one fine day will be either proved or disproved, and in this last case we shall complete what is missing in the algorithm. If the reader is willing to check some outputs of the preprocessing that generated Fig. 14, here is the code in Fig. 15. Notice that its actual algorithm has only 15 lines, whereas the rest just stands for initialisation and formatting. Several pictures, say 12, come by simply entering the command for count=1:12 test;end at the prompt.

Of course, we shall be grateful to whoever forwards us some clue about either Assumption 2 or 1, which was also submitted to tests but here we shall omit them for the sake of concision.

Now we draw some comparisons with GeoSteiner [20]

, which dates back from 1997 and had its most recent version 5.1 launched in 2017. To the best of our knowledge GeoSteiner is the only exact and open-source algorithm to find non-weighted Steiner minimal trees. At

http://www.geosteiner.comthe reader can download its C-code, instructions and manual. However, it heavily uses Linear Programming methods and they are known to be fast only for random distributions. For instance, poor convergence of the Simplex Method is given by the classical Klee-Minty cube

[16, 13]. That is why GeoSteiner will converge very slowly if with elements that form a pattern.For tests our platform is 7GB of RAM, 960G of HD, microprocessor Intel Core i5 2.5GHz, and operating system Linux Ubuntu 16.04. With this setting GeoSteiner takes 68.84s to generate Fig. 16(a). By choosing adequate weights for as shown in Fig. 16(b) we get , the heuristic WSMT in 0.01367s.

Though Fig. 16(c) shows a WSMT our program also outputs the Euclidean total length , which is the minimum as printed by GeoSteiner. By the way, our program also gives , and , both with ratios above .

## 7 Conclusion

It is known that Steiner trees can also be treated in 3d, for instance to minimise costs of underground mining [2], and also in the periodic approach to model crystalline and molecular connections [1]. But 2d Steiner trees cannot be doubly periodic, only quasi-periodic instead. For instance, Fig. 17(a) shows a generator taken from https://people.eng.unimelb.edu.au/brazil, and it consists of copies of two fundamental sub-trees: with yellow and red nodes, represented as black and grey squares in Fig. 17(b), respectively. From the diagram of Fig. 17(b) one easily understands how to continue the quasi-periodic ST: take four copies and connect then with a black square, then repeat the process indefinitely.

We can also consider STs in non-Euclidean 2d and 3d spaces. For instance, in [6] we showed a practical application of WSMTs as in Definition 2 for cities of a flat land whose soil is free from barriers like groundwater and rocky earth. Besides their simple physical interconnection weights were taken as extra costs like land taxes and local maintenance expenses. However, a more realistic approach should consider relief and barriers, namely the cities taken as points in the graph of a function , . Any shortest connection between two points becomes a geodesic segment on graph(), which in many cases can fail to be unique.

Even in Euclidean spaces we can take a non-standard metric, as for the rectilinear 2d and 3d STs, which are useful in VLSI-design with millions of nodes. But already just hundreds of nodes represent an important approach (e.g. in sound and video card design) [11, 21].

For all these variations the greatest advantage of Evolver is its portability. In this work we have presented our algorithms already implemented in MATLAB/Octave (preprocessing) and Evolver (main program). Of course, we aimed at both reproducing the classical soap film experiment and finding the WSMT. But another important contribution is the use of Evolver with its built-in minimisation routines, which enabled us to obtain a very short code. Future works will start from this source code and take advantage of Evolver’s facilities in adapting it to many other contexts.

## Acknowledgement

The first author has been supported by CAPES through his master’s scholarship No. 88882.451694/2019-01.

## References

- [1] (2017) Periodic Steiner networks minimizing length. arXiv preprint arXiv:1705.02471. Cited by: §7.
- [2] (2007) Optimisation in underground mining. In Handbook of operations research in natural resources, pp. 561–577. Cited by: §7.
- [3] (2012) Deployment analysis of pneumatic envelopes including ascending balloons and inflatable aerodynamic decelerators. Journal of Spacecraft and Rockets 49 (2), pp. 413–421. Cited by: §1.
- [4] (2013) The Surface Evolver. Susquehanna University. External Links: Link Cited by: §1, §3.
- [5] (2016) Towards the computation of viscous flow resistance of a liquid bridge. International Journal of Computational Methods and Experimental Measurements 4 (1), pp. 42–49. Cited by: §1.
- [6] (2016) Stree: an interactive program for weighted Steiner trees. JSW 11 (10), pp. 1062–1072. Cited by: §1, §2, §2, §7.
- [7] (2016) Effects of ligaments shape on radiative heat transfer in metal foams. International Journal of Numerical Methods for Heat & Fluid Flow 26 (2). Cited by: §1.
- [8] (2011) Minimal surfaces with only horizontal symmetries. ISRN Geometry 2011. Cited by: §1.
- [9] (2010) Steiner trees and spanning trees in six-pin soap films. American Journal of Physics 78 (2), pp. 215–221. Cited by: Figure 1, §1.
- [10] (2015) A software tool based on the Surface Evolver for precise location of tumours as a preoperative procedure to partial mastectomy. In Journal of Physics: Conference Series, Vol. 633, pp. 012132. Cited by: §1.
- [11] (1997) Solving rectilinear Steiner tree problems exactly in theory and practice. In European Symposium on Algorithms, pp. 171–185. Cited by: §7.
- [12] (1968) Steiner minimal trees. SIAM Journal on Applied Mathematics 16 (1), pp. 1–29. Cited by: §1, §2, §3.
- [13] (1997) Klee-minty polytope shows exponential time complexity of simplex method. University of Colorado at Denver, Denver. Cited by: §6.
- [14] (2007) Where are nature’s missing structures?. Nature Materials 6 (12), pp. 941–945. Cited by: §1.
- [15] (1992) The science of soap films and soap bubbles. Courier Corporation. Cited by: §2.
- [16] (1970) How good is the simplex algorithm. Technical report Washington Univ Seattle Dept of Mathematics. Cited by: §6.
- [17] (1993) A crystallographic approach to 3-periodic minimal surfaces. In Statistical thermodynamics and differential geometry of microstructured materials, pp. 15–48. Cited by: §1.
- [18] (1873) Statique expérimentale et théorique des liquides soumis aux seules forces moléculaires. Vol. 2, Gauthier-Villars. Cited by: §1.
- [19] (2016) Computational modelling of a spanning drop in a wedge with variable angle. International Journal of Undergraduate Research and Creative Activities 6, pp. 3. Cited by: §1.
- [20] (1997) Euclidean Steiner minimum trees: an improved exact algorithm. Networks: An International Journal 30 (3), pp. 149–166. Cited by: §6.
- [21] (1999) Rectilinear full Steiner tree generation. Networks: An International Journal 33 (2), pp. 125–143. Cited by: §7.