java.lang.Object
de.grogra.imp2d.layout.MinimizerPolyLogBarnesHut
Minimizer for the r-PolyLog energy model,
based on the Barnes-Hut algorithm.
For more information on the r-PolyLog energy model, see
"Energy Models for Drawing Clustered Small-World Graphs",
Technical Report I-07/2003, Technical University Cottbus, 2003.
Available at
www-sst.informatik.tu-cottbus.de/CrocoCosmos/linlog.html.- Version:
- 07.03.04
- Author:
- Andreas Noack (an@informatik.tu-cottbus.de)
-
Constructor Summary
ConstructorsConstructorDescriptionMinimizerPolyLogBarnesHut(int nodeNr, float[][] attr, float[][] pos) Sets the number of nodes, the similarity matrices (edge weights), and the position matrix. -
Method Summary
Modifier and TypeMethodDescriptionvoidminimizeEnergy(int nrIterations) Iteratively minimizes energy using the Barnes-Hut algorithm.voidsetAttractionExponent(float attrExp) Sets the exponent of the Euclidean distance in the attraction energy (the parameter r of the r-PolyLog model).voidsetGravitationFactor(float gravitationFactor) Sets the factor for the gravitation = attraction to the barycenter.
-
Constructor Details
-
MinimizerPolyLogBarnesHut
public MinimizerPolyLogBarnesHut(int nodeNr, float[][] attr, float[][] pos) Sets the number of nodes, the similarity matrices (edge weights), and the position matrix.- Parameters:
nodeNr- number of nodes.attr- similarity matrix (edge weights). Is not copied and not modified by this class. For unweighted graphs use 1.0f for edges and 0.0f for non-edges. Preconditions: dimension at least [nodeNr][nodeNr]; attr[i][i] == 0 for all i; attr[i][j] == attr[j][i] for all i, j.pos- position matrix. Is not copied and serves as input and output ofminimizeEnergy. If the input is two-dimensional (i.e. pos[i][2] == 0 for all i), the output is also two-dimensional. Random initial positions are appropriate. Preconditions: dimension at least [nodeNr][3]; no two different nodes have the same position
-
-
Method Details
-
setAttractionExponent
public void setAttractionExponent(float attrExp) Sets the exponent of the Euclidean distance in the attraction energy (the parameter r of the r-PolyLog model).- Parameters:
attrExp- exponent of the distance in the attraction energy = parameter r of the r-PolyLog model. Is 1.0f in the LinLog model and 3.0f in the energy version of the Fruchterman-Reingold model.
-
setGravitationFactor
public void setGravitationFactor(float gravitationFactor) Sets the factor for the gravitation = attraction to the barycenter.- Parameters:
gravitationFactor- factor for the gravitation energy. Set to 0.0f for no gravitation.
-
minimizeEnergy
public void minimizeEnergy(int nrIterations) Iteratively minimizes energy using the Barnes-Hut algorithm. Starts from the positions inpos, and stores the computed positions inpos.- Parameters:
nrIterations- number of iterations. Choose appropriate values by observing the convergence of energy.
-