K
- graph ID typeVV
- vertex value typeEV
- edge value typepublic class PageRank<K,VV,EV> extends GraphAlgorithmWrappingDataSet<K,VV,EV,PageRank.Result<K>>
HITS
.
See http://ilpubs.stanford.edu:8090/422/1/1999-66.pdf
Modifier and Type | Class and Description |
---|---|
static class |
PageRank.Result<T>
A result for the PageRank algorithm.
|
parallelism
Constructor and Description |
---|
PageRank(double dampingFactor,
double convergenceThreshold)
PageRank with a convergence threshold.
|
PageRank(double dampingFactor,
int iterations)
PageRank with a fixed number of iterations.
|
PageRank(double dampingFactor,
int maxIterations,
double convergenceThreshold)
PageRank with a convergence threshold and a maximum iteration count.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canMergeConfigurationWith(GraphAlgorithmWrappingBase other)
First test whether the algorithm configurations can be merged before the call to
GraphAlgorithmWrappingBase.mergeConfiguration(org.apache.flink.graph.utils.proxy.GraphAlgorithmWrappingBase) . |
protected void |
mergeConfiguration(GraphAlgorithmWrappingBase other)
Merge the other configuration into this algorithm's after the call to
GraphAlgorithmWrappingBase.canMergeConfigurationWith(org.apache.flink.graph.utils.proxy.GraphAlgorithmWrappingBase) has checked that the configurations can be merged. |
DataSet<PageRank.Result<K>> |
runInternal(Graph<K,VV,EV> input)
The implementation of the algorithm, renamed from
GraphAlgorithm.run(Graph) . |
PageRank<K,VV,EV> |
setIncludeZeroDegreeVertices(boolean includeZeroDegreeVertices)
This PageRank implementation properly handles both source and sink vertices which have,
respectively, only outgoing and incoming edges.
|
equals, hashCode, run
getAlgorithmName, setParallelism
public PageRank(double dampingFactor, int iterations)
dampingFactor
- probability of following an out-link, otherwise jump to a random vertexiterations
- fixed number of iterationspublic PageRank(double dampingFactor, double convergenceThreshold)
dampingFactor
- probability of following an out-link, otherwise jump to a random vertexconvergenceThreshold
- convergence threshold for sum of scorespublic PageRank(double dampingFactor, int maxIterations, double convergenceThreshold)
dampingFactor
- probability of following an out-link, otherwise jump to a random vertexmaxIterations
- maximum number of iterationsconvergenceThreshold
- convergence threshold for sum of scorespublic PageRank<K,VV,EV> setIncludeZeroDegreeVertices(boolean includeZeroDegreeVertices)
Setting this flag includes "zero-degree" vertices in the PageRank computation and result.
These vertices are handled the same as other "source" vertices (with a consistent score of
(1 - damping factor) / number of vertices
) but only affect the scores of other
vertices indirectly through the taking of this proportional portion of the "random jump"
score.
The cost to include zero-degree vertices is a reduce for uniqueness on the vertex set followed by an outer join on the vertex degree DataSet.
includeZeroDegreeVertices
- whether to include zero-degree vertices in the iterative
computationprotected boolean canMergeConfigurationWith(GraphAlgorithmWrappingBase other)
GraphAlgorithmWrappingBase
GraphAlgorithmWrappingBase.mergeConfiguration(org.apache.flink.graph.utils.proxy.GraphAlgorithmWrappingBase)
.canMergeConfigurationWith
in class GraphAlgorithmWrappingBase<K,VV,EV,DataSet<PageRank.Result<K>>>
other
- the algorithm with which to compare configurationGraphAlgorithmWrappingBase.mergeConfiguration(GraphAlgorithmWrappingBase)
protected void mergeConfiguration(GraphAlgorithmWrappingBase other)
GraphAlgorithmWrappingBase
GraphAlgorithmWrappingBase.canMergeConfigurationWith(org.apache.flink.graph.utils.proxy.GraphAlgorithmWrappingBase)
has checked that the configurations can be merged.mergeConfiguration
in class GraphAlgorithmWrappingBase<K,VV,EV,DataSet<PageRank.Result<K>>>
other
- the algorithm from which to merge configurationGraphAlgorithmWrappingBase.canMergeConfigurationWith(GraphAlgorithmWrappingBase)
public DataSet<PageRank.Result<K>> runInternal(Graph<K,VV,EV> input) throws Exception
GraphAlgorithmWrappingDataSet
GraphAlgorithm.run(Graph)
.runInternal
in class GraphAlgorithmWrappingDataSet<K,VV,EV,PageRank.Result<K>>
input
- the input graphException
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.