Implement Dijkstra's algorithm. Reference [Dijkstra's algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) for guidance.