Home   >   User Resources   >   Online Help   >   apaTree.Layout
 

 

Function index Version 3.0.0

apaTree.Layout(Edges, IsWeighted, midpointType, IsAlignedLeaves)

Excel=apaTree.Layout(Edges, IsWeighted, midpointType, IsAlignedLeaves)

Result

Calculates a tree layout from an edge list. Returns one row per node with the x and y coordinates, the nodes sorted by node index.

Syntax

Edges: edge list; the first column contains the parent node index, the second column the child node index, the third column the edge weight

IsWeighted: TRUE to use the edge weights as vertical distances, FALSE to use unit distances

midpointType: horizontal positioning of parent nodes: 0 = midpoint between leftmost and rightmost child, 1 = arithmetic mean of the immediate children, 2 = above the leftmost child, 3 = above the rightmost child, 4 = 75% of the distance from the leftmost to the rightmost child

IsAlignedLeaves: TRUE to align all leaves at the maximum root-to-leaf depth, FALSE to place leaves at their own depth

Algorithm

The root node (the node without parent) is identified.

Remarks

The edge list must define a tree, i.e. a connected graph with a single root and without cycles.