Voronoi Trees

loopspace

18th October 2018

# 1 Introduction Figure 1: Sunlight Through a Forest Canopy

I recently saw the picture, Figure 1, of a forest canopy taken from the ground1. The light through the leaves showed definite lines where the leaves from one tree met the leaves from another. The original context in which I saw the image was about how relaxing it would be to be in the forest, looking up at the canopy.

1I have not been able to find an original source for this image. It appears to be a generic "sunlight through the leaves" image. If anyone is able to supply me with the correct attribution, I will be happy to add it here

My reaction on seeing it was to think of Voronoi Diagrams.

# 2 Voronoi Diagrams

Voronoi diagrams are fairly simple to understand. Start with a set of points on the plane (or piece of paper) and then divide the plane (or paper) into regions based on which point is closest.

With just two points, the dividing line is the perpendicular bisector between them, as in Figure 2. Figure 2: Voronoi diagram for two points

With more than two points, a naive method2 of drawing the boundaries of the regions is to draw all the bisectors between the points and then figure out which parts define the regions.

2i.e., not a very good general method but fine with just a handful of points. Figure 3: Voronoi diagram for three points

Another method, which is quite fun to watch, is to fill ever increasing circles centred at each point but to never fill in a place that's already been filled.

Anyway, back to the trees. Inspired by the picture, I wondered if anyone had used Voronoi diagrams to study tree canopies. It turned out that they had (many thanks to the people on twitter who pointed me in this direction). The phenomenon whereby the boundaries are visible is called canopy shyness and some papers have been written using Voronoi diagrams as a tool to study this.

# 3 Generalised Voronoi Diagrams

Full confession: I've not yet read the papers. I need to set aside time to read them, particularly as I suspect they won't be aimed at me (a Mathematician) so I'll have a bit of translation to do when reading them. Nevertheless, it's still an interesting topic and, as usual, it sparked me off on a little mathematical journey of my own which, in all likelihood, has no particular relevance to tree growth but which is nevertheless inspired by it.

One thing that particularly struck me about the original image was how well-defined and above all straight the gaps were. On the face of it, this seems reasonable: the branches from each tree grow outward until they get near to a space already occupied by the branches from another tree. This is exactly the situation that Voronoi diagrams describe.

But that assumes two things: that the trees all grow at the same speed and that they started at the same time.

What if we relax those conditions?

## 3.1 General Voronoi Diagrams

Before looking at what happens if the trees grow at different speeds and at different times, let's examine the general case to establish some notation.

We suppose that we have some points in the plane, say $\left\{{a}_{i}\right\}$, and each is a source of growth. We additionally assume that the growth is defined by a radial function, say ${r}_{i}\left(t\right)$, in that the unfettered growth from ${a}_{i}$ at time $t$ is a circle of radius ${r}_{i}\left(t\right)$.

Each function ${r}_{i}\left(t\right)$ has the structure that there is some time ${t}_{i}$ such that ${r}_{i}\left(t\right)$ is zero for $t<{t}_{i}$, and for $t>{t}_{i}$ then it is strictly increasing. This means that once the growth starts, the function from time to radius is invertible – i.e., knowing the radius we can (in theory) figure out the time it got there.

By "unfettered growth" I mean that the growth if no obstruction were present.

For a point $x$, to figure out which source gets to $x$ we need to look at the distances from $x$ to each point ${a}_{i}$. This is done using the Euclidean distance function, written $\parallel x-{a}_{i}{\parallel }_{2}$, which is none other than Pythagoras' theorem in disguise. For each point, we can then work out the time at which ${r}_{i}\left(t\right)=\parallel x-{a}_{i}{\parallel }_{2}$ which would be the time when the growth from ${a}_{i}$ would reach $x$. The earliest time "wins".

Since we've assumed that ${r}_{i}\left(t\right)$ is invertible (at least for $t>{t}_{i}$), these times are given by:

 ${t}_{x,i}={r}_{i}^{-1}\left(\parallel x-{a}_{i}{\parallel }_{2}\right)$

To find the boundary between two regions, we need to figure out those points $x$ which are reached from two source points, say ${a}_{1}$ and ${a}_{2}$, at the same time. This means that we need to find $x$ such that ${t}_{x,1}={t}_{x,2}$, which means solving:

 ${r}_{1}^{-1}\left(\parallel x-{a}_{1}{\parallel }_{2}\right)={r}_{2}^{-1}\left(\parallel x-{a}_{2}{\parallel }_{2}\right)$

In the next sections I'll look at this equation for particular circumstances. As those circumstances get more complicated, I'll be able to say less in general. To counteract that, here's a Voronoi playground. It places a number of points in a square and generates the Voronoi diagram. You can move the points around. You can choose one of the types of Voronoi diagram referred to below, if there are any parameters then it generates them randomly within a reasonable range.

## 3.2 Weighted Voronoi Diagrams

The easiest one to work with is if the trees grow at different speeds. Each tree, located at point ${a}_{i}$, has a speed, say ${s}_{i}$, such that its unfettered growth function is given by:

 ${r}_{i}\left(t\right)=\left\{\begin{array}{ll}0& t\le 0\\ {s}_{i}t& t>0\end{array}$

Thus the boundaries between two regions are those $x$ for which:

 $\frac{1}{{s}_{i}}\parallel x-{a}_{i}{\parallel }_{2}=\frac{1}{{s}_{j}}\parallel x-{a}_{j}{\parallel }_{2}$

Rearranging this, say for ${a}_{1}$ and ${a}_{2}$, produces an equation of the form:

 $\parallel x-{a}_{1}{\parallel }_{2}=k\parallel x-{a}_{2}{\parallel }_{2}$

where $k$ is some (positive) constant. This is a circle.

Such Voronoi diagrams are called weighted Voronoi diagrams. The boundaries are made up from arcs of circles, as in Figure 4. Figure 4: Weighted Voronoi Diagram

## 3.3 Shifted Voronoi Diagrams

The second possible change would be to have the trees start growing at different times, say at time ${t}_{i}$ from point ${a}_{i}$, but at the same speed. The unfettered growth function would then be of the form

 ${r}_{i}\left(t\right)=\left\{\begin{array}{ll}0& t\le {t}_{i}\\ t-{t}_{i}& t>{t}_{i}\end{array}$

Thus the boundaries between two regions is given by finding $x$ such that:

 $\parallel x-{a}_{i}{\parallel }_{2}+{t}_{i}=\parallel x-{a}_{j}{\parallel }_{2}+{t}_{j}$

This rearranges to an equation of the form, for ${a}_{1}$ and ${a}_{2}$:

 $\parallel x-{a}_{1}{\parallel }_{2}=\parallel x-{a}_{2}{\parallel }_{2}+k$

where $k$ can be any real number3.

3It is worth noting that if $k$ is larger than the distance between the points, the point that starts will totally dominate the plane.

This is the focus-focus property of a hyperbola4. Thus in this case the boundaries of the Voronoi regions will be segments of hyperbolae, as in Figure 5.

4In full confession mode, I should say that I expanded out the equation to get to the hyperbola before I realised this. Figure 5: Shifted Voronoi Diagram

## 3.4 Shifted, Weighted Voronoi Diagrams

We're doing quite well with conic sections here, but sadly all good things come to an end. If we allow both shifting and weighting then we get equations of degree $4$.

Our unfettered growth functions now look like:

 ${r}_{i}\left(t\right)=\left\{\begin{array}{ll}0& t\le {t}_{i}\\ {s}_{i}\left(t-{t}_{i}\right)& t>{t}_{i}\end{array}$

and this means that we are solving equations of the form:

 $\frac{1}{{s}_{i}}\parallel x-{a}_{i}{\parallel }_{2}+{t}_{i}=\frac{1}{{s}_{j}}\parallel x-{a}_{j}{\parallel }_{2}+{t}_{j}$

which rearranges to something of the form:

 $\parallel x-{a}_{1}{\parallel }_{2}=k\parallel x-{a}_{2}{\parallel }_{2}+c$

To see what this looks like, let us transform the points so that ${a}_{1}$ and ${a}_{2}$ lie on the $x$–axis, say at $\left(-1,0\right)$ and $\left(1,0\right)$.

Our equation is thus:

 $\parallel \left(x,y\right)-\left(-1,0\right){\parallel }_{2}=k\parallel \left(x,y\right)-\left(1,0\right){\parallel }_{2}+c$

Squaring both sides, we can replace the $\parallel \cdot {\parallel }_{2}$ by the Pythagorean identity:

 $\left(x+1{\right)}^{2}+{y}^{2}={k}^{2}\left(x-1{\right)}^{2}+{k}^{2}{y}^{2}+2kc\parallel \left(x,y\right)-\left(1,0\right){\parallel }_{2}+{c}^{2}$

Expanding out the brackets and gathering terms, we get:

 $\left(1-{k}^{2}\right){x}^{2}+2\left({k}^{2}+1\right)x+\left(1-{k}^{2}\right){y}^{2}+\left(1+{k}^{2}+{c}^{2}\right)=2kc\parallel \left(x,y\right)-\left(1,0\right){\parallel }_{2}$

To see the "wood for the trees5", let's hide some of the mess and write this as:

5You didn't think I'd go through this whole thing and not write that, did you?

 ${\alpha }_{1}{x}^{2}+{\alpha }_{2}x+{\alpha }_{3}{y}^{2}+{\alpha }_{4}={\alpha }_{5}\parallel \left(x,y\right)-\left(1,0\right){\parallel }_{2}$

The $\parallel \cdot {\parallel }_{2}$ part is secretly a square root, so we square both sides again to get:

 $\begin{array}{rl}{\alpha }_{1}^{2}{x}^{4}& +{\alpha }_{2}^{2}{x}^{2}+{\alpha }_{3}^{2}{y}^{4}+{\alpha }_{4}^{2}\\ & +2\left({\alpha }_{1}{\alpha }_{2}{x}^{3}+{\alpha }_{1}{\alpha }_{3}{x}^{2}{y}^{2}+{\alpha }_{1}{\alpha }_{4}{x}^{2}+{\alpha }_{2}{\alpha }_{3}x{y}^{2}+{\alpha }_{2}{\alpha }_{4}x+{\alpha }_{3}{\alpha }_{4}{y}^{2}\right)\\ & ={\alpha }_{5}^{2}\left(\left(x-1{\right)}^{2}+{y}^{2}\right)={\alpha }_{5}^{2}{x}^{2}-2{\alpha }_{5}^{2}x+{\alpha }_{5}^{2}+{\alpha }_{5}^{2}{y}^{2}\end{array}$

Gathering everything together, and relabelling again, the general form is:

 ${p}_{4,0}{x}^{4}+{p}_{3,0}{x}^{3}+{p}_{2,0}{x}^{2}+{p}_{1,0}x+{p}_{0,4}{y}^{4}+{p}_{0,2}{y}^{2}+{p}_{2,2}{x}^{2}{y}^{2}+{p}_{1,2}x{y}^{2}+{p}_{0,0}=0$

which is a quartic. This means that the boundaries of the regions in the Voronoi diagram could be quite complicated, as in Figure 6. Figure 6: Voronoi Diagram with Weights and Shifts

## 3.5 Ever Decreasing Circles

Back to thinking about trees, I do think that the unfettered growth model has its flaws. A tree with no competitors would not spread out indefinitely. Most likely, there would be some maximum spread and that as it reached that distance, the growth would gradually slow. A possibly model for this would be:

 ${r}_{i}\left(t\right)=\left\{\begin{array}{ll}0& t\le {t}_{i}\\ {M}_{i}\left(1-{e}^{-{k}_{i}\left(t-{t}_{i}\right)}\right)\end{array}$

The inverse of this function (for $t>{t}_{i}$) is given by:

 ${r}_{i}^{-1}\left(x\right)=-\frac{1}{{k}_{i}}\mathrm{log}\left(1-\frac{x}{{M}_{i}}\right)+{t}_{i}$

This isn't actually as scary as it looks. In particular, if all the ${M}_{i}$ are the same, say $M$, then this is of the form:

 ${r}_{i}^{-1}\left(x\right)=\frac{1}{{k}_{i}}g\left(x\right)+{t}_{i}$

where $g\left(x\right)=-\mathrm{log}\left(1-\frac{x}{M}\right)$. This looks like the shifted, weighted Voronoi diagram but with a different notion of what distance is, as in Figure 7. Figure 7: Voronoi Diagram with Exponential Growth Function

# 4 As the Duck Waddles or as the Tree Grows

I'll end with a comment on where I can see a limitation of Voronoi diagrams as I've described them above. It is entirely possible that this is known about, and dealt with, in the literature but as that's still on my "to read" list then I don't know.

Let's go back to the weighted Voronoi diagram and consider the situation with two points. The Voronoi diagram looks a little like Figure 8. Figure 8: Weighted Voronoi Diagram with Two Points

Now the diagram shows the plane divided into two regions. These two regions are defined by which duck would reach a point first (clearly the superhero duck would be faster than the duck with the ball and chain).

But here's the thing: to get to some of those points first, the superhero duck would have to fly through the region that the prison duck controls. That is, the criteria for "getting there first" is by the most direct route.

With trees, that route might not be available. If the slower growing tree has filled a region then the faster one won't send branches through it to reach the other side, it will have to go around. So the actual shape won't be a circle, but will extend somewhat to (in this case) the right-hand side. Possibly more of the shape in Figure 9. Figure 9: Tree-like Voronoi Diagram with Two Points

In this case, the metric used to measure the distance between two points will be the path metric which measures it by the length of the shortest path. Normally this agrees with the Euclidean metric, but when there are excluded regions then it can be more complicated.

Something to investigate!