Optimizing scheduling in healthcare systems is crucial for improving operational efficiency and patient satisfaction. This study analyzes the performance of the A* algorithm in optimizing doctor appointment scheduling in hospitals. Using a heuristic-based approach, the proposed solution aims to minimize search time and improve the accuracy of determining optimal appointment slots. The algorithm integrates time penalties to align scheduling outcomes with patient preferences, demonstrating significant improvements compared to traditional linear search methods.A comparative evaluation was conducted with traditional search algorithms using experimental data, showing that A* significantly reduces execution steps (the number of search steps directly impacts energy efficiency) while maintaining high accuracy in slot allocation. The A* algorithm excels in this context by providing consistent solutions with reduced search effort. This study addresses gaps in previous research, particularly in handling large Datasetss and meeting real-time scheduling needs.The results of this research are expected to contribute to the development of efficient hospital reservation systems, thereby enhancing patient experiences and streamlining hospital operations. This study serves as a foundation for further exploration of the application of the A* algorithm in healthcare optimization.