I was solving the problem CSES - Investigation .
Let’s say the best distance we currently have for node '‘i’ is dis[i].
Let’s say from some other node ‘j’, I can again reach node ‘i’ with a minimum distance dis[i]. In this case, I understand the need for updating the parameters
- Total ways possible
- Min number of flights needed
- Max number of flights needed
But is it necessary to again push node ‘i’ in the priority queue ?
I think line 27 here https://usaco.guide/problems/cses-1202-investigation/solution is redundant.
Does skipping line 27 seem correct or am I missing something ?