I run a algorithm to solve a problem that return a set of information relative to a binary tree associated with these problem. For illustrate the results obtained I try to plot the binary tree. I make the plot of the right in image below. But I like to plot the tree of the left.
The question is: How plot the binary tree of right in figure below?
The input data for this is two lists. The first contain the "path" of solution (for the tree in the left/right below: paths = {{0, 0, 0, 0, 0}, {0, 1, 1, 1}}) the second list contain the number of nodes in each level (for the tree in the right below: nodes_leves = {1, 2, 4, 4}).
I tried search for the functions associated with graph, trees, etc. but don't encountered a solution for plot this specific tree.
Thanks in advance
Explanation of "paths":
First, denote the "path" {0, 0, 0, 0} for {a = 0, b = 0, c = 0, d = 0}. For the level 1 we have one possibility. Then the a = 0 is the node root. The partial path in the binary tree so far is {left} (see the picture below).
After this we have two possibilities for b. But the solution is b=0. That is, in the path we have chosen the left. So far the path in the binary tree is {left, left} (see the picture below).
Note that in second level is possible to have {left, rigth}, i.e., {a = 0, b = 1}. But for the "path solution" the path chosen is {left, left} = {0, 0} = {a = 0, b = 0}.
For the third level we have the possibilities {left, left, 'left/right'}. But the solution is {left, left, left}, i.e., {a = 0, b = 0, c = 0} or {0, 0, 0}. The picture below illustrate this.
And follow this construction we have the two paths solutions in the binary tree: {0, 0, 0, 0} = {left, left, left, left} and {1, 1, 1, 1} = {right, right, right, right}.
The node root maybe be green. But its not fundamental. The problem is receive from input: any path, for e.g. {0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1}, where "0 is choose node son of left" and "1 is choose node son of right" in a certain level, and the number of nodes in each level, for e.g. {1, 2, 4, 2, 8, 5, 4, 3, 2, 4, 4, 4} and plot the respective binary tree with the "paths" and the nodes deleted.
We are going down in this binary tree. In level 1, we have 1 node. In level n we have $2^n$ nodes (in the worst case).
paths = {{0, 0, 0, 0, 0}, {0, 1, 1, 1}}
is related to the two trees? $\endgroup${0,0,0,0,0}
(a list with 5 elements) relates to the verbal description "in each choice in the binary tree, the vertice of left is choosen" (there are 7 such choices in the left tree). I added new pieces in my answer for highlighting selected edges. $\endgroup$