Approximate Optimization Algorithms in Markov Random Field Model Based on Statistical-Mechanical Techniques