From d691e9f47ed9b43b422712047183142d01c5e8c2 Mon Sep 17 00:00:00 2001 From: Ankur Dave Date: Sun, 12 Jan 2014 21:47:16 -0800 Subject: Move algorithms to GraphOps --- docs/graphx-programming-guide.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'docs') 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 -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 @@ -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) -- cgit v1.2.3