public class SybilRank extends Object implements ComputeFunction<Long,SybilRank.VertexValue,Double,Double>
Modifier and Type | Class and Description |
---|---|
class |
SybilRank.Initializer
This class is used only to initialize the rank of the vertices.
|
static class |
SybilRank.SybilRankComputation
This class implements the main part of the SybilRank algorithms, that is,
the power iterations.
|
static class |
SybilRank.TrustAggregation
This computation class is used to calculate the aggregate number of
trusted nodes.
|
static class |
SybilRank.VertexValue
Represents the state of a vertex for this algorithm.
|
ComputeFunction.Aggregators, ComputeFunction.Callback<K,VV,EV,Message>, ComputeFunction.InitCallback, ComputeFunction.MasterCallback, ComputeFunction.ReadAggregators, ComputeFunction.ReadWriteAggregators
Modifier and Type | Field and Description |
---|---|
static String |
AGGREGATOR_NUM_TRUSTED
Name of aggregator used to calculate the total number of trusted nodes.
|
static String |
ITERATION_MULTIPLIER
Property name for the iteration multiplier.
|
static int |
ITERATION_MULTIPLIER_DEFAULT
Default multiplier for the iterations.
|
static String |
TOTAL_TRUST
Property name for the total trust.
|
Constructor and Description |
---|
SybilRank() |
Modifier and Type | Method and Description |
---|---|
void |
compute(int superstep,
VertexWithValue<Long,SybilRank.VertexValue> vertex,
Iterable<Double> messages,
Iterable<EdgeWithValue<Long,Double>> edges,
ComputeFunction.Callback<Long,SybilRank.VertexValue,Double,Double> cb)
The function for computing a new vertex value or sending messages to the next superstep.
|
static double |
computeDegree(Iterable<EdgeWithValue<Long,Double>> edges)
This method computes the degree of a vertex as the sum of its edge weights.
|
protected long |
getTotalNumVertices(ComputeFunction.ReadAggregators aggregators) |
void |
init(Map<String,?> configs,
ComputeFunction.InitCallback cb)
Initialize the ComputeFunction, this is the place to register aggregators.
|
void |
masterCompute(int superstep,
ComputeFunction.MasterCallback cb)
A function for performing sequential computations between supersteps.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
postSuperstep, preSuperstep
public static final String TOTAL_TRUST
public static final String ITERATION_MULTIPLIER
public static final int ITERATION_MULTIPLIER_DEFAULT
public static final String AGGREGATOR_NUM_TRUSTED
public static double computeDegree(Iterable<EdgeWithValue<Long,Double>> edges)
edges
- the edgespublic void init(Map<String,?> configs, ComputeFunction.InitCallback cb)
ComputeFunction
init
in interface ComputeFunction<Long,SybilRank.VertexValue,Double,Double>
configs
- configuration parameterscb
- a callback for registering aggregatorspublic void masterCompute(int superstep, ComputeFunction.MasterCallback cb)
ComputeFunction
masterCompute
in interface ComputeFunction<Long,SybilRank.VertexValue,Double,Double>
superstep
- the superstepcb
- a callback for writing to aggregators or halting the computationpublic void compute(int superstep, VertexWithValue<Long,SybilRank.VertexValue> vertex, Iterable<Double> messages, Iterable<EdgeWithValue<Long,Double>> edges, ComputeFunction.Callback<Long,SybilRank.VertexValue,Double,Double> cb)
ComputeFunction
compute
in interface ComputeFunction<Long,SybilRank.VertexValue,Double,Double>
superstep
- the count of the current superstepvertex
- the current vertex with its valuemessages
- a Map of the source vertex and the message sent from the previous superstepedges
- the adjacent edges with their valuescb
- a callback for setting a new vertex value or sending messages to the next superstepprotected long getTotalNumVertices(ComputeFunction.ReadAggregators aggregators)
Copyright © 2020. All rights reserved.