diff options
author | Ankur Dave <ankurdave@gmail.com> | 2014-01-12 21:47:16 -0800 |
---|---|---|
committer | Ankur Dave <ankurdave@gmail.com> | 2014-01-12 21:47:16 -0800 |
commit | d691e9f47ed9b43b422712047183142d01c5e8c2 (patch) | |
tree | 41dcc5954b14c08dc63714e7e3c62ff57a86f61d /docs | |
parent | 20c509b805dbfd0ebb11d2d7bd53a4379249a86f (diff) | |
download | spark-d691e9f47ed9b43b422712047183142d01c5e8c2.tar.gz spark-d691e9f47ed9b43b422712047183142d01c5e8c2.tar.bz2 spark-d691e9f47ed9b43b422712047183142d01c5e8c2.zip |
Move algorithms to GraphOps
Diffstat (limited to 'docs')
-rw-r--r-- | docs/graphx-programming-guide.md | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/docs/graphx-programming-guide.md b/docs/graphx-programming-guide.md index 0e228d8f28..572afc101b 100644 --- a/docs/graphx-programming-guide.md +++ b/docs/graphx-programming-guide.md @@ -667,9 +667,7 @@ things to worry about.) # Graph Algorithms <a name="graph_algorithms"></a> -GraphX includes a set of graph algorithms in to simplify analytics. The algorithms are contained in the `org.apache.spark.graphx.lib` package and can be accessed directly as methods on `Graph` via an implicit conversion to [`Algorithms`][Algorithms]. This section describes the algorithms and how they are used. - -[Algorithms]: api/graphx/index.html#org.apache.spark.graphx.lib.Algorithms +GraphX includes a set of graph algorithms in to simplify analytics. The algorithms are contained in the `org.apache.spark.graphx.lib` package and can be accessed directly as methods on `Graph` via [`GraphOps`][GraphOps]. This section describes the algorithms and how they are used. ## PageRank <a name="pagerank"></a> @@ -681,8 +679,6 @@ GraphX comes with static and dynamic implementations of PageRank as methods on t [PageRank]: api/graphx/index.html#org.apache.spark.graphx.lib.PageRank$ {% highlight scala %} -// Load the implicit conversion to Algorithms -import org.apache.spark.graphx.lib._ // Load the datasets into a graph val users = sc.textFile("graphx/data/users.txt").map { line => val fields = line.split("\\s+") @@ -710,8 +706,7 @@ The connected components algorithm labels each connected component of the graph [ConnectedComponents]: api/graphx/index.html#org.apache.spark.graphx.lib.ConnectedComponents$ {% highlight scala %} -// Load the implicit conversion and graph as in the PageRank example -import org.apache.spark.graphx.lib._ +// Load the graph as in the PageRank example val users = ... val followers = ... val graph = Graph(users, followers) @@ -733,8 +728,7 @@ A vertex is part of a triangle when it has two adjacent vertices with an edge be [Graph.partitionBy]: api/graphx/index.html#org.apache.spark.graphx.Graph@partitionBy(PartitionStrategy):Graph[VD,ED] {% highlight scala %} -// Load the implicit conversion and graph as in the PageRank example -import org.apache.spark.graphx.lib._ +// Load the graph as in the PageRank example val users = ... // Load the edges in canonical order and partition the graph for triangle count val graph = GraphLoader.edgeListFile(sc, "graphx/data/followers.txt", true).partitionBy(RandomVertexCut) |