It seems to me that there is one variable too many in the equation. If you were to supply the number of parents you ended up with it would be simpler, but from the two diagrams you have posted, it looks like this is undetermined.
Which to me looks like an impossible calculation. Or put another way: you give it a starting (or end) point - how many children in the lc_data layer. You give how many steps to take. But you don't provide an end point. Butt that end point is going to have to be decided at some stage.
Which I guess is what Old Pedant is saying. Based on what you are providing, any code produced will either be random and meaningless or determined by some arbitrary decision that comes from outside of the scope of the original idea.