with dimension lumber it's way more about the width you can cut than length; sometimes shorter is more valuable depending on supply & demand (and transport). Accounting for the fact that trees are not perfect cylinders (or cones, really) is where all the fun optimization comes from anyways.
the right cuts at the right heights while working down the tree from a specific max height of the tree to still produce viable board feet while maximizing boards per cut. in most places, unless youre pulping the entire tree, its quite a bit more complicated than cut as low as possible.
its surprising to me how little work is done to make the tools which do this accessible considering how much money and open data there is.
it gets less open and more complicated is when you consider certain mills only can make certain cuts, produce certain products, and accept certain logs. then factor in distance between mills and the products they can make, and also log lengths accepted by the trucks which can travel those routes.
its all solvable and should be, but its so niche and that i still think there isnt an accessible solution