Step 1:Starting Dijkstra from node A. All distances set to ∞ except source (0).