Recall the algorithm update procedure updateu v element Edis
Solution
Here is the proof by Induction method :
Hypothesis : For every traversed vertex \'x\' , dist(x) is the shortest distance between \'x\' and s(source) . For every un-traversed vertex \'y\' , dist(y) is the shorted distance through traveresed vertex only from s to \'y\'.
Basis : Let us consider that there is a single vertex in the Graph and which is s (the starting vertex) then assumed hypotheis is a trivial case.
Now let us consider that the Graph has n vertices and assume that the hypothesis is true for n-1 vertices.
Now select an edge xy where y have minimum dist(y) from any untraversed vertices and edge xy is as -
dist(y) = dist(x) + L(x,y) then dist(y) must be shortest distance between s and y since if a shortest path could have existed and if z were the fisrt un-traversed vertex then from the above hypothesis dist(z) < dist(y) would lead to a contradiction. and same as above if a shorted path to \'y\' could have been possible without untraversed vertex then dist(y) < dist(x) + L(x,y).
Hence after traversing vertex \'y\' the hypothesis will hold true for every untraversed vertices \'z\', where dist(z) is the shortest distance of z from s by allowing traversed vertex only, because if a shortest path could have been there without visiting y, the that would have been tracked before itself in between the process which traversing y itself.
Please let me know if anything is not understood.
