anchor.diff:  <8> In order to determine how to distribute the energy to neighbors, a "1"-count is used to determine how many incident vertices exist for the `MessageScope`.
   <9> Initially, each vertex is provided an equal amount of energy represented as a double.
   <10> Energy is aggregated, computed on according to the PageRank algorithm, and then disseminated according to the defined `MessageScope.Local`.
  -<11> The computation is terminated after a pre-defined number of iterations.
  +<11> The computation is terminated after epsilon-convergence is met or a pre-defined number of iterations have taken place.
   
   The above `PageRankVertexProgram` is used as follows.
   
  
positive.code: 
  [source,java]
  ----
  public class PageRankVertexProgram implements VertexProgram<Double> {  <1>
  
      public static final String PAGE_RANK = "gremlin.pageRankVertexProgram.pageRank";
      private static final String EDGE_COUNT = "gremlin.pageRankVertexProgram.edgeCount";
      private static final String PROPERTY = "gremlin.pageRankVertexProgram.property";
      private static final String VERTEX_COUNT = "gremlin.pageRankVertexProgram.vertexCount";
      private static final String ALPHA = "gremlin.pageRankVertexProgram.alpha";
      private static final String TOTAL_ITERATIONS = "gremlin.pageRankVertexProgram.totalIterations";
      private static final String EDGE_TRAVERSAL = "gremlin.pageRankVertexProgram.edgeTraversal";
      private static final String INITIAL_RANK_TRAVERSAL = "gremlin.pageRankVertexProgram.initialRankTraversal";
  
      private MessageScope.Local<Double> incidentMessageScope = MessageScope.Local.of(__::outE); <2>
      private MessageScope.Local<Double> countMessageScope = MessageScope.Local.of(new MessageScope.Local.ReverseTraversalSupplier(this.incidentMessageScope));
      private PureTraversal<Vertex, Edge> edgeTraversal = null;
      private PureTraversal<Vertex, ? extends Number> initialRankTraversal = null;
      private double vertexCountAsDouble = 1.0d;
      private double alpha = 0.85d;
      private int totalIterations = 30;
      private String property = PAGE_RANK; <3>
      private Set<VertexComputeKey> vertexComputeKeys;
  
      private PageRankVertexProgram() {
  
  
negative.code: 
      @Override
      public void setup(final Memory memory) {
          memory.set(TELEPORTATION_ENERGY, null == this.initialRankTraversal ? 1.0d : 0.0d);
          memory.set(VERTEX_COUNT, 0.0d);
          memory.set(CONVERGENCE_ERROR, 1.0d);
      }
  
      @Override
      public void execute(final Vertex vertex, Messenger<Double> messenger, final Memory memory) { <7>
          if (memory.isInitialIteration()) {
              messenger.sendMessage(this.countMessageScope, 1.0d);  <8>
              memory.add(VERTEX_COUNT, 1.0d);
          } else {
              final double vertexCount = memory.<Double>get(VERTEX_COUNT);
              final double edgeCount;
              double pageRank;
              if (1 == memory.getIteration()) {
                  edgeCount = IteratorUtils.reduce(messenger.receiveMessages(), 0.0d, (a, b) -> a + b);
                  vertex.property(VertexProperty.Cardinality.single, EDGE_COUNT, edgeCount);
                  pageRank = null == this.initialRankTraversal ?
                          0.0d :
                          TraversalUtil.apply(vertex, this.initialRankTraversal.get()).doubleValue(); <9>
              } else {
                  edgeCount = vertex.value(EDGE_COUNT);
                  pageRank = IteratorUtils.reduce(messenger.receiveMessages(), 0.0d, (a, b) -> a + b); <10>
              }
              //////////////////////////
              final double teleporationEnergy = memory.get(TELEPORTATION_ENERGY);
              if (teleporationEnergy > 0.0d) {
                  final double localTerminalEnergy = teleporationEnergy / vertexCount;
                  pageRank = pageRank + localTerminalEnergy;
                  memory.add(TELEPORTATION_ENERGY, -localTerminalEnergy);
              }
              final double previousPageRank = vertex.<Double>property(this.property).orElse(0.0d);
              memory.add(CONVERGENCE_ERROR, Math.abs(pageRank - previousPageRank));
              vertex.property(VertexProperty.Cardinality.single, this.property, pageRank);
              memory.add(TELEPORTATION_ENERGY, (1.0d - this.alpha) * pageRank);
              pageRank = this.alpha * pageRank;
              if (edgeCount > 0.0d)
                  messenger.sendMessage(this.incidentMessageScope, pageRank / edgeCount);
              else
                  memory.add(TELEPORTATION_ENERGY, pageRank);
          }
      }
  
      @Override
      public boolean terminate(final Memory memory) { <11>
          boolean terminate = memory.<Double>get(CONVERGENCE_ERROR) < this.epsilon || memory.getIteration() >= this.maxIterations;
          memory.set(CONVERGENCE_ERROR, 0.0d);
          return terminate;
      }
  
      @Override
      public String toString() {
          return StringFactory.vertexProgramString(this, "alpha=" + this.alpha + ", epsilon=" + this.epsilon + ", iterations=" + this.maxIterations);
      }
  }
  ----
  