K
- graph ID typeVV
- vertex value typeEV
- edge value typepublic class AdamicAdar<K extends CopyableValue<K>,VV,EV> extends GraphAlgorithmWrappingDataSet<K,VV,EV,AdamicAdar.Result<K>>
Adamic-Adar measures the similarity between pairs of vertices as the sum of the inverse logarithm of degree over shared neighbors. Scores are non-negative and unbounded. A vertex with higher degree has greater overall influence but is less influential to each pair of neighbors.
This implementation produces similarity scores for each pair of vertices in the graph with at least one shared neighbor; equivalently, this is the set of all non-zero Adamic-Adar coefficients.
The input graph must be a simple, undirected graph containing no duplicate edges or self-loops.
Modifier and Type | Class and Description |
---|---|
static class |
AdamicAdar.Result<T>
A result for the Adamic-Adar algorithm.
|
parallelism
Constructor and Description |
---|
AdamicAdar() |
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) . |
DataSet<AdamicAdar.Result<K>> |
runInternal(Graph<K,VV,EV> input)
The implementation of the algorithm, renamed from
GraphAlgorithm.run(Graph) . |
AdamicAdar<K,VV,EV> |
setMinimumRatio(float ratio)
Filter out Adamic-Adar scores less than the given ratio times the average score.
|
AdamicAdar<K,VV,EV> |
setMinimumScore(float score)
Filter out Adamic-Adar scores less than the given minimum.
|
AdamicAdar<K,VV,EV> |
setMirrorResults(boolean mirrorResults)
By default only one result is output for each pair of vertices.
|
equals, hashCode, run
getAlgorithmName, mergeConfiguration, setParallelism
public AdamicAdar<K,VV,EV> setMinimumScore(float score)
score
- minimum scorepublic AdamicAdar<K,VV,EV> setMinimumRatio(float ratio)
ratio
- minimum ratiopublic AdamicAdar<K,VV,EV> setMirrorResults(boolean mirrorResults)
mirrorResults
- whether output results should be mirroredprotected boolean canMergeConfigurationWith(GraphAlgorithmWrappingBase other)
GraphAlgorithmWrappingBase
GraphAlgorithmWrappingBase.mergeConfiguration(org.apache.flink.graph.utils.proxy.GraphAlgorithmWrappingBase)
.canMergeConfigurationWith
in class GraphAlgorithmWrappingBase<K extends CopyableValue<K>,VV,EV,DataSet<AdamicAdar.Result<K extends CopyableValue<K>>>>
other
- the algorithm with which to compare configurationGraphAlgorithmWrappingBase.mergeConfiguration(GraphAlgorithmWrappingBase)
public DataSet<AdamicAdar.Result<K>> runInternal(Graph<K,VV,EV> input) throws Exception
GraphAlgorithmWrappingDataSet
GraphAlgorithm.run(Graph)
.runInternal
in class GraphAlgorithmWrappingDataSet<K extends CopyableValue<K>,VV,EV,AdamicAdar.Result<K extends CopyableValue<K>>>
input
- the input graphException
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.