A biclustering approach based on factor graphs and the max-sum algorithm