In this section, we will create a graph using the GraphX API. Here we will first create vertex and edge RDDs and then we will use them to create the graph.
As of Spark 2.1.x, the GraphX library only provides a stable Scala API. The Java API of GraphX is still in ALPHA version. In this chapter, we will call Scala APIs of GraphX in Java wherever required to perform the graph operations provided in the GraphX library.
Let's start with creating a graph using the example provided in the previous section. The following are the ways of creating the graph.