Package org.jgrapht.alg.drawing
Class IndexedFRLayoutAlgorithm2D<V,E>
- java.lang.Object
- 
- org.jgrapht.alg.drawing.FRLayoutAlgorithm2D<V,E>
- 
- org.jgrapht.alg.drawing.IndexedFRLayoutAlgorithm2D<V,E>
 
 
- 
- Type Parameters:
- V- the graph vertex type
- E- the graph edge type
 - All Implemented Interfaces:
- LayoutAlgorithm2D<V,E>
 
 public class IndexedFRLayoutAlgorithm2D<V,E> extends FRLayoutAlgorithm2D<V,E> Fruchterman and Reingold Force-Directed Placement Algorithm using the Barnes-Hut indexing technique with a QuadTree. The Barnes-Hut indexing technique is described in the following paper:- J. Barnes and P. Hut. A hierarchical O(N log N) force-calculation algorithm. Nature. 324(4):446--449, 1986.
 - Author:
- Dimitrios Michail
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.jgrapht.alg.drawing.FRLayoutAlgorithm2DFRLayoutAlgorithm2D.InverseLinearTemperatureModel, FRLayoutAlgorithm2D.TemperatureModel
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected ToleranceDoubleComparatorcomparatorstatic doubleDEFAULT_THETA_FACTORDefault $\theta$ value for approximation using the Barnes-Hut techniqueprotected Function<V,Point2D>initializerA model initializerprotected longsavedComparisonsprotected doubletheta- 
Fields inherited from class org.jgrapht.alg.drawing.FRLayoutAlgorithm2DDEFAULT_ITERATIONS, DEFAULT_NORMALIZATION_FACTOR, iterations, normalizationFactor, optimalDistance, rng, temperatureModelSupplier
 
- 
 - 
Constructor SummaryConstructors Constructor Description IndexedFRLayoutAlgorithm2D()Create a new layout algorithmIndexedFRLayoutAlgorithm2D(int iterations, double theta)Create a new layout algorithmIndexedFRLayoutAlgorithm2D(int iterations, double theta, double normalizationFactor)Create a new layout algorithmIndexedFRLayoutAlgorithm2D(int iterations, double theta, double normalizationFactor, Random rng)Create a new layout algorithmIndexedFRLayoutAlgorithm2D(int iterations, double theta, double normalizationFactor, Random rng, double tolerance)Create a new layout algorithm
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<V,Point2D>calculateRepulsiveForces(Graph<V,E> graph, LayoutModel2D<V> model)Calculate the repulsive forces between verticesFunction<V,Point2D>getInitializer()Get the initializerlonggetSavedComparisons()Get the total number of saved comparisons due to the Barnes-Hut technique.protected voidinit(Graph<V,E> graph, LayoutModel2D<V> model)Initialize a model using the initializer.voidlayout(Graph<V,E> graph, LayoutModel2D<V> model)Layout a graph.voidsetInitializer(Function<V,Point2D> initializer)Set the initializer- 
Methods inherited from class org.jgrapht.alg.drawing.FRLayoutAlgorithm2DattractiveForce, calculateAttractiveForces, repulsiveForce
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_THETA_FACTORpublic static final double DEFAULT_THETA_FACTOR Default $\theta$ value for approximation using the Barnes-Hut technique- See Also:
- Constant Field Values
 
 - 
thetaprotected double theta 
 - 
savedComparisonsprotected long savedComparisons 
 - 
comparatorprotected ToleranceDoubleComparator comparator 
 
- 
 - 
Constructor Detail- 
IndexedFRLayoutAlgorithm2Dpublic IndexedFRLayoutAlgorithm2D() Create a new layout algorithm
 - 
IndexedFRLayoutAlgorithm2Dpublic IndexedFRLayoutAlgorithm2D(int iterations, double theta)Create a new layout algorithm- Parameters:
- iterations- number of iterations
- theta- parameter for approximation using the Barnes-Hut technique
 
 - 
IndexedFRLayoutAlgorithm2Dpublic IndexedFRLayoutAlgorithm2D(int iterations, double theta, double normalizationFactor)Create a new layout algorithm- Parameters:
- iterations- number of iterations
- theta- parameter for approximation using the Barnes-Hut technique
- normalizationFactor- normalization factor for the optimal distance
 
 - 
IndexedFRLayoutAlgorithm2Dpublic IndexedFRLayoutAlgorithm2D(int iterations, double theta, double normalizationFactor, Random rng)Create a new layout algorithm- Parameters:
- iterations- number of iterations
- theta- theta parameter for the Barnes-Hut approximation
- normalizationFactor- normalization factor for the optimal distance
- rng- the random number generator
 
 - 
IndexedFRLayoutAlgorithm2Dpublic IndexedFRLayoutAlgorithm2D(int iterations, double theta, double normalizationFactor, Random rng, double tolerance)Create a new layout algorithm- Parameters:
- iterations- number of iterations
- theta- theta parameter for the Barnes-Hut approximation
- normalizationFactor- normalization factor for the optimal distance
- rng- the random number generator
- tolerance- tolerance used when comparing floating point values
 
 
- 
 - 
Method Detail- 
layoutpublic void layout(Graph<V,E> graph, LayoutModel2D<V> model) Description copied from interface:LayoutAlgorithm2DLayout a graph.- Specified by:
- layoutin interface- LayoutAlgorithm2D<V,E>
- Overrides:
- layoutin class- FRLayoutAlgorithm2D<V,E>
- Parameters:
- graph- the graph
- model- the layout model to use
 
 - 
calculateRepulsiveForcesprotected Map<V,Point2D> calculateRepulsiveForces(Graph<V,E> graph, LayoutModel2D<V> model) Description copied from class:FRLayoutAlgorithm2DCalculate the repulsive forces between vertices- Overrides:
- calculateRepulsiveForcesin class- FRLayoutAlgorithm2D<V,E>
- Parameters:
- graph- the graph
- model- the model
- Returns:
- the displacement per vertex due to the repulsive forces
 
 - 
getSavedComparisonspublic long getSavedComparisons() Get the total number of saved comparisons due to the Barnes-Hut technique.- Returns:
- the total number of saved comparisons
 
 - 
getInitializerpublic Function<V,Point2D> getInitializer() Get the initializer- Returns:
- the initializer
 
 - 
setInitializerpublic void setInitializer(Function<V,Point2D> initializer) Set the initializer- Parameters:
- initializer- the initializer
 
 - 
initprotected void init(Graph<V,E> graph, LayoutModel2D<V> model) Initialize a model using the initializer.- Parameters:
- graph- the graph
- model- the model
 
 
- 
 
-