apaGraph.Layout.KamadaKawai.AllParams(Edges, UseWeightsOtherwiseUnitWeights, springLength, springStiffness, epsilon, Iterations)
=apaGraph.Layout.KamadaKawai.AllParams(Edges, UseWeightsOtherwiseUnitWeights, springLength, springStiffness, epsilon, Iterations)Result
Kamada-Kawai layout of an edge list with all parameters exposed. Returns a layout matrix with the node index in the first column and the X/Y coordinates in the next two columns.
Syntax
Edges: n x 3 edge list, the first two columns containing the node indices, the third column the edge lengths (costs) used in weighted mode
UseWeightsOtherwiseUnitWeights: TRUE to use the third column as edge lengths in the shortest-path distances d(i,j), FALSE to use unit edge lengths
springLength: optional global length scale L > 0. The ideal spring length between nodes i and j is l(i,j) = L * d(i,j). Default value: 1
springStiffness: optional global spring constant K > 0. The spring stiffness between nodes i and j is k(i,j) = K / d(i,j)². Default value: 1
epsilon: optional convergence tolerance ≥ 0, i.e. the iteration stops when the largest node energy gradient falls below this value. Default value: 0, i.e. iterate until no node moves any further
Iterations: optional maximum number of outer iterations. Default value: 500 times the number of nodes
Algorithm
The graph-theoretic shortest-path distances d(i,j) between all nodes are calculated.
Remarks
apaGraph.Layout.KamadaKawai uses the default values of all parameters. Omitted or empty parameters take their default values. The optimization stops early when the selected node can no longer move, since all further iterations would leave the layout unchanged.
Pressing Esc aborts the calculation; the function then returns "Calculation aborted by user."
