This research explores the development and optimization of a movie recommendation system through the integration of knowledge graph technology and the GP 2 graph programming language. The system aims to provide personalized movie recommendations by analyzing users’ previous ratings and preferences. While existing studies have demonstrated promising outcomes in this field, significant challenges remain, particularly regarding computational efficiency and the ability to handle large scale datasets effectively. To address these limitations, this study focuses on optimizing the knowledge graph structure through the strategic implementation of rooted nodes. The research demonstrates that this approach maintains accuracy and precision comparable to traditional non-rooted implementations while delivering substantial improvements in processing speed. The results validate the effectiveness of rooted nodes in enhancing the system’s computational efficiency, particularly when handling larger datasets. The successful development of a rooted node version of the recommendation system represents a significant advancement in the field, offering improved scalability without compromising performance. The system demonstrates consistent reliability and efficiency across varying dataset sizes, representing a significant advancement in recommendation system optimization. These findings establish a solid foundation for future research on enhancing recommendation systems using knowledge graphs and graph programming languages.