The purpose of the loop layout problem is to determine the optimal sequence for operations by giving a cyclical arrangement of the machines along a given route. Calculating the initial cost of processes is critical in general. Additionally, these expenses can be reduced by proposing an alternate flow for the system's components. It has been observed that machines at gyms are utilized in accordance with a certain program, and so they require the optimal arrangement to accommodate these programs. In this study, the best cyclical arrangement of the machines in a gym was determined using an intuitive method. Customers enrolled in various training programs will be required to change machines in accordance with the sequence of the machines in their training program. The purpose of this study is to determine the optimal layout of these machines in order to alleviate gym traffic congestion and provide a more intuitive movement plan for consumers. The purpose is to build a layout plan that minimizes backward movement using an objective function created from the positions of the machines in the training programs, the number of customers who use these programs, and the frequency with which the machines appear in multiple programs. For the first time in gyms, an effective solution to the machine layout problem has been proposed using an optimization approach.