some algorithms implemented by mapreduce