aboutsummaryrefslogtreecommitdiff
path: root/docs/graphx-programming-guide.md
diff options
context:
space:
mode:
authorJoseph E. Gonzalez <joseph.e.gonzalez@gmail.com>2014-01-11 09:27:00 -0800
committerJoseph E. Gonzalez <joseph.e.gonzalez@gmail.com>2014-01-11 09:27:00 -0800
commit1f45e4e572130e989cf1f91655c22352ac33b063 (patch)
tree0840ab0917049ffb4b5572cbdaae41bad678a54c /docs/graphx-programming-guide.md
parentfeaa07802203b79f454454445c0a12a2784ccfeb (diff)
downloadspark-1f45e4e572130e989cf1f91655c22352ac33b063.tar.gz
spark-1f45e4e572130e989cf1f91655c22352ac33b063.tar.bz2
spark-1f45e4e572130e989cf1f91655c22352ac33b063.zip
starting structural operator discussion.
Diffstat (limited to 'docs/graphx-programming-guide.md')
-rw-r--r--docs/graphx-programming-guide.md32
1 files changed, 30 insertions, 2 deletions
diff --git a/docs/graphx-programming-guide.md b/docs/graphx-programming-guide.md
index 3138286385..9a65745930 100644
--- a/docs/graphx-programming-guide.md
+++ b/docs/graphx-programming-guide.md
@@ -232,11 +232,9 @@ In direct analogy to the RDD `map` operator, the property
graph contains the following:
{% highlight scala %}
-class Graph[VD, ED] {
def mapVertices[VD2](map: (VertexID, VD) => VD2): Graph[VD2, ED]
def mapEdges[ED2](map: Edge[ED] => ED2): Graph[VD, ED2]
def mapTriplets[ED2](map: EdgeTriplet[VD, ED] => ED2): Graph[VD, ED2]
-}
{% endhighlight %}
Each of these operators yields a new graph with the vertex or edge properties modified by the user
@@ -269,6 +267,36 @@ val outputGraph: Graph[Double, Double] =
## Structural Operators
<a name="structural_operators"></a>
+Currently GraphX supports only a simple set of commonly used structural operators and we expect to
+add more in the future. The following is a list of the basic structural operators.
+
+{% highlight scala %}
+ def reverse: Graph[VD, ED]
+
+ def subgraph(epred: EdgeTriplet[VD,ED] => Boolean = (x => true),
+ vpred: (VertexID, VD) => Boolean = ((v,d) => true) ): Graph[VD, ED]
+
+ def mask[VD2, ED2](other: Graph[VD2, ED2]): Graph[VD, ED]
+
+ def groupEdges(merge: (ED, ED) => ED): Graph[VD,ED]
+{% endhighlight %}
+
+The `rerverse` operator returns a new graph with all the edge directions reversed. This can be
+useful when for example trying to compute the inverse PageRank.
+
+The `subgraph` operator takes vertex and edge predicates and returns the graph containing only the
+vertices that satisfy the vertex predicate (evaluate to true) and edges that satisfy the edge
+predicate *and connect vertices that satisfy the vertex predicate*. The `subgraph` operator can be
+used in number of situations to restrict the graph to the vertices and edges of interest or
+eliminate broken links.
+
+The `mask` operators returns the subgraph containing vertices and edges that are found in the input
+graph. Finish this description ...
+
+The `groupEdges` operator merges ...
+
+
+
## Join Operators
<a name="join_operators"></a>