For the RDD API, the basic class in GraphX is called a Graph
(org.apache.spark.graphx.Graph
), which contains two types of RDDs as you might have guessed:
- Edges
- Vertices
In the following graph, you can see we have a number of different vertices, namely Fawad, Aznan, Ben, Tom, and Marathon.
Figure 7.6: Depiction of a graph
This is a labeled graph where the edges and vertices have labels associated with them.
Following the Graph, we will look at a code example, where we:
- Create the vertices
- Create the edges
- Instantiate a graph object
- View the vertices configured with the graph
The following code example can be used to create a Graph similar to the one shown in the preceding figure.