tags:

views:

379

answers:

5

What scenarios would warrant the use of the "Map and Reduce" algorithm?


Is there a .NET implementation of this algorithm?

+2  A: 

http://en.wikipedia.org/wiki/MapReduce#Uses

jjnguy
+1  A: 

If you were trying to write your own version of Google then that might warrant it..!!!

Seriously though, if you've got a problem that you can decompose into several smaller problems then a Map-Reduce solution would work. The Google document on MapReduce has a number of good examples, including how to process thousands of web pages, count words in document etc etc.

Sean
+1  A: 

See this other question regarding map/reduce:

Generic List Extensions in C#

Ray Vega
Thanks Ray, your link led to lots of useful information
Nick
+1  A: 

The classes of problem that are well suited for a mapreduce style solution are problems of aggregation. Of extracting data from a dataset. In C#, one could take advantage of LINQ to program in this style.

From the following article: http://codecube.net/2009/02/mapreduce-in-c-using-linq/

the GroupBy method is acting as the map, while the Select method does the job of reducing the intermediate results into the final list of results.

var wordOccurrences = words
                .GroupBy(w => w)
                .Select(intermediate => new
                {
                    Word = intermediate.Key,
                    Frequency = intermediate.Sum(w => 1)
                })
                .Where(w => w.Frequency > 10)
                .OrderBy(w => w.Frequency);

For the distributed portion, you could check out DryadLINQ: http://research.microsoft.com/en-us/projects/dryadlinq/default.aspx

Joel Martinez
A: 

There's a pretty cute MapReduce implementation for .NET at: http://mapsharp.codeplex.com/