In Chapter 1, Introduction to Apache Spark, we provided a brief introduction to the graph libraries provided by Spark. In this section, we will discuss these libraries in more detail. A graph is one of the data structures that is used in computer science to solve some real-world problems. A graph is represented by a set of vertices and edges. A vertex is an object, and an edge defines a relationship between two vertices. One of the examples of graphs is a social network, where each person is represented by a vertex, and a relationship between two people is represented by an edge. The following figure shows a graph with five vertices and five edges:
The graph represented here can also be represented as a set, V = {V1, V2, V3, V4, V5} and E = {E1, E2, E3, E4, E5}. A graph can also be categorized as a directed or undirected...