some algorithms implemented by MapReduce