MRF and loopy BP