You are on page 1of 6

Q1. Finding the shortest path.

The MapReduce program is used to find the shortest path from one page to another.
The two page numbers are fed into the program as command line arguments which
finally gives the shortest path from a->b.

The page identifier(page number) and shortest distance, partial path and list of
currently identified neighbors are sent to the Mapper. The Reducer then makes this
into a key value pair.
The Reducer finds the path with minimun distance out of all the outputs from Mapper
and gives it as the output.

The Pseudocode for Mapper and Reducer functions are as shown:


2. PageRank

The Mapper same as in shortestPath takes in the identifier of a page as argument


and page info as value.
The Reducer similarly goes through the values received from the neighbors and
uses the PageRank formula(shown below) to update the rank of the page.

The psuedocode for Mapper and Reducer function are as shown below
The ss for the iterations are as follows:

You might also like