MAP Estimation: Linear Programming Relaxation and Message-Passing Algorithms