I’m deciding how to store data and how to draw a tree graph. Assuming I want a minimum space M between two elements, I was thinking I could traverse the entire tree structure from the top to the bottom in breath-first search.
If there’s just one element below the current one, it will be drawn with the same X coordinate as his father. If there are two elements, they will be drawn one at -M/2 and the other at +M/2 with respect to their father X coordinate. And so on..
The problem is: what if an element like C (see diagram below) has a great number of children?? I should restructure the entire tree since I should move the element D to the left and make space for all the E-F children of C. Moving D to the left will get the tree crooked and I will need to move B too. Moving B to the left would alter the tree’s symmetry so I’ll need to move C too and so on..

How can I draw a perfectly symmetric tree whose elements may have a large number of children?
Do it the other way up: compute each node’s horizontal position from those of its children after they’ve been computed. Something like this (WARNING: completely untested code; may consist entirely of bugs):