The research highlights the utility of RPWM in determining the optimal number of machines and task allocation, thereby significantly reducing idle time and improving overall productivity. The study demonstrates the implementation of the RPWM, utilizing a Python-based. This approach not only streamlines the manufacturing process but also contributes to cost efficiency and better resource management. By conducting a detailed case study in a trouser manufacturing setup, the paper showcases the practical application and benefits of the RPWM. This case study provides valuable insights and serves as a guide for industry practitioners, illustrating the method’s potential in transforming assembly line operations and enhancing the competitive edge in the garment manufacturing sector.