Introduction

Graphs enable solving certain data problems more easily and intuitively. At the core of a graph lies concepts of edges, nodes (or vertices), and their properties. For example, the following are two seemingly disconnected graphs. The left one represents a social network and the relationship (the edges of the graph) between friends (the vertices of the graph), while the right one is a graph that represents restaurant recommendations. Note that the vertices for our restaurant recommendations are not only the restaurants themselves but also the cuisine type (for example, Ramen) and location (for example, Vancouver, B.C., Canada); these are the properties of the vertices. This ability to assign nodes to virtually anything and use edges to define the relationship between these nodes is the greatest virtue of graphs, that is, their flexibility:

This flexibility allows us to conceptually connect these two seemingly disparate graphs into one common graph. In this case, we can join the social network with restaurant recommendations, in which the edges (that is, connections) between the friends and the restaurants are through their ratings:

For example, if Isabella wants to find a great ramen restaurant (vertex: cuisine type) in Vancouver (vertex: location), then traversing her friends' reviews (edge: ratings), she will most likely choose Kintaro Ramen (vertex: restaurant) as both Samantha (vertex: friend) and Juliette (vertex: friend) have rated the restaurant favorably.

While graphs are intuitive and flexible, one of the key problems with a graph is that its traversal and computation of graph algorithms are often resource intensive and slow. With GraphFrames for Apache Spark, you are able to leverage the speed and performance of Apache Spark DataFrames to traverse and compute your graphs in a distributed and performant manner.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset