Optimization is a step to solve a problem to get more profitable results. Profitable based on the point of view used or the desired needs. The optimization value can be profitable in the maximum position or profitable in the minimum position. A problem can be solved in different ways, to produce the best solution. The best conditions can be viewed from many things, including tolerance, methods, and problems. Many theories have been developed to solve optimization problems. This optimization problem is often discussed because it is very close to human life. In this case, optimization can be interpreted as the process of achieving the most optimal results by adjusting input, selecting equipment, mathematical processes, and testing. Thereby in this paper, the Partitioning Around Medoids (PAM) method has succeeded in optimizing class grouping by calculating the closest distance between the achievement and intelligence of each student.