Expert users can use the following parameters.
Maximum allowed move per iteration (FL)
At each iteration, the layout algorithm moves the nodes
a relatively small amount. This amount must not be too large; otherwise,
the algorithm might not converge. It must not be too small either
or the number of necessary iterations and the running time increase.
The maximum amount of movement at each iteration is controlled
by a parameter.
To set this parameter:
Example of setting the maximum amount of movement per
iteration
forceDirectedLayout.setMaxAllowedMovePerIteration(3);
Typical values for this setting are 1 to 30, but it depends
on the value of the
PreferredLinksLength
parameter.
For example, if the setting for the PreferredLinksLength
parameter
is 1000, then a value of 100 for the MaxAllowedMovePerIteration
parameter
is still meaningful. Link length weight (FL)
The layout algorithm is based on the computation of attraction
and repulsion forces for each of the nodes and the iterative search
of an equilibrium configuration. One of these forces is related to
the objective of obtaining a link length close to the specified preferred
length. The weight of this force, representing the total amount of
force, is controlled by a parameter.
To set this parameter:
Example of setting the force of the link length weight
forceDirectedLayout.setLinkLengthWeight(1.5);
The default value is
1
. Increasing
this parameter can help obtain link lengths closer to the specified
length, but increasing too much can increase the number of link crossings. Additional node repulsion weight (FL)
An additional repulsion force can be computed between
nodes that are not connected by a link. The weight of this force,
representing the total amount of force, is controlled by a parameter.
To set this parameter:
Example of setting the node repulsion weight
forceDirectedLayout.setAdditionalNodeRepulsionWeight(0.4);
The default value of this parameter is
0.2f
.
Increasing (or decreasing) the weight increases (or decreases) the
priority that is given to maintaining the nodes at a distance larger
than the node distance threshold. See setNodeDistanceThreshold. Increasing the weight also
decreases the ability of the algorithm to reach convergence quickly. The following figures enable you to compare the same
graph laid out with additional repulsion disabled (Additional repulsion disabled, produced with Force-directed Layout) and then
enabled (Additional repulsion enabled, produced with Force-directed Layout). You can
see that the “star” configuration, where
many nodes are connected to the same central node, is better displayed
when additional repulsion is enabled.

Additional repulsion disabled, produced with Force-directed Layout

Additional repulsion enabled, produced with Force-directed Layout
Node distance threshold (FL)
The additional repulsion force between two nodes not
connected by a link is computed only when their distance is smaller
than a predefined distance.
To set this distance:
Example of setting the node distance threshold
forceDirectedLayout.setNodeDistanceThreshold(25);
This additional force is computed only if the additional
node repulsion weight is set to a value larger than the default value
0
. It is recommended that this threshold is set to a value
smaller than the preferred length of the links.
Fast multilevel mode: maximum percentage of elapsed time for the refinement step (FL)
In fast multilevel mode, the algorithm performs a final
refinement step. You can set the maximum percentage of the time already
elapsed that must be spent on the final refinement step when the layout
mode is FAST_MULTILEVEL_MODE. Increasing
the value of this parameter can improve the quality of the layout,
possibly at the cost of lower speed.
To set this parameter:
Example of setting the maximum percentage of elapsed
time to spend on the final refinement step
forceDirectedLayout.setMaxPercentageOfElapsedTimeForRefinement(500);
This parameter is only used in fast multilevel mode.
Fast multilevel mode: maximum percentage of total time allowed for the refinement step (FL)
In fast multilevel mode, the algorithm performs a final
refinement step. You can set the maximum percentage of the total time
allowed that must be spent on the final refinement step when the layout
mode is FAST_MULTILEVEL_MODE. Increasing
the value of this parameter can improve the quality of the layout,
possibly at the cost of lower speed.
To set this parameter:
Example of setting the maximum percentage of total time
to spend on the final refinement step
forceDirectedLayout.setMaxPercentageOfTotalAllowedTimeForRefinement(5);
This parameter is only used in fast multilevel mode.
Fast multilevel mode: maximum repeat for convergence (FL)
You can set the maximum number of attempts to reach convergence
at each step when the layout mode is FAST_MULTILEVEL_MODE.
Increasing the value of this parameter can improve the quality of
the layout, possibly at the cost of lower speed.
To set this parameter:
Example of setting the maximum number of attempts to
reach convergence at each step
forceDirectedLayout.setMaxRepeatForConvergence(5);
This parameter is only used in fast multilevel mode.