The Structural Affinity Method for Solving the Raven's Progressive Matrices Test for Intelligence