0 0 votes Algorithms dijkstras-algorithm shortest-path graph-algorithms algorithms time-complexity + – Vishal_Huneria 911 views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply Badal_Kumar commented Dec 28, 2025 reply Follow flag 1+2+8-4 = 7 0 0 replyShare Badal_Kumar commented Dec 28, 2025 reply Follow flag 1+2+8-4 = 7 1 1 replyShare m_a_h_a_d_e_v commented Dec 28, 2025 reply Follow flag After solving, I saw that dijkstra's algorithm gives the path including -4 as the answer. The path being: a → d → e → g → h Path cost = 7 0 0 replyShare Please log in or register to add a comment.
0 0 votes ✅ Dijkstra’s Algorithm Execution Table (Source = a)StepSelected NodeabcdefghInit—0∞∞∞∞∞∞∞1a0∞∞1∞∞∞∞2d0∞31311∞∞3c0∞31311∞∞4e0∞3136∞∞5f0∞31361186i0∞31361197g0∞3136119✅ Final Output (as per Dijkstra)VertexShortest Distancea0b∞c3d1e3f6g11h9⚠️ Important NoteThe real shortest path to h is 7,But Dijkstra gives 9 because it fails in presence of negative edge (g → h = –4).FINAL ANSWER IS 9 shubham_sharma 8 answered Dec 29, 2025 shubham_sharma 8 comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Here is a to h minimum distance is 9 , because we have to find the minimum path that traverse to minimum edge of every node .. Karunendra_Patel answered Dec 31, 2025 Karunendra_Patel comment Share Follow 0 reply Please log in or register to add a comment.