The problem of finding the shortest path in a graph is of great significance in numerous domains, including transportation planning, network optimization, and social network analysis. Traditional algorithms such as Dijkstra’s algorithm and A* search have long been employed for this purpose, but they often encounter challenges when dealing with large-scale graphs or graphs with intricate struc- tures. In recent years, graph neural networks (GNNs) have emerged as a promising approach for learning representations and performing computations on graph- structured data. This research paper investigates the application of GNNs to the problem of optimal pathfinding by proposing a novel framework that combines the power of GNNs with efficient pathfinding algorithms. The framework lever- ages the expressive capabilities of GNNs to capture complex relationships and dependencies between graph nodes. A graph representation scheme is designed to encode both topological information and node features, enabling the GNN to learn meaningful representations that embody the underlying graph structure. These learned representations are then integrated into a pathfinding algorithm, facilitating efficient exploration of the graph to uncover the shortest distances. Extensive experiments conducted on various benchmark datasets demonstrate the superiority of the proposed approach over traditional algorithms in terms of both accuracy and efficiency. Additionally, the interpretability of the learned rep- resentations is analyzed, providing insights into how the GNN effectively captures important graph properties. This research paves the way for future advance- ments in graph-based learning algorithms and highlights the potential of GNNs in solving optimal pathfinding problems across diverse domains.