ICP 3 - bhargavi1411/BigDataProgramming GitHub Wiki

Name : Bhargavi Saipoojitha

Class ID : 12

Task:

To Create a Map-Reduce Program for matrix multiplication.

Tools:

  • Cloudera
  • Virtual Box
  • Java
  • Hadoop

Approach

In this we have two phases that are map and reduce and one main class for the matrix multiplication. Suppose we have two matrices as m and n and in the mapper phase, for each element in both matrices are divided into the key and value pairs so the tuples for m matrix is in the form of (i,j,mij) and n matrix tuples are (j,k,njk). In this phase the key and value pairs are formed in the form of (i,k)(m,j,mij). After this it goes to the reducer phase where the pre-processing is done which meant the inner product of the first element in the first row and first element in the first column of the second matrix and this goes on and we get A*B matrix and each element in the result matrix is the unit of computation.

Code Screenshots:

Input Matrix :

This is the input matrix we have given:

Output Matrix :

This is the output matrix we have obtained:

Output :

Output Visualization with Hue :