Closed thomasxwright closed 1 year ago
Algorithm ideas:
A depth-first search which steps out of each traversed path as if playing hot potato, bouncing off to the most distant and untouched path that's still available.
start at the root node. When looking at the current layer of the tree, are there any children we haven't traveled to yet? If so, travel that way.
Created the algorithm by forming the taxonomic tree into a tree of queues. When a node is plucked from, it is moved to the back of the queue compared to its siblings. It works perfectly.
Currently it only picks one example bird for each subgroup. Which means that a taxonomy with only one subgroup only gets one preview image, even if that subgroup has many birds under it.
Plan: grab up to a certain number of images (possibly different depending on screen size)
In this general pattern which will require a recursive tree traversal algorithm:
Push one sample image from each subtaxonomy until you reach the quota or have used all available images. Get the next image from a bird as distantly related as possible to the one you already grabbed.