Given a source node in a graph we examine all connected edges for the shortest distance from that node. We then mark the source node as visited so we don’t have to check the edges again. Based off our edge examinations we then go to the next closest node that hasn’t been visited. We repeat this process until we reach our destination node. Then we check the path we took to get there and print that out.
If you’d like a more detailed explanation definitely check out my blog post on the algorith