Programming, Data Structures, Algorithms, Computer Science, Tech.
with the smallest cost that hasn’t been visited yet. In this case, node c has a cost of 3, which is the smallest cost of all the unvisited nodes. So, node c becomes our current vertex. We’ll repeat the same procedure as before: check the unvisited neighbors of node c, and calculate their shortest