We will be creating a loader component that will be used to load the data, revisit the graph format, and load a Spark graph from file.
Creating a graph from a data source
Creating the loader component
The graph.g file consists of a structure of vertex to vertex. In the following graph.g file, if we align 1 to 2, this means that there is an edge between vertex ID 1 and vertex ID 2. The second line means that there's an edge from vertex ID 1 to 3, then from 2 to 3, and finally 3 to 5:
1 2
1 3
2 3
3 5
We will take the graph.g file, load it, and see how it will provide results in Spark. First, we need to get a resource to our graph.g file. We will do this using the getClass.getResource() method to get the path to it, as...