Talk:Dijkstra's algorithm: Difference between revisions

Content deleted Content added
Zlamma (talk | contribs)
Line 29:
 
Namely, the claim of ''"distance recorded on the current node is final and minimal"'' does not yet follow from what the reader has read so far, especially that so far the reader does not know yet that there is going to be a loop, and how the 'current node' will change. It is only true thanks to the 5th point having ''"select the one with the smallest known distance"'' (if the step 5 selected any other node, it would not be true). I feel the insight of "this is the last time we are seeing this node" is helpful though, so I wouldn't remove it, but it would be helpful to admit, that this claim has not yet been justified, and point at where it will be justified, like I tried to do with 'see next step'. Otherwise the reader like me would stop and think they didn't understand something earlier. My new idea is, since @[[User:IntGrah|IntGrah]] points out it's not clear what aspect of step 5 is highlighted, that maybe it should explicitly state something like ''"(see next steps where the choice of next 'current node' always picks smallest distance)"''. [[User:Zlamma|Zlamma]] ([[User talk:Zlamma|talk]]) 12:30, 29 May 2024 (UTC)
 
:It's important to note that this section is supposed to be a description of the algorithm, not a full fledged proof, so points which are justified inline with the algorithm should be brief. I think that the explanations you've written are a little too long. I understand your concern that the claim "final and minimal" is only justified in the next step; perhaps the earlier steps should deal with "srewritten to match the pseudocode more closely?
:Currently, Step 2 says "Set the current node to be the starting node", Step 3 deals with the current node – "For the current node...", and Step 5 deals with the selection of the next node – "select the one with the smallest known distance".
:To better approximate the actual algorithm, would you suggest rewriting Step 3 to be on the lines of "Select unvisited node with the smallest distance to be the current node"? Then, Step 2 will not need such a sentence, and Step 5 can simply say "Go back to Step 3".
:With this structure, you could justify the points you made in step 4 much more concisely, rather than long proof sketches which refer to the next step. [[User:IntGrah|IntGrah]] ([[User talk:IntGrah|talk]]) 12:46, 29 May 2024 (UTC)