Shortest Path Problem
Back in the 11 th grade, I had some fun developing a game that used the A* Pathfinding algorithm to implement the tracking of the enemies to the player while they avoid certain obstacles. It was a third-party library that allowed me to easily implement it without worrying about the algorithm itself. However, when I began studying this week’s lesson I developed a level of appreciation for how pathfinding algorithms are implemented.
Edsger Wybe Dijkstra, renowned Computer Scientist and author of the Dijkstra Algorithm, has provided a series of steps that makes pathfinding in graphs a much more efficient task. The pseudocode for Dijkstra Algorithm is as follows:
With this, we can find the lengths of shortest paths from a given source vertex to all other vertices as we can see below.
I had a challenging yet engaging experience implementing this algorithm in the problem sets. My learning experience in this lesson and the course overall is one filled with discoveries, reflections, and “aha” moments that I will forever cherish. After all the lessons and problem sets, I developed an admiration for trailblazers such as Dijkstra which paved the way for people like me who are passionate about computer science. I hope to continue learning from them as I move forward on my journey in the world of Discrete Mathematics.