algorithm - Family Tree display -


i creating family tree program. question how position nodes? positioned root @ center of screen , works fine if perfect binary tree , levels less. not case. sample tree :-

                    b       c     d   e   f     j k   l               n   o 

as can see, main problem regarding position of nodes. if node has many childs , it's adjacent node has many children, tend overlap.(main problem) using absolute positioning of node using canvas in silverlight. may not bother silverlight , canvas part if not silverlight developer. need logic of how position nodes.

the height of tree can computed knowing total number of levels of tree width of tree troubling me. how can calculate width of tree (total width of canvas)

can give me general guidelines regarding how set width of canvas , logic work perfect positioning of nodes.

note :- not asking whole algorithm , not homework. have algorithm , database. need guideline positioning part of node.

thanks in advance :)

if implement function: width(node) arbitrary node of tree, easy positioning each node

this function may defined recursively:
- tree of height 1 tree length of node
- tree of height bigger 1 sum of lengths of direct children of node (plus spaces between those)


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -