Graphical models offer techniques for capturing the structure of many problems in real-world domains and provide means for representation, interpretation, and inference. The modeling framework provides tools for discovering rules for solving problems by exploring structural relationships. We present the Structural Affinity method that uses graphical models for first learning and subsequently recognizing the pattern for solving problems on the Raven’s Progressive Matrices Test of general human intelligence. Recently there has been considerable work on computational models of addressing the Raven’s test using various representations ranging from fractals to symbolic structures. In contrast, our method uses Markov Random Fields parameterized by affinity factors to discover the structure in the geometric analogy problems and induce the rules of Carpenter et al.’s cognitive model of problem-solving on the Raven’s Progressive Matrices Test. We provide a computational account that first learns the structure of a Raven’s problem and then predicts the solution by computing the probability of the correct answer by recognizing patterns corresponding to Carpenter et al.’s rules. We demonstrate that the performance of our model on the Standard Raven Progressive Matrices is comparable with existing state of the art models.