MAP Estimation, Message Passing, and Perfect Graphs