Exercises
Practice with the Pregel API and write an algorithm. If you need some intermediate steps, here are a couple of exercises to help you get started:
- Update the Python implementation so that it computes the normalized PageRank given by the following formula:
Here, N is the total number of nodes in the graph.
Warning: Be careful with the score initialization.
- Again, using the Python implementation, take into account relationship weights. Hint: Relationship weights are entered into the outgoing degree part of the formula.
- Update the Java implementation to track the PR values at each step. We want to be able to see the evolution of PR at each iteration when calling the algorithm in Cypher.
This means adding a new field to our schema of the double[]
type and extending it at each iteration.