concept graph in category hadoop

appears as: graph, graphs, A graph, graph
Hadoop in Practice, Second Edition

This is an excerpt from Manning's book Hadoop in Practice, Second Edition.

Imagine buying your first car, which upon delivery has a steering wheel that doesn’t function and brakes that don’t work. Oh, and it only drives in first gear. No speeding on winding back roads for you! That empty, sad feeling is familiar to those of us who want to run some cool new tech such as graph or real-time data processing with Hadoop 1,[1] only to be reminded that our powerful Hadoop clusters were good for one thing, and one thing only: MapReduce.

Graphs are mathematical constructs that represent an interconnected set of objects. They’re used to represent data such as the hyperlink structure of the internet, social networks (where they represent relationships between users), and internet routing to determine optimal paths for forwarding packets.

A graph consists of a number of nodes (formally called vertices) and links (informally called edges) that connect nodes together. Figure 7.1 shows a graph with nodes and edges.

Figure 7.22 shows the PageRank algorithm expressed as map and reduce phases. The map phase is responsible for preserving the graph as well as emitting the PageRank value to all the outbound nodes. The reducer is responsible for recalculating the new PageRank value for each node and including it in the output of the original graph.

Figure 7.22. PageRank decomposed into map and reduce phases

In this technique, you’ll operate on the graph shown in figure 7.23. In this graph, all the nodes have both inbound and outbound edges.

Although you implemented the PageRank formula, it was made simple by the fact that your graph was well connected and that every node had outbound links. Pages with no outbound links are called dangling pages, and they pose a problem for the PageRank algorithm because they become PageRank sinks—their PageRank values can’t be further propagated through the graph. This, in turn, causes convergence problems because graphs that aren’t strongly connected aren’t guaranteed to converge.

There are various approaches to solving this problem. You could remove the dangling nodes before your PageRank iterations and then add them back for a final Page-Rank iteration after the graph has converged. Or you could sum together the PageRank totals for all dangling pages and redistribute them across all the nodes in the graph. For a detailed examination of dealing with dangling pages as well as advanced PageRank practices, see Google’s PageRank and Beyond by Amy N. Langville and Carl Dean Meyer (Princeton University Press, 2012).

This concludes the section on graphs. As you learned, graphs are useful mechanisms for representing people in a social network and pages in a web. You used these models to discover some useful information about your data, such as finding the shortest path between two points and what web pages are more popular than others.