K- graph ID type
VV- vertex value type
EV- edge value type
public 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|
A result for the Adamic-Adar algorithm.
|Constructor and Description|
|Modifier and Type||Method and Description|
First test whether the algorithm configurations can be merged before the call to
The implementation of the algorithm, renamed from
Filter out Adamic-Adar scores less than the given ratio times the average score.
Filter out Adamic-Adar scores less than the given minimum.
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 score
public AdamicAdar<K,VV,EV> setMinimumRatio(float ratio)
ratio- minimum ratio
public AdamicAdar<K,VV,EV> setMirrorResults(boolean mirrorResults)
mirrorResults- whether output results should be mirrored
protected boolean canMergeConfigurationWith(GraphAlgorithmWrappingBase other)
GraphAlgorithmWrappingBase<K extends CopyableValue<K>,VV,EV,DataSet<AdamicAdar.Result<K extends CopyableValue<K>>>>
other- the algorithm with which to compare configuration
public DataSet<AdamicAdar.Result<K>> runInternal(Graph<K,VV,EV> input) throws Exception
GraphAlgorithmWrappingDataSet<K extends CopyableValue<K>,VV,EV,AdamicAdar.Result<K extends CopyableValue<K>>>
input- the input graph
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.