- java.lang.Object
-
- org.jgrapht.alg.scoring.PageRank.Algorithm
-
- Type Parameters:
V- the graph typeE- the edge type
private class PageRank.Algorithm extends java.lang.ObjectThe actual implementation.We use this pattern with the inner class in order to be able to cache the result but also allow the garbage collector to acquire all auxiliary memory used during the execution of the algorithm.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<int[]>adjListprivate double[]curScoreprivate booleanisWeightedprivate double[]nextScoreprivate int[]outDegreeprivate inttotalVerticesprivate java.util.Map<V,java.lang.Integer>vertexIndexMapprivate V[]vertexMapprivate java.util.ArrayList<double[]>weightsListprivate double[]weightSum
-
Constructor Summary
Constructors Constructor Description Algorithm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<V,java.lang.Double>getScores()private voidrun()private voidrunWeighted()private voidswapScores()private doubleteleProp()
-
-
-
Field Detail
-
totalVertices
private int totalVertices
-
isWeighted
private boolean isWeighted
-
vertexIndexMap
private java.util.Map<V,java.lang.Integer> vertexIndexMap
-
vertexMap
private V[] vertexMap
-
weightSum
private double[] weightSum
-
curScore
private double[] curScore
-
nextScore
private double[] nextScore
-
outDegree
private int[] outDegree
-
adjList
private java.util.ArrayList<int[]> adjList
-
weightsList
private java.util.ArrayList<double[]> weightsList
-
-
Method Detail
-
getScores
public java.util.Map<V,java.lang.Double> getScores()
-
run
private void run()
-
runWeighted
private void runWeighted()
-
teleProp
private double teleProp()
-
swapScores
private void swapScores()
-
-