In this post, GraphFrames PySpark example is discussed with shortest path problem. GraphFrames is a Spark package that allows DataFrame-based graphs in Saprk. Spark version 1.6.2 is considered for all examples. Including the package with PySaprk shell :
pyspark –packages graphframes:graphframes:0.1.0-spark1.6
from pyspark import SparkContext
example : getting “follow” relationships in the graph
g.edges.filter("relationship = 'follow'").count()
getting shortest paths to “a” from each vertex
results = g.shortestPaths(landmarks=\["a"\])
Feel free to ask your questions in the comments section!