Module imp2d

Class MinimizerPolyLogBarnesHut

java.lang.Object
de.grogra.imp2d.layout.MinimizerPolyLogBarnesHut

public class MinimizerPolyLogBarnesHut extends Object
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

    Constructors
    Constructor
    Description
    MinimizerPolyLogBarnesHut(int nodeNr, float[][] attr, float[][] pos)
    Sets the number of nodes, the similarity matrices (edge weights), and the position matrix.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    minimizeEnergy(int nrIterations)
    Iteratively minimizes energy using the Barnes-Hut algorithm.
    void
    setAttractionExponent(float attrExp)
    Sets the exponent of the Euclidean distance in the attraction energy (the parameter r of the r-PolyLog model).
    void
    setGravitationFactor(float gravitationFactor)
    Sets the factor for the gravitation = attraction to the barycenter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 of minimizeEnergy. 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 in pos, and stores the computed positions in pos.
      Parameters:
      nrIterations - number of iterations. Choose appropriate values by observing the convergence of energy.