top of page

Plant Matrix

  • Writer: janalumi
    janalumi
  • Apr 16, 2024
  • 1 min read

Updated: Apr 19, 2024

I've been looking into different digital strategies to group and select plants for companion planting. Plant Matrix employs a topological sorting algorithm to effectively group and select plants for companion planting. The algorithm begins by identifying each plant and iteratively connects them to their companion plants, creating a comprehensive network of interconnections.


This visualisation comprises two main components: an adjacency matrix and its logical representation, displayed as a force-directed graph. The adjacency matrix is presented as a table, where plants are listed both horizontally and vertically. Black squares indicate instances where the same plant intersects, while blue squares signify companion sets.


In contrast, the logical representation visualizes the connections between mutually beneficial plants through a force-directed graph layout. Within this dataset of 14 plants, distinct groupings of mutually beneficial plants emerge, clearly highlighting their interconnectedness and potential synergies.


Plant Matrix with 14 plants: https://plantmatrix.netlify.app


Here is the codepen of the first iteration with four plants: https://codepen.io/JANALUMI/pen/rNbvLgz


The complete dataset has over 80 plants, but that is too large for the Plant Matrix format, as it just ends up being a mess with a very large adjacency table. Instead, you can also play with the complete dataset in this Chord chart:



I enjoy learning by trying things out, here is a website where you can learn about the topological sort algorithm by trying it out yourself: https://www.cs.usfca.edu/~galles/visualization/TopoSortDFS.html



Feature image generated by Stable Diffusion in Dreamstudio.ai

bottom of page