E
- edge typepublic abstract class RandomWalkComputation<E extends org.apache.hadoop.io.Writable> extends BasicComputation<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable,E,org.apache.hadoop.io.DoubleWritable>
Constructor and Description |
---|
RandomWalkComputation() |
Modifier and Type | Method and Description |
---|---|
void |
compute(Vertex<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable,E> vertex,
Iterable<org.apache.hadoop.io.DoubleWritable> messages)
Must be defined by user to do computation on a single Vertex.
|
protected double |
getDanglingProbability()
Returns the cumulative probability from dangling vertices.
|
protected double |
getPreviousCumulativeProbability()
Returns the cumulative probability from dangling vertices.
|
protected double |
initialProbability()
Compute an initial probability value for the vertex.
|
protected abstract double |
recompute(Vertex<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable,E> vertex,
Iterable<org.apache.hadoop.io.DoubleWritable> messages,
double teleportationProbability)
Perform a single step of a random walk computation.
|
protected double |
teleportationProbability()
Reads the teleportation probability from the configuration
|
protected abstract double |
transitionProbability(Vertex<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable,E> vertex,
double stateProbability,
Edge<org.apache.hadoop.io.LongWritable,E> edge)
Compute the probability of transitioning to a neighbor vertex
|
addEdgeRequest, addVertexRequest, addVertexRequest, getContext, getMyWorkerIndex, getSuperstep, getTotalNumEdges, getTotalNumVertices, getWorkerContext, getWorkerCount, getWorkerForVertex, initialize, postSuperstep, preSuperstep, removeEdgesRequest, removeVertexRequest, sendMessage, sendMessageToAllEdges, sendMessageToMultipleEdges
aggregate, getAggregatedValue, getBroadcast, reduce, reduceMerge, setWorkerGlobalCommUsage
getConf, setConf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConf
setConf
getBroadcast
reduce, reduceMerge
aggregate
getAggregatedValue
protected double initialProbability()
protected abstract double transitionProbability(Vertex<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable,E> vertex, double stateProbability, Edge<org.apache.hadoop.io.LongWritable,E> edge)
vertex
- VertexstateProbability
- current steady state probability of the vertexedge
- edge to neighborprotected abstract double recompute(Vertex<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable,E> vertex, Iterable<org.apache.hadoop.io.DoubleWritable> messages, double teleportationProbability)
vertex
- Vertexmessages
- Messages received in the previous step.teleportationProbability
- Probability of teleporting to another
vertex.protected double getDanglingProbability()
protected double getPreviousCumulativeProbability()
public void compute(Vertex<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable,E> vertex, Iterable<org.apache.hadoop.io.DoubleWritable> messages) throws IOException
AbstractComputation
compute
in interface Computation<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable,E extends org.apache.hadoop.io.Writable,org.apache.hadoop.io.DoubleWritable,org.apache.hadoop.io.DoubleWritable>
compute
in class AbstractComputation<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.DoubleWritable,E extends org.apache.hadoop.io.Writable,org.apache.hadoop.io.DoubleWritable,org.apache.hadoop.io.DoubleWritable>
vertex
- Vertexmessages
- Messages that were sent to this vertex in the previous
superstep. Each message is only guaranteed to have
a life expectancy as long as next() is not called.IOException
protected double teleportationProbability()
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.