Assuming start node is S and finish node is F
On the modified graph, if we travel from ui to vj via an edge connecting the two nodes, then j=(i+1) mod 2
by the way edges are defined.
So if we travel from ui to vj via any arbitrary path, j=(i+n) mod 2
where n is length of the path. (conclusion 1)
So if we travel from S0 to F0 via some path, 0 = (0 + n) mod 2
meaning n is even
So this proves that any path from S0 to F0 traverses even edges (conclusion 2)
Also, based on how edges are defined in the new graph, we can say that for any edge (u,v) in old graph, edge (ui,vj) exists in new graph for some i,j (conclusion 3)
Now, if in the original graph, an even length path exists, let the shortest path be
SA1A2...A2m-1F where Ai could be repeated. (Even edges imply odd number of nodes). Then in the new graph, We can start on S0 and traverse S0A1iA2j...A2m-1kFm to land on F (from conclusion 3). Then the subscript on F will be
(0 + 2m-1 +1) mod 2 = 0
(from conclusion 2). Hence, a path will exist on the new graph too containing the same length.
Hence, if the solution exists, then there exists a path from S0 to F0 in the new graph too (conclusion 4)
Also, based on how edges are defined in the new graph, for every edge from ui to vj, then there is an edge from u to v in the original graph. Hence, for any path in the new graph from ui to vj, there is a corresponding path from u to v in the old graph having the same length
Therefore if a path exists from S0 to F0, there exists a corresponding path in the original graph having the same length (conclusion 5)
Conclusions 2,4 and 5 together prove that the shortest path from S0 to F0 is the correct answer. If the path cannot be found, then it does not exist in the original graph either (from conclusion 4)
Hence, the algorithm is correct