Markov Random Field solver implementation