I didn't get line no 32....check it at the end of video

I didn’t get dis[neigh] > =dis[curr] then it will be a backedge…

Tell me one thing…ig the neigh has been visted earlier then
obviously it’s distance is < the dis[curr]. ……I didn’t get that…

Hello @kaushikjatin,

I would suggest you to re-watch the video carefully from 13:48.
This condition is used to check where we should consider that particular edge or not.
As the graph is undirected, so this conditional check is used to avoid the parent node.
Because, the distance of parent will always be less than that of the parent.

As you have said, the if the neighbor has already visited then his dist[neigh] won’t be INT_MAX.
So, their are two possible cases:

  1. neighbor is parent
  2. a backedge

Hope, this is clear.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.