Layout that positions graph elements based on a physics simulation of
interacting forces; by default, nodes repel each other, edges act as
springs, and drag forces (similar to air resistance) are applied. This
algorithm can be run for multiple iterations for a run-once layout
computation or repeatedly run in an animated fashion for a dynamic and
interactive layout.
The running time of this layout algorithm is the greater of O(N log N)
and O(E), where N is the number of nodes and E the number of edges.
The addition of custom force calculation modules may, however, increase
this value.
The
prefuse.util.force.ForceSimulator used to drive this layout
can be set explicitly, allowing any number of custom force directed layouts
to be created through the user's selection of included
prefuse.util.force.Force components. Each node in the layout is
mapped to a
prefuse.util.force.ForceItem instance and each edge
to a
prefuse.util.force.Spring instance for storing the state
of the simulation. See the
prefuse.util.force package for more.