CG Trees

Today, the Conversation of Momentum is venturing out of its comfort zone (and, some might say, its depth) to discuss some biology. I won’t clutter up this post with many words and equations; my hope is that the pictures will provide interest enough!


I recently watched the 1991 Christmas Lectures entitled Growing Up in the Universe, delivered by Richard Dawkins. The lectures explore the theory of evolution by natural selection, which accounts at a stroke for life’s prodigious diversity and its appearance of having been designed. Much like the theory of special relativity, it makes profound predictions based on only a few simple postulates. The three oft-quoted requirements of evolution are:

  1. variation – the physical traits of organisms vary from one to the other; such variation is the result of mutation, an essentially random alteration of an organism’s genetic code;
  2. heritability – an organism’s traits are strongly correlated with those of its parents, due to its genes’ being ‘inherited’ from its parents;
  3. natural selection – the reproductive success or otherwise of an organism is determined by its suitability to its environent.

In the second of his lectures, Dawkins illustrates the process of evolution with a simple program that designs spiderwebs. A parent spiderweb, whose geometry is defined by a list of numbers constituting its `genetic code’ (or rather, that of the spider that spun it), produces a number of daughter spiderwebs with slightly differing structures. A random array of dots, representing flies, is superposed on each daughter, and the number caught by each web is calculated. The daughter that catches the greatest number of flies is selected, and it assumes the role of the parent. The process repeats, and produces a sequence of increasingly successful spiderwebs.

I thought I would try something similar with trees. Here’s a brief outline of the program:

  1. We define the tree’s genes (a list of numbers \{g_n\}), which determine uniquely its physical properties, namely the length of its branches and the angles between them.
  2. The tree is constructed according to its genes, resulting in a set of connected line segments representing its branches and leaves.
  3. We evaluate numerically the amount of light absorbed by the tree’s leaves, which we do by looking for their intersection with rays of light. The resulting phonon count is taken to be an indicator of how successful the tree is.
  4. The tree is then forced to mutate: its genes, and so its structure, are altered slightly. To keep the tree from growing without limit, it mutates in such a way that its total ‘mass’ is conserved. In this way, the tree must optimise its light-collecting ability with the resources available to it.
  5. Following the mutation, we re-evaluate the photon count. If the count is greater than before, the new set of genes \{g'_n\} is selected and used to construct a new tree; if the count is less than before, the old set of genes is kept.
  6. Steps 2-5 are repeated until 500 attempted mutations have taken place.

The result is a sequence of increasingly ‘successful’ trees. The animation below illustrates the evolution of a typical tree.


I won’t launch into a discussion of its minutiae, but I hope you will notice two things. First, the delay between successful mutations increases over time. The tree is initially very bad at collecting light, so the program easily finds a favourable mutation; towards later times, we see a ‘saturation’ effect, where evolution proceeds at a much decreased rate. Second, the photon count’s steady increase is punctuated by fairly big jumps when the leaves get an opportunity to mutate.

Here is a graph of the photon count against mutation for a number of trees.


The saturation effect is more evident here; note how some trees get ‘stuck’ at a particular photon count. For some reason, they become trapped in a kind of local maximum; any mutation seems to render them worse at collecting light. Dawkins suggests the nautilus’ pinhole camera eye is actually an example of an organism getting stuck somewhere in evolutionary space, much like these trees.

Finally, here is a composite image of four mature trees, rendered with a little artistic license.


Remember that these trees assume the shape they do simply to maximise a mathematical function. I think this adds to their beauty.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s