Fractals of any kind have always been interesting to me. Tree fractals are a great example on how a simple pattern can turn into a complex natural structure. I really wanted to create an art piece that connects tree fractals with tree data structures in computer science.
Originally I experimented with a few other recursive sequences but landed on Pell Numbers. These trees were visually appealing, some even resembling the Sierpiński triangle. The rules on stacking trees on top of others also had a much more clear direction.
The first two Pell numbers are 0, 1.
Following the equation (Pn = 2Pn-1 + Pn-2), the next Pell number is 2 which is colored in purple.
Here 5 was made by using 1 node at the top then two 2s at the bottom. This is colored in blue.
For a 12 node tree, a purple 2 tree was used at the top with two blue 5 trees as its subtrees.
The MATLAB program starts with a 5 and 12 node tree function. Those are used to make a 29 node function and so on.
Colors are determined by Depth First Search (DFS), a search algorithm used to traverse through data trees.
Each subtree is also treated as its own node so instead of applying DFS coloring to the whole tree at once, it is applied to each subtree individually.
In this 70 node tree each node is labeled in the order the program colors it. It starts with red at node 1 and ends with the red at the top right of the whole tree.
To follow real DFS, the order should actually continue to the left subtree after orange node 5. Instead, it finishes with the first subtree before moving to the left subtree and right subtree.
What is interesting is that the program picks which subtree to color next using DFS.
In a 408 tree you can start seeing how it starts coloring subtrees of subtrees using DFS.
This adds another fractal layer to the art that was at first unintentional.
Originally, I started with Fibonacci numbers. The previous tree in sequence is added to the current tree's shortest and leftmost branch. Here, each node has 1-2 children.
I also experimented using 1-3 children for each node.
Same rules applied to the Lucas numbers. 1-3 children for each node.
Most of the art was made using a programs I developed in MATLAB, some with Procreate to edit and add more elements such as hills or rivers.