Implemented the Gibbs sampler over the Markov network structure to perform inference over the OCR graphical models.