Find the maximum absolute row sum of matrix using MapReduce

The find the maximum absolute row sum of matrix is a good fit with MapReduce model as below.

j=n
The maximum absolute row sum = max ( sum | a_{i,j} | )
1<=i<=n j=1


- A map task receives a row n as a key, and vector of each row as its value
- emit (row, the sum of the absolute value of each entries)
- Reduce task select the maximum one

Maybe it can be written in java as below.

Vector v = givenValue;

double rowSum;
for(VectorEntry e : v) {
rowSum += Math.abs(e.get(i));
}

See more of the Hama - Algorithms

2 comments:

  1. Jon Stevens
    Add as Friend
    Today at 5:26am
    Report Message
    i can't comment on your blog cause the word verification image shows up as a broken image. but, what i wanted to ask is on this page:

    http://blog.udanax.org/2009/03/find-the-maximum-absolute-row-sum-of.html

    wouldn't it be e.get(i) in your example?

    ReplyDelete
  2. Jon, Thanks for your comment, I fixed it. ;)

    ReplyDelete

무한의 세계

무한 집합의 크기 Cardinality , 즉 원소의 개수를 수학에서는 '농도'라고 말한다. 유한 집합의 크기는 그대로 원소의 개수 이지만, 무한 집합의 경우는 원소의 개수를 낱낱이 셈하는 것은 불가능하기 때문에 '농도'라...